| 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 9588cd07371729bf75118303720b776d55716a71..f9897d6fd64c0b86189f3ace65db4e990b7dcadd 100644
|
| --- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
|
| +++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
|
| @@ -102,7 +102,7 @@
|
| return;
|
| }
|
|
|
| - m_workerThread->isolate()->TerminateExecution();
|
| + m_workerThread->forciblyTerminateExecution();
|
| DCHECK_EQ(WorkerThread::ExitCode::NotTerminated, m_workerThread->m_exitCode);
|
| m_workerThread->m_exitCode = WorkerThread::ExitCode::AsyncForciblyTerminated;
|
| }
|
| @@ -382,7 +382,7 @@
|
| if (mode == TerminationMode::Forcible && m_exitCode == ExitCode::NotTerminated) {
|
| DCHECK(m_scheduledForceTerminationTask);
|
| m_scheduledForceTerminationTask.reset();
|
| - isolate()->TerminateExecution();
|
| + forciblyTerminateExecution();
|
| DCHECK_EQ(ExitCode::NotTerminated, m_exitCode);
|
| m_exitCode = ExitCode::SyncForciblyTerminated;
|
| }
|
| @@ -419,7 +419,7 @@
|
|
|
| if (shouldScheduleToTerminateExecution) {
|
| if (mode == TerminationMode::Forcible) {
|
| - isolate()->TerminateExecution();
|
| + forciblyTerminateExecution();
|
| DCHECK_EQ(ExitCode::NotTerminated, m_exitCode);
|
| m_exitCode = ExitCode::SyncForciblyTerminated;
|
| } else {
|
| @@ -441,6 +441,13 @@
|
| workerBackingThread().backingThread().postTask(BLINK_FROM_HERE, crossThreadBind(&WorkerThread::performShutdownOnWorkerThread, crossThreadUnretained(this)));
|
| }
|
|
|
| +void WorkerThread::forciblyTerminateExecution()
|
| +{
|
| + DCHECK(m_globalScope);
|
| + m_globalScope->scriptController()->willScheduleExecutionTermination();
|
| + isolate()->TerminateExecution();
|
| +}
|
| +
|
| bool WorkerThread::isInShutdown()
|
| {
|
| // Check if we've started termination or shutdown sequence. Avoid acquiring
|
|
|