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 c827274aa5466b977dc6fbccc7f2db867dcec95d..ecee378a78e5284baaa37d804017b43c243c9d8d 100644 |
--- a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp |
+++ b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp |
@@ -33,11 +33,13 @@ |
#include "bindings/core/v8/BindingSecurity.h" |
#include "bindings/core/v8/DOMWrapperWorld.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" |
#include "core/frame/UseCounter.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" |
@@ -143,6 +145,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); |
} |