Commit 186666df authored by tasak@google.com's avatar tasak@google.com

Fix toV8 and ExceptionState with empty context.

BUG=369451

Review URL: https://codereview.chromium.org/303363002

git-svn-id: svn://svn.chromium.org/blink/trunk@175120 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent c6350664
......@@ -347,7 +347,7 @@ ScriptValue ScriptDebugServer::currentCallFramesInner(ScopeInfoDetails scopeDeta
return ScriptValue();
v8::Context::Scope contextScope(pausedContext);
return ScriptValue(ScriptState::from(pausedContext), toV8(currentCallFrame.release(), v8::Handle<v8::Object>(), pausedContext->GetIsolate()));
return ScriptValue(ScriptState::from(pausedContext), toV8(currentCallFrame.release(), pausedContext->Global(), pausedContext->GetIsolate()));
}
ScriptValue ScriptDebugServer::currentCallFrames()
......
......@@ -338,7 +338,7 @@ void V8WindowShell::updateDocumentProperty()
ScriptState::Scope scope(m_scriptState.get());
v8::Handle<v8::Context> context = m_scriptState->context();
v8::Handle<v8::Value> documentWrapper = toV8(m_frame->document(), v8::Handle<v8::Object>(), context->GetIsolate());
v8::Handle<v8::Value> documentWrapper = toV8(m_frame->document(), context->Global(), context->GetIsolate());
ASSERT(documentWrapper == m_document.newLocal(m_isolate) || m_document.isEmpty());
if (m_document.isEmpty())
updateDocumentWrapper(v8::Handle<v8::Object>::Cast(documentWrapper));
......
......@@ -79,10 +79,10 @@ ScriptValue InjectedScriptHost::nodeAsScriptValue(ScriptState* scriptState, Node
v8::Local<v8::Context> context = scriptState->context();
v8::Context::Scope contextScope(context);
ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeAsScriptValue", "InjectedScriptHost", v8::Handle<v8::Object>(), isolate);
ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeAsScriptValue", "InjectedScriptHost", context->Global(), isolate);
if (!BindingSecurity::shouldAllowAccessToNode(isolate, node, exceptionState))
return ScriptValue(scriptState, v8::Null(isolate));
return ScriptValue(scriptState, toV8(node, v8::Handle<v8::Object>(), isolate));
return ScriptValue(scriptState, toV8(node, context->Global(), isolate));
}
void V8InjectedScriptHost::inspectedObjectMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
......
......@@ -187,7 +187,7 @@ void V8Window::frameElementAttributeGetterCustom(const v8::PropertyCallbackInfo<
// The wrapper for an <iframe> should get its prototype from the context of the frame it's in, rather than its own frame.
// So, use its containing document as the creation context when wrapping.
v8::Handle<v8::Value> creationContext = toV8(&impl->frameElement()->document(), v8::Handle<v8::Object>(), info.GetIsolate());
v8::Handle<v8::Value> creationContext = toV8(&impl->frameElement()->document(), info.Holder(), info.GetIsolate());
RELEASE_ASSERT(!creationContext.IsEmpty());
v8::Handle<v8::Value> wrapper = toV8(impl->frameElement(), v8::Handle<v8::Object>::Cast(creationContext), info.GetIsolate());
v8SetReturnValue(info, wrapper);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment