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(); |
} |