| 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..f91807ed230e21a4e46fd0ffa8c231cc2524234a 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,11 @@ public:
|
|
|
| // Stop further worker tasks to run after this point.
|
| m_workerThread->prepareForShutdownOnWorkerThread();
|
| + } else if (scriptController && scriptController->isExecutionTerminating()) {
|
| + // 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();
|
| }
|
| }
|
| }
|
|
|