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

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

Issue 1745253002: [Worklets] Add basic debugging to main thread worklets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 months 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 fbdbb4dbbe68963974ee9ffd3128cf9cb8af8d41..5ff9473169a3c2df4872c72c6a69bfc97c040484 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
@@ -43,7 +43,9 @@
#include "bindings/core/v8/WrapperTypeInfo.h"
#include "core/events/ErrorEvent.h"
#include "core/frame/DOMTimer.h"
+#include "core/inspector/MainThreadDebugger.h"
#include "core/inspector/WorkerThreadDebugger.h"
+#include "core/workers/MainThreadWorkletGlobalScope.h"
#include "core/workers/WorkerObjectProxy.h"
#include "core/workers/WorkerOrWorkletGlobalScope.h"
#include "core/workers/WorkerThread.h"
@@ -149,7 +151,11 @@ bool WorkerOrWorkletScriptController::initializeContextIfNeeded()
ScriptState::Scope scope(m_scriptState.get());
// Name new context for debugging.
- WorkerThreadDebugger::setContextDebugData(context);
+ if (m_globalScope->isWorkletGlobalScope()) {
+ MainThreadDebugger::initializeContext(context, toMainThreadWorkletGlobalScope(m_globalScope)->frame(), WorkerWorldId);
+ } else {
+ WorkerThreadDebugger::setContextDebugData(context);
+ }
// Create a new JS object and use it as the prototype for the shadow global object.
const WrapperTypeInfo* wrapperTypeInfo = m_globalScope->scriptWrappable()->wrapperTypeInfo();

Powered by Google App Engine
This is Rietveld 408576698