Commit 6cbc8ae3 authored by kouhei@chromium.org's avatar kouhei@chromium.org

Revert of Fix SharedWorker leak when script load has failed....

Revert of Fix SharedWorker leak when script load has failed. (https://codereview.chromium.org/424653002/)

Reason for revert:
May cause crash

Original issue's description:
> Fix SharedWorker leak when script load has failed.
> 
> When SharedWorker script load has failed and the |WebSharedWorkerImpl|
> was explicit told to terminate, the |WebSharedWorkerImpl| instance
> was never deleted.
> 
> This CL fixes the issue by invoking "delete this" when a worker thread
> instance does not exist in |stopWorkerThread()|.
> 
> TEST=fast/workers/worker-crash-with-invalid-location.html doesn't leak when --enable-leak-detection
> BUG=364390
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=179011

TBR=falken@chromium.org,tkent@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=364390

Review URL: https://codereview.chromium.org/424923002

git-svn-id: svn://svn.chromium.org/blink/trunk@179088 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 36895185
...@@ -178,23 +178,12 @@ void WebSharedWorkerImpl::stopWorkerThread() ...@@ -178,23 +178,12 @@ void WebSharedWorkerImpl::stopWorkerThread()
if (m_askedToTerminate) if (m_askedToTerminate)
return; return;
m_askedToTerminate = true; m_askedToTerminate = true;
bool hasPendingActivity = false;
if (m_mainScriptLoader) { if (m_mainScriptLoader) {
m_mainScriptLoader->cancel(); m_mainScriptLoader->cancel();
m_mainScriptLoader.clear(); m_mainScriptLoader.clear();
hasPendingActivity = true;
} }
if (m_workerThread) { if (m_workerThread)
m_workerThread->stop(); m_workerThread->stop();
hasPendingActivity = true;
}
if (!hasPendingActivity) {
// If there are no active WorkerThread, |workerGlobalScopeClosed()|
// callback to delete this is never called, so we should clean up here.
delete this;
}
} }
void WebSharedWorkerImpl::initializeLoader(const WebURL& url) void WebSharedWorkerImpl::initializeLoader(const WebURL& url)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment