Commit dcc56abd authored by vsevik@chromium.org's avatar vsevik@chromium.org

Source/WebCore: Web Inspector: Incorrect XHR responses when two async xhrs are sent synchronously

https://bugs.webkit.org/show_bug.cgi?id=91630

Patch by Pavel Chadnov <chadnov@google.com> on 2012-08-15
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):

LayoutTests: Web Inspector: Incorrect XHR responses when two async xhrs are sent synchronously
https://bugs.webkit.org/show_bug.cgi?id=91630

Patch by Pavel Chadnov <chadnov@google.com> on 2012-08-15
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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f813d03e
2012-08-15 Pavel Chadnov <chadnov@google.com>
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 <christophe.dumez@intel.com>
[WK2] Add support for Web Intents MessagePorts
......@@ -26,6 +26,11 @@ InspectorTest.resetInspectorResourcesData = function(callback)
};
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 @@ function doXHR(method, url, async, callback)
if (typeof(callback) === "function")
callback();
}
};
}
xhr.open(method, url, async);
xhr.send(null);
xhr.send(payload);
}
function resetInspectorResourcesData()
......
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
<html>
<head>
<script src="../inspector-test.js"></script>
<script src="../network-test.js"></script>
<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="https://bugs.webkit.org/show_bug.cgi?id=91630">Bug 91630</a>
</body>
</html>
<?php
echo file_get_contents('php://input');
?>
......@@ -3,6 +3,6 @@ CONSOLE MESSAGE: line 14: Done.
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
......@@ -11,17 +11,17 @@ CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/inspector/reso
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.
......
2012-08-15 Pavel Chadnov <chadnov@google.com>
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 <tzik@chromium.org>
Web Inspector: Use default parameter on reportResult in InspectorFileSystemAgent
......@@ -674,7 +674,7 @@ InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceResp
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 @@ void InspectorInstrumentation::didReceiveResourceResponseImpl(const InspectorIns
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::didReceiveResourceResponseImpl(const InspectorIns
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)
......
......@@ -172,7 +172,7 @@ public:
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 @@ private:
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 @@ inline InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResou
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
}
......
......@@ -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 @@ void InspectorResourceAgent::willSendRequest(unsigned long identifier, DocumentL
request.setReportRawHeaders(true);
if (m_state->getBoolean(ResourceAgentState::cacheDisabled)) {
request.setCachePolicy(ReloadIgnoringCacheData);
request.setHTTPHeaderField("Pragma", "no-cache");
request.setCachePolicy(ReloadIgnoringCacheData);
request.setHTTPHeaderField("Cache-Control", "no-cache");
}
......@@ -235,15 +237,20 @@ void InspectorResourceAgent::markResourceAsCached(unsigned long identifier)
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 @@ void InspectorResourceAgent::didReceiveResponse(unsigned long identifier, Docume
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);
}
......
......@@ -62,6 +62,7 @@ class KURL;
class NetworkResourcesData;
class Page;
class ResourceError;
class ResourceLoader;
class ResourceRequest;
class ResourceResponse;
class SharedBuffer;
......@@ -91,7 +92,7 @@ public:
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&);
......
......@@ -249,7 +249,7 @@ void DocumentThreadableLoader::didReceiveResponse(unsigned long identifier, cons
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
......
......@@ -71,7 +71,7 @@ void ResourceLoadNotifier::didReceiveResponse(ResourceLoader* loader, const Reso
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 @@ void ResourceLoadNotifier::dispatchWillSendRequest(DocumentLoader* loader, unsig
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)
......
......@@ -59,7 +59,7 @@ public:
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);
......
......@@ -214,6 +214,11 @@ void ResourceLoader::clearResourceData()
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
......
......@@ -75,6 +75,7 @@ namespace WebCore {
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);
......
......@@ -122,6 +122,11 @@ PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, CachedReso
return subloader.release();
}
CachedResource* SubresourceLoader::cachedResource()
{
return m_resource;
}
void SubresourceLoader::cancelIfNotFinishing()
{
if (m_state != Initialized)
......@@ -150,6 +155,11 @@ bool SubresourceLoader::init(const ResourceRequest& request)
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.
......
......@@ -46,6 +46,8 @@ public:
static PassRefPtr<SubresourceLoader> create(Frame*, CachedResource*, const ResourceRequest&, const ResourceLoaderOptions&);
void cancelIfNotFinishing();
virtual bool isSubresourceLoader();
CachedResource* cachedResource();
virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
......
......@@ -524,7 +524,7 @@ void ApplicationCacheGroup::didReceiveResponse(ResourceHandle* handle, const Res
#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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment