| 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 8d5e856037c0700411d6491a2ad4283947464ed3..360d1da5090e695397c4d666de4281b14684a70a 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
|
| @@ -45,7 +45,6 @@
|
| #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>
|
| @@ -127,12 +126,12 @@
|
| if (!isContextInitialized())
|
| return;
|
|
|
| - if (m_globalScope->isWorkerGlobalScope() ||
|
| - m_globalScope->isThreadedWorkletGlobalScope()) {
|
| - ScriptState::Scope scope(m_scriptState.get());
|
| + if (m_globalScope->isWorkerGlobalScope()) {
|
| WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(m_isolate);
|
| - debugger->contextWillBeDestroyed(m_globalScope->thread(),
|
| - m_scriptState->context());
|
| + if (debugger) {
|
| + ScriptState::Scope scope(m_scriptState.get());
|
| + debugger->contextWillBeDestroyed(m_scriptState->context());
|
| + }
|
| }
|
| m_scriptState->disposePerContextData();
|
| }
|
| @@ -185,7 +184,8 @@
|
| if (m_globalScope->isWorkerGlobalScope() ||
|
| m_globalScope->isThreadedWorkletGlobalScope()) {
|
| WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(m_isolate);
|
| - debugger->contextCreated(m_globalScope->thread(), context);
|
| + if (debugger)
|
| + debugger->contextCreated(context);
|
| }
|
|
|
| // The global proxy object. Note this is not the global object.
|
|
|