| Index: third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp b/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp
|
| index 8d4873af01c1476e750837de65dcbba650261e6a..8ee129cd7e31aa27563b95104831d6f99d2731e2 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp
|
| @@ -131,13 +131,21 @@ bool BindingSecurity::shouldAllowAccessTo(v8::Isolate* isolate, const LocalDOMWi
|
| return canAccessFrame(isolate, accessingWindow, frame->securityContext()->getSecurityOrigin(), frame->domWindow(), reportingOption);
|
| }
|
|
|
| -bool BindingSecurity::shouldAllowAccessTo(v8::Isolate* isolate, const LocalDOMWindow* accessingWindow, const MainThreadWorkletGlobalScope* target, SecurityReportingOption reportingOption)
|
| +bool BindingSecurity::shouldAllowAccessTo(v8::Isolate* isolate, const v8::Local<v8::Context>& context, const ExecutionContext* executionContext, const MainThreadWorkletGlobalScope* workletGlobalScope, SecurityReportingOption reportingOption)
|
| {
|
| - ASSERT(target);
|
| - const Frame* frame = target->frame();
|
| - if (!frame || !frame->securityContext())
|
| + DCHECK(executionContext);
|
| + DOMWindow* domWindow = toDOMWindow(context);
|
| + if (executionContext->isMainThreadWorkletGlobalScope()) {
|
| + Frame* callingFrame = toMainThreadWorkletGlobalScope(executionContext)->frame();
|
| + domWindow = callingFrame ? callingFrame->domWindow() : nullptr;
|
| + }
|
| +
|
| + DCHECK(workletGlobalScope);
|
| + const Frame* workletGlobalScopeFrame = workletGlobalScope->frame();
|
| + if (!workletGlobalScopeFrame || !workletGlobalScopeFrame->securityContext())
|
| return false;
|
| - return canAccessFrame(isolate, accessingWindow, frame->securityContext()->getSecurityOrigin(), frame->domWindow(), reportingOption);
|
| +
|
| + return domWindow && canAccessFrame(isolate, toLocalDOMWindow(domWindow), workletGlobalScopeFrame->securityContext()->getSecurityOrigin(), workletGlobalScopeFrame->domWindow(), reportingOption);
|
| }
|
|
|
| bool BindingSecurity::shouldAllowAccessTo(v8::Isolate* isolate, const LocalDOMWindow* accessingWindow, const Node* target, ExceptionState& exceptionState)
|
|
|