| Index: third_party/WebKit/Source/bindings/core/v8/V8ThrowException.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ThrowException.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ThrowException.cpp
|
| index ae242579ebaf5ce82f991d8f8db416488fb95710..56dbc54440ed9f835e8399cd6823a4100fad4406 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/V8ThrowException.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8ThrowException.cpp
|
| @@ -68,9 +68,12 @@ v8::Local<v8::Value> V8ThrowException::createDOMException(v8::Isolate* isolate,
|
| v8::Local<v8::Object> sanitizedCreationContext = creationContext;
|
|
|
| // FIXME: Is the current context always the right choice?
|
| - Frame* frame = toFrameIfNotDetached(creationContext->CreationContext());
|
| - if (!frame || !BindingSecurity::shouldAllowAccessToFrame(isolate, callingDOMWindow(isolate), frame, DoNotReportSecurityError))
|
| - sanitizedCreationContext = isolate->GetCurrentContext()->Global();
|
| + ScriptState* scriptState = ScriptState::from(creationContext->CreationContext());
|
| + Frame* frame = toFrameIfNotDetached(scriptState->context());
|
| + if (!frame || !BindingSecurity::shouldAllowAccessToFrame(isolate, callingDOMWindow(isolate), frame, DoNotReportSecurityError)) {
|
| + scriptState = ScriptState::current(isolate);
|
| + sanitizedCreationContext = scriptState->context()->Global();
|
| + }
|
|
|
| v8::TryCatch tryCatch;
|
|
|
| @@ -89,7 +92,7 @@ v8::Local<v8::Value> V8ThrowException::createDOMException(v8::Isolate* isolate,
|
| v8::Local<v8::Object> exceptionObject = exception.As<v8::Object>();
|
| v8::Maybe<bool> result = exceptionObject->SetAccessor(isolate->GetCurrentContext(), v8AtomicString(isolate, "stack"), domExceptionStackGetter, domExceptionStackSetter, v8::MaybeLocal<v8::Value>(error));
|
| ASSERT_UNUSED(result, result.FromJust());
|
| - V8HiddenValue::setHiddenValue(isolate, exceptionObject, V8HiddenValue::error(isolate), error);
|
| + V8HiddenValue::setHiddenValue(scriptState, exceptionObject, V8HiddenValue::error(isolate), error);
|
|
|
| return exception;
|
| }
|
|
|