| Index: third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
|
| index 360d1da5090e695397c4d666de4281b14684a70a..8d5e856037c0700411d6491a2ad4283947464ed3 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
|
| @@ -45,6 +45,7 @@
|
| #include "core/inspector/WorkerThreadDebugger.h"
|
| #include "core/workers/WorkerGlobalScope.h"
|
| #include "core/workers/WorkerOrWorkletGlobalScope.h"
|
| +#include "core/workers/WorkerThread.h"
|
| #include "platform/heap/ThreadState.h"
|
| #include "public/platform/Platform.h"
|
| #include <memory>
|
| @@ -126,12 +127,12 @@ void WorkerOrWorkletScriptController::disposeContextIfNeeded() {
|
| if (!isContextInitialized())
|
| return;
|
|
|
| - if (m_globalScope->isWorkerGlobalScope()) {
|
| + if (m_globalScope->isWorkerGlobalScope() ||
|
| + m_globalScope->isThreadedWorkletGlobalScope()) {
|
| + ScriptState::Scope scope(m_scriptState.get());
|
| WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(m_isolate);
|
| - if (debugger) {
|
| - ScriptState::Scope scope(m_scriptState.get());
|
| - debugger->contextWillBeDestroyed(m_scriptState->context());
|
| - }
|
| + debugger->contextWillBeDestroyed(m_globalScope->thread(),
|
| + m_scriptState->context());
|
| }
|
| m_scriptState->disposePerContextData();
|
| }
|
| @@ -184,8 +185,7 @@ bool WorkerOrWorkletScriptController::initializeContextIfNeeded() {
|
| if (m_globalScope->isWorkerGlobalScope() ||
|
| m_globalScope->isThreadedWorkletGlobalScope()) {
|
| WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(m_isolate);
|
| - if (debugger)
|
| - debugger->contextCreated(context);
|
| + debugger->contextCreated(m_globalScope->thread(), context);
|
| }
|
|
|
| // The global proxy object. Note this is not the global object.
|
|
|