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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp

Issue 2650973006: Check |m_inspectedFrames| in InspectorNetworkAgent to avoid crashes. (Closed)
Patch Set: Created 3 years, 11 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 | « third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
index 2aab6c337a23b6a80b2a8073bb909f474969d67f..cb6d54fe2ef0545ad00eab3b846b1683fdd6a428 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
@@ -987,6 +987,10 @@ void InspectorNetworkAgent::didFinishXHRInternal(ExecutionContext* context,
void InspectorNetworkAgent::willStartFetch(ThreadableLoaderClient* client) {
DCHECK(!m_pendingRequest);
+ // The mechanism of documentThreadableLoaderStartedLoadingForClient() doesn't
+ // work when fetch() is called in the worker thread.
+ if (!m_inspectedFrames)
+ return;
m_pendingRequest = client;
m_pendingRequestType = InspectorPageAgent::FetchResource;
}
@@ -1016,6 +1020,10 @@ void InspectorNetworkAgent::didFinishFetch(ExecutionContext* context,
void InspectorNetworkAgent::willSendEventSourceRequest(
ThreadableLoaderClient* eventSource) {
DCHECK(!m_pendingRequest);
+ // The mechanism of documentThreadableLoaderStartedLoadingForClient() doesn't
+ // work when EventSource is used in the worker thread.
+ if (!m_inspectedFrames)
+ return;
m_pendingRequest = eventSource;
m_pendingRequestType = InspectorPageAgent::EventSourceResource;
}
@@ -1443,7 +1451,9 @@ Response InspectorNetworkAgent::setCacheDisabled(bool cacheDisabled) {
// We should extract network cache state into a global entity which can be
// queried from FrameLoader and other places.
m_state->setBoolean(NetworkAgentState::cacheDisabled, cacheDisabled);
- if (cacheDisabled)
+ // Check |m_inspectedFrames| because we can't touch memoryCache from the
+ // worker thread.
+ if (cacheDisabled && m_inspectedFrames)
memoryCache()->evictResources();
return Response::OK();
}
« no previous file with comments | « third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698