Index: third_party/WebKit/Source/core/workers/WorkerThread.cpp |
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.cpp b/third_party/WebKit/Source/core/workers/WorkerThread.cpp |
index f78949695aba6d80d8f58a301e0a4bb9ed1779e9..07896af90af00783e7e8521ddab9811cb381677c 100644 |
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp |
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp |
@@ -487,9 +487,16 @@ void WorkerThread::initializeOnWorkerThread(std::unique_ptr<WorkerThreadStartupD |
} |
} |
- if (startMode == PauseWorkerGlobalScopeOnStart) |
+ if (startMode == PauseWorkerGlobalScopeOnStart) { |
startRunningDebuggerTasksOnPauseOnWorkerThread(); |
+ // WorkerThread may be ready to shut down at this point if termination |
+ // is requested while the debugger task is running. Shutdown sequence |
+ // will start soon. |
+ if (m_readyToShutdown) |
+ return; |
+ } |
+ |
if (m_workerGlobalScope->scriptController()->isContextInitialized()) { |
m_workerReportingProxy.didInitializeWorkerContext(); |
v8::HandleScope handleScope(isolate()); |