Diff
Modified: trunk/LayoutTests/ChangeLog (125680 => 125681)
--- trunk/LayoutTests/ChangeLog 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/LayoutTests/ChangeLog 2012-08-15 16:50:13 UTC (rev 125681)
@@ -1,3 +1,22 @@
+2012-08-15 Pavel Chadnov <[email protected]>
+
+ Web Inspector: Incorrect XHR responses when two async xhrs are sent synchronously
+ https://bugs.webkit.org/show_bug.cgi?id=91630
+
+ Reviewed by Vsevolod Vlasov.
+
+ New test for two async XHRs sent synchronously.
+
+ * http/tests/inspector/network-test.js:
+ (doXHR):
+ (doXHRWithPayload.xhr.onreadystatechange):
+ (doXHRWithPayload):
+ * http/tests/inspector/network/network-xhr-async-double-expected.txt: Added.
+ * http/tests/inspector/network/network-xhr-async-double.html: Added.
+ * http/tests/inspector/network/resources/echo-payload.php: Added.
+ * platform/chromium/http/tests/inspector/console-xhr-logging-async-expected.txt:
+ * platform/chromium/http/tests/inspector/console-xhr-logging-expected.txt:
+
2012-08-15 Christophe Dumez <[email protected]>
[WK2] Add support for Web Intents MessagePorts
Added: trunk/LayoutTests/http/tests/inspector/network/network-xhr-async-double-expected.txt (0 => 125681)
--- trunk/LayoutTests/http/tests/inspector/network/network-xhr-async-double-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/network/network-xhr-async-double-expected.txt 2012-08-15 16:50:13 UTC (rev 125681)
@@ -0,0 +1,5 @@
+CONSOLE MESSAGE: line 18: Done.
+Tests responses in network tab for two XHRs sent without any delay between them. Bug 91630
+resource1.content: request1
+resource2.content: request2
+
Property changes on: trunk/LayoutTests/http/tests/inspector/network/network-xhr-async-double-expected.txt
___________________________________________________________________
Added: svn:eol-style
Added: trunk/LayoutTests/http/tests/inspector/network/network-xhr-async-double.html (0 => 125681)
--- trunk/LayoutTests/http/tests/inspector/network/network-xhr-async-double.html (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/network/network-xhr-async-double.html 2012-08-15 16:50:13 UTC (rev 125681)
@@ -0,0 +1,72 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+var firstXHRLoaded = false;
+var secondXHRLoaded = false;
+
+function loadData()
+{
+ doXHRWithPayload("POST", "resources/echo-payload.php", true, 'request1', firstResourceLoaded);
+ doXHRWithPayload("POST", "resources/echo-payload.php", true, 'request2', secondResourceLoaded);
+}
+
+function resourcesLoaded()
+{
+ if (firstXHRLoaded && secondXHRLoaded)
+ console.log('Done.');
+}
+
+function firstResourceLoaded()
+{
+ firstXHRLoaded = true;
+ resourcesLoaded();
+}
+
+function secondResourceLoaded()
+{
+ secondXHRLoaded = true;
+ resourcesLoaded();
+}
+
+function test()
+{
+ // Since this test could be run together with other inspector backend cache
+ // tests, we need to reset size limits to default ones.
+ InspectorTest.resetInspectorResourcesData(step1);
+
+ function step1()
+ {
+ InspectorTest.addConsoleSniffer(step2);
+ InspectorTest.evaluateInPage("loadData()");
+ }
+
+ function step2()
+ {
+ var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 2];
+ var request2 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+ request1.requestContent(step3);
+ request2.requestContent(step3);
+ }
+
+ var toLoad = 2;
+ function step3()
+ {
+ if (--toLoad)
+ return;
+ var request1 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 2];
+ var request2 = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
+ InspectorTest.addResult("resource1.content: " + request1.content);
+ InspectorTest.addResult("resource2.content: " + request2.content);
+ InspectorTest.assertTrue(request1.content === 'request1' && request2.content === 'request2');
+ InspectorTest.completeTest();
+ }
+}
+</script>
+</head>
+<body _onload_="runTest()">
+Tests responses in network tab for two XHRs sent without any delay between them.
+<a href="" 91630</a>
+</body>
+</html>
Property changes on: trunk/LayoutTests/http/tests/inspector/network/network-xhr-async-double.html
___________________________________________________________________
Added: svn:eol-style
Added: trunk/LayoutTests/http/tests/inspector/network/resources/echo-payload.php (0 => 125681)
--- trunk/LayoutTests/http/tests/inspector/network/resources/echo-payload.php (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/network/resources/echo-payload.php 2012-08-15 16:50:13 UTC (rev 125681)
@@ -0,0 +1,3 @@
+<?php
+ echo file_get_contents('php://input');
+?>
Modified: trunk/LayoutTests/http/tests/inspector/network-test.js (125680 => 125681)
--- trunk/LayoutTests/http/tests/inspector/network-test.js 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/LayoutTests/http/tests/inspector/network-test.js 2012-08-15 16:50:13 UTC (rev 125681)
@@ -27,6 +27,11 @@
function doXHR(method, url, async, callback)
{
+ doXHRWithPayload(method, url, async, null, callback);
+}
+
+function doXHRWithPayload(method, url, async, payload, callback)
+{
var xhr = new XMLHttpRequest();
xhr._onreadystatechange_ = function()
{
@@ -34,9 +39,9 @@
if (typeof(callback) === "function")
callback();
}
- };
+ }
xhr.open(method, url, async);
- xhr.send(null);
+ xhr.send(payload);
}
function resetInspectorResourcesData()
Modified: trunk/LayoutTests/platform/chromium/http/tests/inspector/console-xhr-logging-async-expected.txt (125680 => 125681)
--- trunk/LayoutTests/platform/chromium/http/tests/inspector/console-xhr-logging-async-expected.txt 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/LayoutTests/platform/chromium/http/tests/inspector/console-xhr-logging-async-expected.txt 2012-08-15 16:50:13 UTC (rev 125681)
@@ -3,6 +3,6 @@
Tests that XMLHttpRequest Logging works when Enabled and doesn't show logs when Disabled for asynchronous XHRs.
Bug 79229
-XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html". network-test.js:39
+XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html". network-test.js:44
Done. console-xhr-logging-async.html:14
Modified: trunk/LayoutTests/platform/chromium/http/tests/inspector/console-xhr-logging-expected.txt (125680 => 125681)
--- trunk/LayoutTests/platform/chromium/http/tests/inspector/console-xhr-logging-expected.txt 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/LayoutTests/platform/chromium/http/tests/inspector/console-xhr-logging-expected.txt 2012-08-15 16:50:13 UTC (rev 125681)
@@ -11,17 +11,17 @@
Tests that XMLHttpRequest Logging works when Enabled and doesn't show logs when Disabled.
sending a GET request to resources/xhr-exists.html console-xhr-logging.html:10
-XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html". network-test.js:39
+XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-exists.html". network-test.js:44
sending a GET request to resources/xhr-does-not-exist.html console-xhr-logging.html:10
-GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found) network-test.js:39
-XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html". network-test.js:39
+GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found) network-test.js:44
+XHR finished loading: "http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html". network-test.js:44
sending a POST request to resources/post-target.cgi console-xhr-logging.html:10
-XHR finished loading: "http://127.0.0.1:8000/inspector/resources/post-target.cgi". network-test.js:39
+XHR finished loading: "http://127.0.0.1:8000/inspector/resources/post-target.cgi". network-test.js:44
sending a GET request to http://localhost:8000/inspector/resources/xhr-exists.html console-xhr-logging.html:10
XMLHttpRequest cannot load http://localhost:8000/inspector/resources/xhr-exists.html. Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
sending a GET request to resources/xhr-exists.html console-xhr-logging.html:10
sending a GET request to resources/xhr-does-not-exist.html console-xhr-logging.html:10
-GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found) network-test.js:39
+GET http://127.0.0.1:8000/inspector/resources/xhr-does-not-exist.html 404 (Not Found) network-test.js:44
sending a POST request to resources/post-target.cgi console-xhr-logging.html:10
sending a GET request to http://localhost:8000/inspector/resources/xhr-exists.html console-xhr-logging.html:10
XMLHttpRequest cannot load http://localhost:8000/inspector/resources/xhr-exists.html. Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
Modified: trunk/Source/WebCore/ChangeLog (125680 => 125681)
--- trunk/Source/WebCore/ChangeLog 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/Source/WebCore/ChangeLog 2012-08-15 16:50:13 UTC (rev 125681)
@@ -1,3 +1,48 @@
+2012-08-15 Pavel Chadnov <[email protected]>
+
+ Web Inspector: Incorrect XHR responses when two async xhrs are sent synchronously
+ https://bugs.webkit.org/show_bug.cgi?id=91630
+
+ Reviewed by Vsevolod Vlasov.
+
+ CachedResource object for XHR response is now taken from ResourceLoader (if it's possible).
+
+ Test: http/tests/inspector/network/network-xhr-async-double.html
+
+ * inspector/InspectorInstrumentation.cpp:
+ (WebCore):
+ (WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
+ (WebCore::InspectorInstrumentation::didReceiveResourceResponseButCanceledImpl):
+ * inspector/InspectorInstrumentation.h:
+ (InspectorInstrumentation):
+ (WebCore::InspectorInstrumentation::didReceiveResourceResponse):
+ * inspector/InspectorResourceAgent.cpp:
+ (WebCore::InspectorResourceAgent::willSendRequest):
+ (WebCore::InspectorResourceAgent::didReceiveResponse):
+ * inspector/InspectorResourceAgent.h:
+ (WebCore):
+ (InspectorResourceAgent):
+ * loader/DocumentThreadableLoader.cpp:
+ (WebCore::DocumentThreadableLoader::didReceiveResponse):
+ * loader/ResourceLoadNotifier.cpp:
+ (WebCore::ResourceLoadNotifier::didReceiveResponse):
+ (WebCore::ResourceLoadNotifier::dispatchDidReceiveResponse):
+ * loader/ResourceLoadNotifier.h:
+ (ResourceLoadNotifier):
+ * loader/ResourceLoader.cpp:
+ (WebCore::ResourceLoader::isSubresourceLoader):
+ (WebCore):
+ * loader/ResourceLoader.h:
+ (ResourceLoader):
+ * loader/SubresourceLoader.cpp:
+ (WebCore::SubresourceLoader::cachedResource):
+ (WebCore):
+ (WebCore::SubresourceLoader::isSubresourceLoader):
+ * loader/SubresourceLoader.h:
+ (SubresourceLoader):
+ * loader/appcache/ApplicationCacheGroup.cpp:
+ (WebCore::ApplicationCacheGroup::didReceiveResponse):
+
2012-08-15 Taiju Tsuiki <[email protected]>
Web Inspector: Use default parameter on reportResult in InspectorFileSystemAgent
Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (125680 => 125681)
--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp 2012-08-15 16:50:13 UTC (rev 125681)
@@ -674,7 +674,7 @@
return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);
}
-void InspectorInstrumentation::didReceiveResourceResponseImpl(const InspectorInstrumentationCookie& cookie, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response)
+void InspectorInstrumentation::didReceiveResourceResponseImpl(const InspectorInstrumentationCookie& cookie, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
{
if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
timelineAgent->didReceiveResourceResponse();
@@ -684,7 +684,7 @@
if (!instrumentingAgents)
return;
if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorResourceAgent())
- resourceAgent->didReceiveResponse(identifier, loader, response);
+ resourceAgent->didReceiveResponse(identifier, loader, response, resourceLoader);
if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorConsoleAgent())
consoleAgent->didReceiveResponse(identifier, response); // This should come AFTER resource notification, front-end relies on this.
}
@@ -692,7 +692,7 @@
void InspectorInstrumentation::didReceiveResourceResponseButCanceledImpl(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
{
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(frame, identifier, r);
- InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, loader, r);
+ InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, loader, r, 0);
}
void InspectorInstrumentation::continueAfterXFrameOptionsDeniedImpl(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (125680 => 125681)
--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h 2012-08-15 16:50:13 UTC (rev 125681)
@@ -172,7 +172,7 @@
static InspectorInstrumentationCookie willReceiveResourceData(Frame*, unsigned long identifier, int length);
static void didReceiveResourceData(const InspectorInstrumentationCookie&);
static InspectorInstrumentationCookie willReceiveResourceResponse(Frame*, unsigned long identifier, const ResourceResponse&);
- static void didReceiveResourceResponse(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&);
+ 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&);
@@ -351,7 +351,7 @@
static InspectorInstrumentationCookie willReceiveResourceDataImpl(InstrumentingAgents*, unsigned long identifier, Frame*, int length);
static void didReceiveResourceDataImpl(const InspectorInstrumentationCookie&);
static InspectorInstrumentationCookie willReceiveResourceResponseImpl(InstrumentingAgents*, unsigned long identifier, const ResourceResponse&, Frame*);
- static void didReceiveResourceResponseImpl(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&);
+ 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&);
@@ -1082,11 +1082,11 @@
return InspectorInstrumentationCookie();
}
-inline void InspectorInstrumentation::didReceiveResourceResponse(const InspectorInstrumentationCookie& cookie, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response)
+inline void InspectorInstrumentation::didReceiveResourceResponse(const InspectorInstrumentationCookie& cookie, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
{
#if ENABLE(INSPECTOR)
// Call this unconditionally so that we're able to log to console with no front-end attached.
- didReceiveResourceResponseImpl(cookie, identifier, loader, response);
+ didReceiveResourceResponseImpl(cookie, identifier, loader, response, resourceLoader);
#endif
}
Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp (125680 => 125681)
--- trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp 2012-08-15 16:50:13 UTC (rev 125681)
@@ -54,11 +54,13 @@
#include "Page.h"
#include "ProgressTracker.h"
#include "ResourceError.h"
+#include "ResourceLoader.h"
#include "ResourceRequest.h"
#include "ResourceResponse.h"
#include "ScriptCallStack.h"
#include "ScriptCallStackFactory.h"
#include "ScriptableDocumentParser.h"
+#include "SubresourceLoader.h"
#include "WebSocketFrame.h"
#include "WebSocketHandshakeRequest.h"
#include "WebSocketHandshakeResponse.h"
@@ -221,8 +223,8 @@
request.setReportRawHeaders(true);
if (m_state->getBoolean(ResourceAgentState::cacheDisabled)) {
+ request.setHTTPHeaderField("Pragma", "no-cache");
request.setCachePolicy(ReloadIgnoringCacheData);
- request.setHTTPHeaderField("Pragma", "no-cache");
request.setHTTPHeaderField("Cache-Control", "no-cache");
}
@@ -235,15 +237,20 @@
m_frontend->requestServedFromCache(IdentifiersFactory::requestId(identifier));
}
-void InspectorResourceAgent::didReceiveResponse(unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response)
+void InspectorResourceAgent::didReceiveResponse(unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
{
String requestId = IdentifiersFactory::requestId(identifier);
RefPtr<TypeBuilder::Network::Response> resourceResponse = buildObjectForResourceResponse(response, loader);
InspectorPageAgent::ResourceType type = InspectorPageAgent::OtherResource;
long cachedResourceSize = 0;
+ bool isNotModified = response.httpStatusCode() == 304;
if (loader) {
- CachedResource* cachedResource = InspectorPageAgent::cachedResource(loader->frame(), response.url());
+ CachedResource* cachedResource = 0;
+ if (resourceLoader && resourceLoader->isSubresourceLoader() && !isNotModified)
+ cachedResource = static_cast<SubresourceLoader*>(resourceLoader)->cachedResource();
+ if (!cachedResource)
+ cachedResource = InspectorPageAgent::cachedResource(loader->frame(), response.url());
if (cachedResource) {
type = InspectorPageAgent::cachedResourceType(*cachedResource);
cachedResourceSize = cachedResource->encodedSize();
@@ -268,7 +275,7 @@
m_frontend->responseReceived(requestId, m_pageAgent->frameId(loader->frame()), m_pageAgent->loaderId(loader), currentTime(), InspectorPageAgent::resourceTypeJson(type), resourceResponse);
// If we revalidated the resource and got Not modified, send content length following didReceiveResponse
// as there will be no calls to didReceiveData from the network stack.
- if (cachedResourceSize && response.httpStatusCode() == 304)
+ if (cachedResourceSize && isNotModified)
didReceiveData(identifier, 0, cachedResourceSize, 0);
}
Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.h (125680 => 125681)
--- trunk/Source/WebCore/inspector/InspectorResourceAgent.h 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.h 2012-08-15 16:50:13 UTC (rev 125681)
@@ -62,6 +62,7 @@
class NetworkResourcesData;
class Page;
class ResourceError;
+class ResourceLoader;
class ResourceRequest;
class ResourceResponse;
class SharedBuffer;
@@ -91,7 +92,7 @@
void willSendRequest(unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
void markResourceAsCached(unsigned long identifier);
- void didReceiveResponse(unsigned long identifier, DocumentLoader* laoder, const ResourceResponse&);
+ void didReceiveResponse(unsigned long identifier, DocumentLoader* laoder, const ResourceResponse&, ResourceLoader*);
void didReceiveData(unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
void didFinishLoading(unsigned long identifier, DocumentLoader*, double finishTime);
void didFailLoading(unsigned long identifier, DocumentLoader*, const ResourceError&);
Modified: trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp (125680 => 125681)
--- trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp 2012-08-15 16:50:13 UTC (rev 125681)
@@ -249,7 +249,7 @@
if (m_preflightRequestIdentifier) {
DocumentLoader* loader = m_document->frame()->loader()->documentLoader();
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(m_document->frame(), m_preflightRequestIdentifier, response);
- InspectorInstrumentation::didReceiveResourceResponse(cookie, m_preflightRequestIdentifier, loader, response);
+ InspectorInstrumentation::didReceiveResourceResponse(cookie, m_preflightRequestIdentifier, loader, response, 0);
}
#endif
Modified: trunk/Source/WebCore/loader/ResourceLoadNotifier.cpp (125680 => 125681)
--- trunk/Source/WebCore/loader/ResourceLoadNotifier.cpp 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/Source/WebCore/loader/ResourceLoadNotifier.cpp 2012-08-15 16:50:13 UTC (rev 125681)
@@ -71,7 +71,7 @@
if (Page* page = m_frame->page())
page->progress()->incrementProgress(loader->identifier(), r);
- dispatchDidReceiveResponse(loader->documentLoader(), loader->identifier(), r);
+ dispatchDidReceiveResponse(loader->documentLoader(), loader->identifier(), r, loader);
}
void ResourceLoadNotifier::didReceiveData(ResourceLoader* loader, const char* data, int dataLength, int encodedDataLength)
@@ -123,11 +123,11 @@
request.setReportLoadTiming(true);
}
-void ResourceLoadNotifier::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
+void ResourceLoadNotifier::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r, ResourceLoader* resourceLoader)
{
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(m_frame, identifier, r);
m_frame->loader()->client()->dispatchDidReceiveResponse(loader, identifier, r);
- InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, loader, r);
+ InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, loader, r, resourceLoader);
}
void ResourceLoadNotifier::dispatchDidReceiveData(DocumentLoader* loader, unsigned long identifier, const char* data, int dataLength, int encodedDataLength)
Modified: trunk/Source/WebCore/loader/ResourceLoadNotifier.h (125680 => 125681)
--- trunk/Source/WebCore/loader/ResourceLoadNotifier.h 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/Source/WebCore/loader/ResourceLoadNotifier.h 2012-08-15 16:50:13 UTC (rev 125681)
@@ -59,7 +59,7 @@
void assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&);
void dispatchWillSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse);
- void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&);
+ void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&, ResourceLoader* = 0);
void dispatchDidReceiveData(DocumentLoader*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier, double finishTime);
Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (125680 => 125681)
--- trunk/Source/WebCore/loader/ResourceLoader.cpp 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp 2012-08-15 16:50:13 UTC (rev 125681)
@@ -214,6 +214,11 @@
m_resourceData->clear();
}
+bool ResourceLoader::isSubresourceLoader()
+{
+ return false;
+}
+
void ResourceLoader::willSendRequest(ResourceRequest& request, const ResourceResponse& redirectResponse)
{
// Protect this in this delegate method since the additional processing can do
Modified: trunk/Source/WebCore/loader/ResourceLoader.h (125680 => 125681)
--- trunk/Source/WebCore/loader/ResourceLoader.h 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/Source/WebCore/loader/ResourceLoader.h 2012-08-15 16:50:13 UTC (rev 125681)
@@ -75,6 +75,7 @@
virtual void addData(const char*, int, bool allAtOnce);
virtual PassRefPtr<SharedBuffer> resourceData();
void clearResourceData();
+ virtual bool isSubresourceLoader();
virtual void willSendRequest(ResourceRequest&, const ResourceResponse& redirectResponse);
virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent);
Modified: trunk/Source/WebCore/loader/SubresourceLoader.cpp (125680 => 125681)
--- trunk/Source/WebCore/loader/SubresourceLoader.cpp 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp 2012-08-15 16:50:13 UTC (rev 125681)
@@ -122,6 +122,11 @@
return subloader.release();
}
+CachedResource* SubresourceLoader::cachedResource()
+{
+ return m_resource;
+}
+
void SubresourceLoader::cancelIfNotFinishing()
{
if (m_state != Initialized)
@@ -150,6 +155,11 @@
return true;
}
+bool SubresourceLoader::isSubresourceLoader()
+{
+ return true;
+}
+
void SubresourceLoader::willSendRequest(ResourceRequest& newRequest, const ResourceResponse& redirectResponse)
{
// Store the previous URL because the call to ResourceLoader::willSendRequest will modify it.
Modified: trunk/Source/WebCore/loader/SubresourceLoader.h (125680 => 125681)
--- trunk/Source/WebCore/loader/SubresourceLoader.h 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/Source/WebCore/loader/SubresourceLoader.h 2012-08-15 16:50:13 UTC (rev 125681)
@@ -46,6 +46,8 @@
static PassRefPtr<SubresourceLoader> create(Frame*, CachedResource*, const ResourceRequest&, const ResourceLoaderOptions&);
void cancelIfNotFinishing();
+ virtual bool isSubresourceLoader();
+ CachedResource* cachedResource();
virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
Modified: trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp (125680 => 125681)
--- trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp 2012-08-15 16:20:39 UTC (rev 125680)
+++ trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp 2012-08-15 16:50:13 UTC (rev 125681)
@@ -524,7 +524,7 @@
#if ENABLE(INSPECTOR)
DocumentLoader* loader = (handle == m_manifestHandle) ? 0 : m_frame->loader()->documentLoader();
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(m_frame, m_currentResourceIdentifier, response);
- InspectorInstrumentation::didReceiveResourceResponse(cookie, m_currentResourceIdentifier, loader, response);
+ InspectorInstrumentation::didReceiveResourceResponse(cookie, m_currentResourceIdentifier, loader, response, 0);
#endif
if (handle == m_manifestHandle) {