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

Unified Diff: third_party/WebKit/Source/modules/worklet/Worklet.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/modules/worklet/Worklet.cpp
diff --git a/third_party/WebKit/Source/modules/worklet/Worklet.cpp b/third_party/WebKit/Source/modules/worklet/Worklet.cpp
index 59086a852730b1294f4e00059dfbfe90df280341..11dcc13d6bda70097574e22d4a56223310ce501f 100644
--- a/third_party/WebKit/Source/modules/worklet/Worklet.cpp
+++ b/third_party/WebKit/Source/modules/worklet/Worklet.cpp
@@ -10,6 +10,7 @@
#include "bindings/core/v8/WorkerOrWorkletScriptController.h"
#include "core/dom/DOMException.h"
#include "core/dom/ExceptionCode.h"
+#include "core/inspector/InspectorInstrumentation.h"
#include "modules/worklet/WorkletGlobalScope.h"
namespace blink {
@@ -26,6 +27,7 @@ Worklet::Worklet(LocalFrame* frame, ExecutionContext* executionContext)
: ActiveDOMObject(executionContext)
, m_workletGlobalScope(WorkletGlobalScope::create(frame, executionContext->url(), executionContext->userAgent(), executionContext->securityOrigin(), toIsolate(executionContext)))
{
+ InspectorInstrumentation::didCreateScriptContext(frame, m_workletGlobalScope->scriptController()->scriptState(), m_workletGlobalScope->securityOrigin(), WorkerWorldId);
}
ScriptPromise Worklet::import(ScriptState* scriptState, const String& url)
@@ -72,6 +74,7 @@ void Worklet::onFinished(WorkerScriptLoader* scriptLoader, ScriptPromiseResolver
// as workers, etc. For a SyntaxError we should reject, however if
// the script throws a normal error, resolve. For now just resolve.
m_workletGlobalScope->scriptController()->evaluate(ScriptSourceCode(scriptLoader->script(), scriptLoader->url()));
+ InspectorInstrumentation::scriptImported(m_workletGlobalScope, scriptLoader->identifier(), scriptLoader->script());
resolver->resolve();
}

Powered by Google App Engine
This is Rietveld 408576698