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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerThread.cpp

Issue 2299883006: [Worker] Call prepareForShutdown ASAP when terminated forcibly (Closed)
Patch Set: fix tests Created 4 years, 3 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/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 545efcef7cff5891a8665a58356f24684504ed8b..d410e639808fe574c0db23b9c620501d859f9549 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -128,7 +128,8 @@ public:
{
Microtask::performCheckpoint(m_workerThread->isolate());
if (WorkerOrWorkletGlobalScope* global = m_workerThread->globalScope()) {
- if (WorkerOrWorkletScriptController* scriptController = global->scriptController())
+ WorkerOrWorkletScriptController* scriptController = global->scriptController();
+ if (scriptController)
scriptController->getRejectedPromises()->processQueue();
if (global->isClosing()) {
// |m_workerThread| will eventually be requested to terminate.
@@ -136,6 +137,13 @@ public:
// Stop further worker tasks to run after this point.
m_workerThread->prepareForShutdownOnWorkerThread();
+ } else {
+ if (scriptController && scriptController->isExecutionTerminating()) {
nhiroki 2016/09/05 03:26:45 else if?
yhirano 2016/09/06 04:29:51 Done.
+ // The script has been terminated forcibly, which means
+ // we need to ask objects in the thread to stop working as
+ // soon as possible.
+ m_workerThread->prepareForShutdownOnWorkerThread();
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698