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

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

Issue 2058133002: Fix DevTools support of worklets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fallback to toDOMWindow(calling) if callingWorkletScope->frame() is null Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c5231f3773fa64d14dffbbc95a5f4dbf01dd43f0..05d803851d1c021b6fd28ca0fdf396bc3dbd61a7 100644
--- a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
+++ b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
@@ -193,8 +193,15 @@ bool MainThreadDebugger::callingContextCanAccessContext(v8::Local<v8::Context> c
ASSERT(executionContext);
if (executionContext->isMainThreadWorkletGlobalScope()) {
dgozman 2016/06/27 23:12:33 I think this code is too complicated now, and shou
Yuki 2016/06/28 04:38:53 Yes, please move this code into BindingSecurity.
Gleb Lanbin 2016/06/28 17:58:33 Done.
+ ExecutionContext* callingExecutionContext = toExecutionContext(calling);
+ DCHECK(callingExecutionContext);
+ DOMWindow* callingDomWindow = toDOMWindow(calling);
+ if (callingExecutionContext->isMainThreadWorkletGlobalScope()) {
dgozman 2016/06/27 23:13:38 This looks pretty good. However, adding the revers
Gleb Lanbin 2016/06/28 17:58:33 Done.
+ Frame* callingFrame = toMainThreadWorkletGlobalScope(callingExecutionContext)->frame();
+ callingDomWindow = callingFrame ? callingFrame->domWindow() : nullptr;
+ }
MainThreadWorkletGlobalScope* globalScope = toMainThreadWorkletGlobalScope(executionContext);
- return globalScope && BindingSecurity::shouldAllowAccessTo(m_isolate, toLocalDOMWindow(toDOMWindow(calling)), globalScope, DoNotReportSecurityError);
+ return globalScope && callingDomWindow && BindingSecurity::shouldAllowAccessTo(m_isolate, toLocalDOMWindow(callingDomWindow), globalScope, DoNotReportSecurityError);
}
DOMWindow* window = toDOMWindow(target);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698