Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp

Issue 2456733002: DevTools: Make WorkerThreadDebugger available for Worklets (Closed)
Patch Set: address review comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698