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

Unified Diff: third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp

Issue 2423213002: Remove a bunch of pointless null checks in FrameLoaderClientImpl.
Patch Set: Fix formatting. Created 4 years, 2 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
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(

Powered by Google App Engine
This is Rietveld 408576698