Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp |
| index 8f3bc8dc3e11ec0cf31ed93ee8525700cef3602e..e45375fa6532fda8f61a07b4b46f0ac45d395a4d 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp |
| @@ -283,7 +283,7 @@ static bool installTestInterfaceIfNeeded(LocalFrame& frame, v8::Local<v8::String |
| return false; |
| } |
| -static bool installCommandLineAPIIfNeeded(v8::Local<v8::Name> name, const AtomicString& nameString, const v8::PropertyCallbackInfo<v8::Value>& info) |
| +static bool installScopeExtensionIfNeeded(Frame* frame, v8::Local<v8::Name> name, const AtomicString& nameString, const v8::PropertyCallbackInfo<v8::Value>& info) |
|
dgozman
2016/03/17 19:16:11
namedPropertyFromDebuggerScopeExtension
dgozman
2016/03/17 19:16:11
Remove frame.
kozy
2016/03/17 20:48:55
Done.
kozy
2016/03/17 20:48:55
Done.
|
| { |
| if (!InspectorInstrumentation::hasFrontends()) |
| return false; |
| @@ -294,14 +294,16 @@ static bool installCommandLineAPIIfNeeded(v8::Local<v8::Name> name, const Atomic |
| return false; |
| v8::Isolate* isolate = info.GetIsolate(); |
| - v8::Local<v8::Context> context = isolate->GetCurrentContext(); |
| + v8::Local<v8::Context> context = toV8Context(frame, DOMWrapperWorld::current(isolate)); |
|
dgozman
2016/03/17 19:16:11
Revert.
kozy
2016/03/17 20:48:55
Done.
|
| + if (context.IsEmpty()) |
| + return false; |
| v8::Local<v8::Object> global = context->Global(); |
| - v8::Local<v8::Value> commandLineAPI; |
| + v8::Local<v8::Value> scopeExtensionValue; |
| - if (v8Call(global->Get(context, V8Debugger::commandLineAPISymbol(isolate)), commandLineAPI)) { |
| + if (v8Call(global->Get(context, V8Debugger::scopeExtensionSymbol(isolate)), scopeExtensionValue)) { |
| v8::Local<v8::Value> value; |
| - if (commandLineAPI->IsObject() && v8Call(commandLineAPI->ToObject(isolate)->Get(context, name), value)) { |
| + if (scopeExtensionValue->IsObject() && v8Call(scopeExtensionValue->ToObject(isolate)->Get(context, name), value)) { |
| if (isMethod) { |
| v8SetReturnValue(info, value); |
| return true; |
| @@ -309,14 +311,13 @@ static bool installCommandLineAPIIfNeeded(v8::Local<v8::Name> name, const Atomic |
| if (isGetter && value->IsFunction()) { |
| v8::Local<v8::Function> getterFunction = v8::Local<v8::Function>::Cast(value); |
| v8::MicrotasksScope microtasks(isolate, v8::MicrotasksScope::kDoNotRunMicrotasks); |
| - if (getterFunction->Call(context, commandLineAPI, 0, nullptr).ToLocal(&value)) { |
| + if (getterFunction->Call(context, scopeExtensionValue, 0, nullptr).ToLocal(&value)) { |
| v8SetReturnValue(info, value); |
| return true; |
| } |
| } |
| } |
| } |
| - |
| return false; |
| } |
| @@ -350,7 +351,7 @@ void V8Window::namedPropertyGetterCustom(v8::Local<v8::Name> name, const v8::Pro |
| if (installTestInterfaceIfNeeded(toLocalFrame(*frame), nameString, info)) |
| return; |
| - if (installCommandLineAPIIfNeeded(name, propName, info)) |
| + if (installScopeExtensionIfNeeded(frame, name, propName, info)) |
| return; |
| // Search named items in the document. |