Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(933)

Unified Diff: Source/core/inspector/InspectorResourceAgent.cpp

Issue 23702040: Send synchronous loads through the cache. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorResourceAgent.h ('k') | Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorResourceAgent.cpp
diff --git a/Source/core/inspector/InspectorResourceAgent.cpp b/Source/core/inspector/InspectorResourceAgent.cpp
index fad8d679ef7917c242a1f7e2e8dd53a9cfe4a852..beee25804599e8c5589a01dc945953dc81dac782 100644
--- a/Source/core/inspector/InspectorResourceAgent.cpp
+++ b/Source/core/inspector/InspectorResourceAgent.cpp
@@ -350,7 +350,7 @@ void InspectorResourceAgent::didReceiveResourceResponse(unsigned long identifier
}
InspectorPageAgent::ResourceType type = cachedResource ? InspectorPageAgent::cachedResourceType(*cachedResource) : InspectorPageAgent::OtherResource;
- if (m_loadingXHRSynchronously || m_resourcesData->resourceType(requestId) == InspectorPageAgent::XHRResource)
+ if (m_resourcesData->resourceType(requestId) == InspectorPageAgent::XHRResource)
type = InspectorPageAgent::XHRResource;
else if (m_resourcesData->resourceType(requestId) == InspectorPageAgent::ScriptResource)
type = InspectorPageAgent::ScriptResource;
@@ -377,7 +377,7 @@ void InspectorResourceAgent::didReceiveData(unsigned long identifier, const char
if (data) {
NetworkResourcesData::ResourceData const* resourceData = m_resourcesData->data(requestId);
- if (resourceData && !m_loadingXHRSynchronously && (!resourceData->cachedResource() || resourceData->cachedResource()->dataBufferingPolicy() == DoNotBufferData || isErrorStatusCode(resourceData->httpStatusCode())))
+ if (resourceData && (!resourceData->cachedResource() || resourceData->cachedResource()->dataBufferingPolicy() == DoNotBufferData || isErrorStatusCode(resourceData->httpStatusCode())))
m_resourcesData->maybeAddResourceData(requestId, data, dataLength);
}
@@ -452,10 +452,6 @@ void InspectorResourceAgent::didFailXHRLoading(ThreadableLoaderClient* client)
void InspectorResourceAgent::didFinishXHRLoading(ThreadableLoaderClient* client, unsigned long identifier, ScriptString sourceString, const String&, const String&, unsigned)
{
- // For Asynchronous XHRs, the inspector can grab the data directly off of the Resource. For sync XHRs, we need to
- // provide the data here, since no Resource was involved.
- if (m_loadingXHRSynchronously)
- m_resourcesData->setResourceContent(IdentifiersFactory::requestId(identifier), sourceString.flattenToString());
m_pendingXHRReplayData.remove(client);
}
@@ -464,16 +460,6 @@ void InspectorResourceAgent::didReceiveXHRResponse(unsigned long identifier)
m_resourcesData->setResourceType(IdentifiersFactory::requestId(identifier), InspectorPageAgent::XHRResource);
}
-void InspectorResourceAgent::willLoadXHRSynchronously()
-{
- m_loadingXHRSynchronously = true;
-}
-
-void InspectorResourceAgent::didLoadXHRSynchronously()
-{
- m_loadingXHRSynchronously = false;
-}
-
void InspectorResourceAgent::willDestroyResource(Resource* cachedResource)
{
Vector<String> requestIds = m_resourcesData->removeResource(cachedResource);
@@ -783,7 +769,6 @@ InspectorResourceAgent::InspectorResourceAgent(InstrumentingAgents* instrumentin
, m_overlay(overlay)
, m_frontend(0)
, m_resourcesData(adoptPtr(new NetworkResourcesData()))
- , m_loadingXHRSynchronously(false)
, m_isRecalculatingStyle(false)
{
}
« no previous file with comments | « Source/core/inspector/InspectorResourceAgent.h ('k') | Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698