Chromium Code Reviews| 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(); |
| + } |
| } |
| } |
| } |