Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (209686 => 209687)
--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp 2016-12-11 23:37:11 UTC (rev 209686)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp 2016-12-11 23:40:15 UTC (rev 209687)
@@ -582,21 +582,11 @@
networkAgent->didLoadResourceFromMemoryCache(*loader, *cachedResource);
}
-InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceResponseImpl(InstrumentingAgents& instrumentingAgents)
+void InspectorInstrumentation::didReceiveResourceResponseImpl(InstrumentingAgents& instrumentingAgents, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
{
- return InspectorInstrumentationCookie(instrumentingAgents, 0);
-}
-
-void InspectorInstrumentation::didReceiveResourceResponseImpl(const InspectorInstrumentationCookie& cookie, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
-{
- if (!cookie.isValid())
- return;
-
if (!loader)
return;
- InstrumentingAgents& instrumentingAgents = *cookie.instrumentingAgents();
-
if (InspectorNetworkAgent* networkAgent = instrumentingAgents.inspectorNetworkAgent())
networkAgent->didReceiveResponse(identifier, *loader, response, resourceLoader);
if (WebConsoleAgent* consoleAgent = instrumentingAgents.webConsoleAgent())
@@ -603,30 +593,6 @@
consoleAgent->didReceiveResponse(identifier, response); // This should come AFTER resource notification, front-end relies on this.
}
-void InspectorInstrumentation::didReceiveResourceResponseButCanceledImpl(Frame* frame, DocumentLoader& loader, unsigned long identifier, const ResourceResponse& r)
-{
- if (!frame)
- return;
-
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(frame);
- InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, &loader, r, nullptr);
-}
-
-void InspectorInstrumentation::continueAfterXFrameOptionsDeniedImpl(Frame* frame, DocumentLoader& loader, unsigned long identifier, const ResourceResponse& r)
-{
- didReceiveResourceResponseButCanceledImpl(frame, loader, identifier, r);
-}
-
-void InspectorInstrumentation::continueWithPolicyDownloadImpl(Frame* frame, DocumentLoader& loader, unsigned long identifier, const ResourceResponse& r)
-{
- didReceiveResourceResponseButCanceledImpl(frame, loader, identifier, r);
-}
-
-void InspectorInstrumentation::continueWithPolicyIgnoreImpl(Frame* frame, DocumentLoader& loader, unsigned long identifier, const ResourceResponse& r)
-{
- didReceiveResourceResponseButCanceledImpl(frame, loader, identifier, r);
-}
-
void InspectorInstrumentation::didReceiveThreadableLoaderResponseImpl(InstrumentingAgents& instrumentingAgents, DocumentThreadableLoader& documentThreadableLoader, unsigned long identifier)
{
if (InspectorNetworkAgent* networkAgent = instrumentingAgents.inspectorNetworkAgent())
Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (209686 => 209687)
--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h 2016-12-11 23:37:11 UTC (rev 209686)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h 2016-12-11 23:40:15 UTC (rev 209687)
@@ -154,15 +154,15 @@
static void continueAfterPingLoader(Frame&, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse&);
static void markResourceAsCached(Page&, unsigned long identifier);
static void didLoadResourceFromMemoryCache(Page&, DocumentLoader*, CachedResource*);
- static InspectorInstrumentationCookie willReceiveResourceResponse(Frame*);
- static void didReceiveResourceResponse(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
- static void continueAfterXFrameOptionsDenied(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
- static void continueWithPolicyDownload(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
- static void continueWithPolicyIgnore(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
+ static void didReceiveResourceResponse(Frame&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
static void didReceiveThreadableLoaderResponse(DocumentThreadableLoader&, unsigned long identifier);
static void didReceiveData(Frame*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
static void didFinishLoading(Frame*, DocumentLoader*, unsigned long identifier, double finishTime);
static void didFailLoading(Frame*, DocumentLoader*, unsigned long identifier, const ResourceError&);
+ static void continueAfterXFrameOptionsDenied(Frame&, unsigned long identifier, DocumentLoader&, const ResourceResponse&);
+ static void continueWithPolicyDownload(Frame&, unsigned long identifier, DocumentLoader&, const ResourceResponse&);
+ static void continueWithPolicyIgnore(Frame&, unsigned long identifier, DocumentLoader&, const ResourceResponse&);
+
static void didFinishXHRLoading(ScriptExecutionContext*, unsigned long identifier, std::optional<String> decodedText, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
static void willLoadXHRSynchronously(ScriptExecutionContext*);
static void didLoadXHRSynchronously(ScriptExecutionContext*);
@@ -324,12 +324,7 @@
static void continueAfterPingLoaderImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse&);
static void markResourceAsCachedImpl(InstrumentingAgents&, unsigned long identifier);
static void didLoadResourceFromMemoryCacheImpl(InstrumentingAgents&, DocumentLoader*, CachedResource*);
- static InspectorInstrumentationCookie willReceiveResourceResponseImpl(InstrumentingAgents&);
- static void didReceiveResourceResponseImpl(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
- static void didReceiveResourceResponseButCanceledImpl(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
- static void continueAfterXFrameOptionsDeniedImpl(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
- static void continueWithPolicyDownloadImpl(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
- static void continueWithPolicyIgnoreImpl(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
+ static void didReceiveResourceResponseImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
static void didReceiveThreadableLoaderResponseImpl(InstrumentingAgents&, DocumentThreadableLoader&, unsigned long identifier);
static void didReceiveDataImpl(InstrumentingAgents&, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
static void didFinishLoadingImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, double finishTime);
@@ -850,37 +845,12 @@
didLoadResourceFromMemoryCacheImpl(instrumentingAgentsForPage(page), loader, resource);
}
-inline InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceResponse(Frame* frame)
+inline void InspectorInstrumentation::didReceiveResourceResponse(Frame& frame, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
{
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
- return willReceiveResourceResponseImpl(*instrumentingAgents);
- return InspectorInstrumentationCookie();
+ didReceiveResourceResponseImpl(*instrumentingAgents, identifier, loader, response, resourceLoader);
}
-inline void InspectorInstrumentation::didReceiveResourceResponse(const InspectorInstrumentationCookie& cookie, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
-{
- // Call this unconditionally so that we're able to log to console with no front-end attached.
- didReceiveResourceResponseImpl(cookie, identifier, loader, response, resourceLoader);
-}
-
-inline void InspectorInstrumentation::continueAfterXFrameOptionsDenied(Frame* frame, DocumentLoader& loader, unsigned long identifier, const ResourceResponse& r)
-{
- FAST_RETURN_IF_NO_FRONTENDS(void());
- InspectorInstrumentation::continueAfterXFrameOptionsDeniedImpl(frame, loader, identifier, r);
-}
-
-inline void InspectorInstrumentation::continueWithPolicyDownload(Frame* frame, DocumentLoader& loader, unsigned long identifier, const ResourceResponse& r)
-{
- FAST_RETURN_IF_NO_FRONTENDS(void());
- InspectorInstrumentation::continueWithPolicyDownloadImpl(frame, loader, identifier, r);
-}
-
-inline void InspectorInstrumentation::continueWithPolicyIgnore(Frame* frame, DocumentLoader& loader, unsigned long identifier, const ResourceResponse& r)
-{
- FAST_RETURN_IF_NO_FRONTENDS(void());
- InspectorInstrumentation::continueWithPolicyIgnoreImpl(frame, loader, identifier, r);
-}
-
inline void InspectorInstrumentation::didReceiveThreadableLoaderResponse(DocumentThreadableLoader& documentThreadableLoader, unsigned long identifier)
{
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(documentThreadableLoader.document()))
@@ -905,6 +875,27 @@
didFailLoadingImpl(*instrumentingAgents, identifier, loader, error);
}
+inline void InspectorInstrumentation::continueAfterXFrameOptionsDenied(Frame& frame, unsigned long identifier, DocumentLoader& loader, const ResourceResponse& response)
+{
+ // Treat the same as didReceiveResponse.
+ if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+ didReceiveResourceResponseImpl(*instrumentingAgents, identifier, &loader, response, nullptr);
+}
+
+inline void InspectorInstrumentation::continueWithPolicyDownload(Frame& frame, unsigned long identifier, DocumentLoader& loader, const ResourceResponse& response)
+{
+ // Treat the same as didReceiveResponse.
+ if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+ didReceiveResourceResponseImpl(*instrumentingAgents, identifier, &loader, response, nullptr);
+}
+
+inline void InspectorInstrumentation::continueWithPolicyIgnore(Frame& frame, unsigned long identifier, DocumentLoader& loader, const ResourceResponse& response)
+{
+ // Treat the same as didReceiveResponse.
+ if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+ didReceiveResourceResponseImpl(*instrumentingAgents, identifier, &loader, response, nullptr);
+}
+
inline void InspectorInstrumentation::didFinishXHRLoading(ScriptExecutionContext* context, unsigned long identifier, std::optional<String> decodedText, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
{
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (209686 => 209687)
--- trunk/Source/WebCore/loader/DocumentLoader.cpp 2016-12-11 23:37:11 UTC (rev 209686)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp 2016-12-11 23:40:15 UTC (rev 209687)
@@ -639,7 +639,7 @@
void DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied(unsigned long identifier, const ResourceResponse& response)
{
- InspectorInstrumentation::continueAfterXFrameOptionsDenied(m_frame, *this, identifier, response);
+ InspectorInstrumentation::continueAfterXFrameOptionsDenied(*m_frame, identifier, *this, response);
m_frame->document()->enforceSandboxFlags(SandboxOrigin);
if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement())
ownerElement->dispatchEvent(Event::create(eventNames().loadEvent, false, false));
@@ -798,7 +798,7 @@
}
if (ResourceLoader* mainResourceLoader = this->mainResourceLoader())
- InspectorInstrumentation::continueWithPolicyDownload(m_frame, *this, mainResourceLoader->identifier(), m_response);
+ InspectorInstrumentation::continueWithPolicyDownload(*m_frame, mainResourceLoader->identifier(), *this, m_response);
// When starting the request, we didn't know that it would result in download and not navigation. Now we know that main document URL didn't change.
// Download may use this knowledge for purposes unrelated to cookies, notably for setting file quarantine data.
@@ -821,7 +821,7 @@
}
case PolicyIgnore:
if (ResourceLoader* mainResourceLoader = this->mainResourceLoader())
- InspectorInstrumentation::continueWithPolicyIgnore(m_frame, *this, mainResourceLoader->identifier(), m_response);
+ InspectorInstrumentation::continueWithPolicyIgnore(*m_frame, mainResourceLoader->identifier(), *this, m_response);
stopLoadingForPolicyChange();
return;
}