Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp

Issue 1798143002: [DevTools] Removed __defineGetter__ from InjectedScriptSource.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b3ba78a7fde9ac2762753c036f8fd74e9bbf4c82..14eb01f1df82fa92bcc89339c471284f80b51fe8 100644
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp
@@ -288,7 +288,9 @@ static bool installCommandLineAPIIfNeeded(v8::Local<v8::Name> name, const Atomic
if (!InspectorInstrumentation::hasFrontends())
return false;
- if (!V8Debugger::isCommandLineAPIMethod(nameString))
+ bool isGetter = V8Debugger::isCommandLineAPIGetter(nameString);
+ bool isMethod = !isGetter && V8Debugger::isCommandLineAPIMethod(nameString);
+ if (!isGetter && !isMethod)
return false;
v8::Isolate* isolate = info.GetIsolate();
@@ -300,8 +302,17 @@ static bool installCommandLineAPIIfNeeded(v8::Local<v8::Name> name, const Atomic
if (v8Call(global->Get(context, V8Debugger::commandLineAPISymbol(isolate)), commandLineAPI)) {
v8::Local<v8::Value> value;
if (commandLineAPI->IsObject() && v8Call(commandLineAPI->ToObject(isolate)->Get(context, name), value)) {
- v8SetReturnValue(info, value);
- return true;
+ if (isMethod) {
+ v8SetReturnValue(info, value);
+ return true;
+ }
+ if (isGetter && value->IsFunction()) {
+ v8::Local<v8::Function> getterFunction = v8::Local<v8::Function>::Cast(value);
+ if (getterFunction->Call(context, commandLineAPI, 0, nullptr).ToLocal(&value)) {
+ v8SetReturnValue(info, value);
+ return true;
+ }
+ }
}
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/v8_inspector/InjectedScriptSource.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698