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

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

Issue 1617393002: [DevTools] Not use with statement for evaluated console command (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
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 0105ff9fbe188e1bcd527955c719b5d5c0758cac..93b32331d31d83abad3eaca073098ab35ca4fede 100644
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp
@@ -56,6 +56,7 @@
#include "core/html/HTMLCollection.h"
#include "core/html/HTMLDocument.h"
#include "core/inspector/ScriptCallStack.h"
+#include "core/inspector/v8/V8InjectedScriptHost.h"
#include "core/loader/FrameLoadRequest.h"
#include "core/loader/FrameLoader.h"
#include "core/loader/FrameLoaderClient.h"
@@ -63,6 +64,7 @@
#include "wtf/Assertions.h"
#include "wtf/OwnPtr.h"
+
pfeldman 2016/01/22 18:26:30 revert
kozy 2016/01/22 19:48:22 Done.
namespace blink {
void V8Window::eventAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& info)
@@ -325,6 +327,23 @@ void V8Window::namedPropertyGetterCustom(v8::Local<v8::Name> name, const v8::Pro
if (installTestInterfaceIfNeeded(toLocalFrame(*frame), nameString, info))
return;
+ v8::Isolate* isolate = info.GetIsolate();
pfeldman 2016/01/22 18:26:30 This code is hot, you should make sure you only en
kozy 2016/01/22 19:48:22 Done.
+ v8::Local<v8::Context> context = isolate->GetCurrentContext();
+
+ v8::Local<v8::Symbol> commandLineAPISymbol = v8::Symbol::ForApi(isolate, v8AtomicString(isolate, "commandLineAPISymbol"));
+ v8::Local<v8::Object> global = context->Global();
+ v8::Local<v8::Value> commandLineAPI;
+
+ if (v8Call(global->Get(context, commandLineAPISymbol), commandLineAPI)) {
+ v8::Local<v8::Value> value;
+ if (commandLineAPI->IsObject() && v8Call(commandLineAPI->ToObject(isolate)->Get(context, name), value)) {
+ if (!value->IsUndefined()) {
+ v8SetReturnValue(info, value);
+ return;
+ }
+ }
+ }
+
// Search named items in the document.
Document* doc = toLocalFrame(frame)->document();
if (!doc || !doc->isHTMLDocument())

Powered by Google App Engine
This is Rietveld 408576698