Chromium Code Reviews| 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..a4523bb99f1757491f846b32b1471afe5b3ff7fb 100644 |
| --- a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp |
| +++ b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp |
| @@ -189,13 +189,17 @@ void MainThreadDebugger::unmuteConsole() |
| bool MainThreadDebugger::callingContextCanAccessContext(v8::Local<v8::Context> calling, v8::Local<v8::Context> target) |
| { |
| - ExecutionContext* executionContext = toExecutionContext(target); |
| - ASSERT(executionContext); |
| + ExecutionContext* targetExecutionContext = toExecutionContext(target); |
| + DCHECK(targetExecutionContext); |
| - if (executionContext->isMainThreadWorkletGlobalScope()) { |
| - MainThreadWorkletGlobalScope* globalScope = toMainThreadWorkletGlobalScope(executionContext); |
| - return globalScope && BindingSecurity::shouldAllowAccessTo(m_isolate, toLocalDOMWindow(toDOMWindow(calling)), globalScope, DoNotReportSecurityError); |
| - } |
| + ExecutionContext* callingExecutionContext = toExecutionContext(calling); |
| + DCHECK(callingExecutionContext); |
| + |
| + if (targetExecutionContext->isMainThreadWorkletGlobalScope()) |
|
dgozman
2016/06/28 19:21:00
I'd even let BindingSecurity do these if checks fo
Gleb Lanbin
2016/06/28 19:51:37
discussed offline. moved the entire logic to Bindi
|
| + return BindingSecurity::shouldAllowAccessTo(m_isolate, calling, callingExecutionContext, toMainThreadWorkletGlobalScope(targetExecutionContext), DoNotReportSecurityError); |
| + |
| + if (callingExecutionContext->isMainThreadWorkletGlobalScope()) |
| + return BindingSecurity::shouldAllowAccessTo(m_isolate, target, targetExecutionContext, toMainThreadWorkletGlobalScope(callingExecutionContext), DoNotReportSecurityError); |
| DOMWindow* window = toDOMWindow(target); |
| return window && BindingSecurity::shouldAllowAccessTo(m_isolate, toLocalDOMWindow(toDOMWindow(calling)), window, DoNotReportSecurityError); |