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

Unified Diff: Source/web/WebEmbeddedWorkerImpl.cpp

Issue 337223004: terminatePaused (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebEmbeddedWorkerImpl.cpp
diff --git a/Source/web/WebEmbeddedWorkerImpl.cpp b/Source/web/WebEmbeddedWorkerImpl.cpp
index 7eade2dad473ab66e35e327cf85dfc9674d0da9b..fcc434f528e36cdfc2be30396bb001aa05781963 100644
--- a/Source/web/WebEmbeddedWorkerImpl.cpp
+++ b/Source/web/WebEmbeddedWorkerImpl.cpp
@@ -187,6 +187,11 @@ void WebEmbeddedWorkerImpl::terminateWorkerContext()
m_askedToTerminate = true;
if (m_mainScriptLoader)
m_mainScriptLoader->cancel();
+ if (m_pauseAfterDownloadState == IsPausedAfterDownload) {
+ // This may delete 'this'.
+ m_workerContextClient->workerContextFailedToStart();
+ return;
+ }
if (m_workerThread)
m_workerThread->stop();
}
@@ -224,6 +229,7 @@ void dispatchOnInspectorBackendTask(ExecutionContext* context, const String& mes
void WebEmbeddedWorkerImpl::resumeAfterDownload()
{
+ ASSERT(!m_askedToTerminate);
bool wasPaused = (m_pauseAfterDownloadState == IsPausedAfterDownload);
m_pauseAfterDownloadState = DontPauseAfterDownload;
if (wasPaused)
@@ -328,8 +334,7 @@ void WebEmbeddedWorkerImpl::onScriptLoaderFinished()
void WebEmbeddedWorkerImpl::startWorkerThread()
{
ASSERT(m_pauseAfterDownloadState == DontPauseAfterDownload);
- if (m_askedToTerminate)
- return;
+ ASSERT(!m_askedToTerminate);
WorkerThreadStartMode startMode =
(m_workerStartData.waitForDebuggerMode == WebEmbeddedWorkerStartData::WaitForDebugger)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698