Chromium Code Reviews| Index: third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp |
| diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp |
| index aa8a964dcc230c17a0ab5f0621d06dfc0a2a1ef9..052d74c5b23415b0a3566acfaaca14d6d2156caa 100644 |
| --- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp |
| +++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp |
| @@ -115,16 +115,12 @@ WebEmbeddedWorkerImpl::~WebEmbeddedWorkerImpl() { |
| runningWorkerInstances().remove(this); |
| DCHECK(m_webView); |
| - // Detach the client before closing the view to avoid getting called back. |
| - m_mainFrame->setClient(0); |
|
dcheng
2016/10/17 22:33:29
This breaks the invariant. For now, I've added ear
|
| - |
| if (m_workerGlobalScopeProxy) { |
| m_workerGlobalScopeProxy->detach(); |
| m_workerGlobalScopeProxy.clear(); |
| } |
| m_webView->close(); |
| - m_mainFrame->close(); |
|
dcheng
2016/10/17 22:33:29
The default WebFrameClient implementation already
|
| if (m_loaderProxy) |
| m_loaderProxy->detachProvider(this); |
| } |
| @@ -326,17 +322,26 @@ void WebEmbeddedWorkerImpl::loadShadowPage() { |
| void WebEmbeddedWorkerImpl::willSendRequest(WebLocalFrame* frame, |
| WebURLRequest& request) { |
| + // TODO(dcheng): Investigate not plumbing through load notifications when a |
| + // frame is detached. |
| + if (m_askedToTerminate) |
| + return; |
| + |
| if (m_networkProvider) |
| m_networkProvider->willSendRequest(frame->dataSource(), request); |
| } |
| void WebEmbeddedWorkerImpl::didFinishDocumentLoad(WebLocalFrame* frame) { |
| + // TODO(dcheng): Investigate not plumbing through load notifications when a |
| + // frame is detached. |
| + if (m_askedToTerminate) |
| + return; |
| + |
| DCHECK(!m_mainScriptLoader); |
| DCHECK(!m_networkProvider); |
| DCHECK(m_mainFrame); |
| DCHECK(m_workerContextClient); |
| DCHECK(m_loadingShadowPage); |
| - DCHECK(!m_askedToTerminate); |
| m_loadingShadowPage = false; |
| m_networkProvider = |
| wrapUnique(m_workerContextClient->createServiceWorkerNetworkProvider( |