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

Unified Diff: third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp

Issue 1745253002: [Worklets] Add basic debugging to main thread worklets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix non-oilpan build. 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/core/inspector/MainThreadDebugger.cpp
diff --git a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
index db443dfc97c8cf70dcfc41d039fcc9204ede2d09..f447cd15038dcb905fc8d7e67a16b35ca9623923 100644
--- a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
+++ b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
@@ -34,6 +34,7 @@
#include "bindings/core/v8/DOMWrapperWorld.h"
#include "bindings/core/v8/ScriptController.h"
#include "bindings/core/v8/V8Window.h"
+#include "core/dom/ExecutionContext.h"
#include "core/frame/FrameConsole.h"
#include "core/frame/LocalDOMWindow.h"
#include "core/frame/LocalFrame.h"
@@ -41,6 +42,7 @@
#include "core/inspector/IdentifiersFactory.h"
#include "core/inspector/InspectedFrames.h"
#include "core/inspector/InspectorTaskRunner.h"
+#include "core/workers/MainThreadWorkletGlobalScope.h"
#include "platform/UserGestureIndicator.h"
#include "platform/v8_inspector/public/V8Debugger.h"
#include "wtf/OwnPtr.h"
@@ -158,6 +160,14 @@ void MainThreadDebugger::unmuteWarningsAndDeprecations()
bool MainThreadDebugger::callingContextCanAccessContext(v8::Local<v8::Context> calling, v8::Local<v8::Context> target)
{
+ ExecutionContext* executionContext = toExecutionContext(target);
+ ASSERT(executionContext);
+
+ if (executionContext->isWorkletGlobalScope()) {
+ MainThreadWorkletGlobalScope* globalScope = toMainThreadWorkletGlobalScope(executionContext);
+ return globalScope && BindingSecurity::shouldAllowAccessTo(m_isolate, toLocalDOMWindow(toDOMWindow(calling)), globalScope, DoNotReportSecurityError);
+ }
+
DOMWindow* window = toDOMWindow(target);
return window && BindingSecurity::shouldAllowAccessTo(m_isolate, toLocalDOMWindow(toDOMWindow(calling)), window, DoNotReportSecurityError);
}

Powered by Google App Engine
This is Rietveld 408576698