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..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); |