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

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

Issue 1175263003: Revert of [DevTools] Show sync XHR info during request loading. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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') | no next file » | 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 bacb06c88a91c09f934052eba55cf9a235ec755d..ae3406715c7634a72deab6dd6b2a25a33fc62e59 100644
--- a/Source/core/inspector/InspectorResourceAgent.cpp
+++ b/Source/core/inspector/InspectorResourceAgent.cpp
@@ -369,8 +369,6 @@
TypeBuilder::Page::ResourceType::Enum resourceType = InspectorPageAgent::resourceTypeJson(type);
frontend()->requestWillBeSent(requestId, frameId, loaderId, urlWithoutFragment(loader->url()).string(), requestInfo.release(), monotonicallyIncreasingTime(), currentTime(), initiatorObject, buildObjectForResourceResponse(redirectResponse), &resourceType);
- if (m_pendingXHRReplayData && !m_pendingXHRReplayData->async())
- frontend()->flush();
}
void InspectorResourceAgent::markResourceAsCached(unsigned long identifier)
@@ -491,24 +489,25 @@
if (client == m_pendingEventSource) {
m_eventSourceRequestIdMap.set(client, identifier);
m_pendingEventSource = nullptr;
- }
-
- if (client == m_pendingXHR) {
- String requestId = IdentifiersFactory::requestId(identifier);
- m_resourcesData->setResourceType(requestId, InspectorPageAgent::XHRResource);
- m_resourcesData->setXHRReplayData(requestId, m_pendingXHRReplayData.get());
- m_pendingXHR = nullptr;
- m_pendingXHRReplayData.clear();
- }
+ return;
+ }
+
+ PendingXHRReplayDataMap::iterator it = m_pendingXHRReplayData.find(client);
+ if (it == m_pendingXHRReplayData.end())
+ return;
+
+ String requestId = IdentifiersFactory::requestId(identifier);
+ m_resourcesData->setResourceType(requestId, InspectorPageAgent::XHRResource);
+ m_resourcesData->setXHRReplayData(requestId, it->value.get());
}
void InspectorResourceAgent::willLoadXHR(XMLHttpRequest* xhr, ThreadableLoaderClient* client, const AtomicString& method, const KURL& url, bool async, PassRefPtr<FormData> formData, const HTTPHeaderMap& headers, bool includeCredentials)
{
ASSERT(xhr);
- m_pendingXHR = client;
- m_pendingXHRReplayData = XHRReplayData::create(xhr->executionContext(), method, urlWithoutFragment(url), async, formData.get(), includeCredentials);
+ RefPtrWillBeRawPtr<XHRReplayData> xhrReplayData = XHRReplayData::create(xhr->executionContext(), method, urlWithoutFragment(url), async, formData.get(), includeCredentials);
for (const auto& header : headers)
- m_pendingXHRReplayData->addHeader(header.key, header.value);
+ xhrReplayData->addHeader(header.key, header.value);
+ m_pendingXHRReplayData.set(client, xhrReplayData);
}
void InspectorResourceAgent::delayedRemoveReplayXHR(XMLHttpRequest* xhr)
@@ -523,8 +522,7 @@
void InspectorResourceAgent::didFailXHRLoading(XMLHttpRequest* xhr, ThreadableLoaderClient* client)
{
- m_pendingXHR = nullptr;
- m_pendingXHRReplayData.clear();
+ m_pendingXHRReplayData.remove(client);
// This method will be called from the XHR.
// We delay deleting the replay XHR, as deleting here may delete the caller.
@@ -533,8 +531,7 @@
void InspectorResourceAgent::didFinishXHRLoading(ExecutionContext* context, XMLHttpRequest* xhr, ThreadableLoaderClient* client, unsigned long identifier, ScriptString sourceString, const AtomicString& method, const String& url)
{
- m_pendingXHR = nullptr;
- m_pendingXHRReplayData.clear();
+ m_pendingXHRReplayData.remove(client);
// See comments on |didFailXHRLoading| for why we are delaying delete.
delayedRemoveReplayXHR(xhr);
« no previous file with comments | « Source/core/inspector/InspectorResourceAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698