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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp

Issue 1995423002: [DevTools] Set vanilla object as console prototype (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/platform/v8_inspector/V8Console.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp
index 3e0db33d1b335fbccba86665e5bdd0ac83533a6a..d4631c0ecc6b373e1b8e0d1f185a778312a3b615 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp
@@ -624,6 +624,8 @@ void V8Console::inspectedObject(const v8::FunctionCallbackInfo<v8::Value>& info,
}
}
+static void suppressBoolUnused(bool) {}
+
v8::Local<v8::Object> V8Console::createConsole(InspectedContext* inspectedContext, bool hasMemoryAttribute)
{
v8::Local<v8::Context> context = inspectedContext->context();
@@ -656,6 +658,8 @@ v8::Local<v8::Object> V8Console::createConsole(InspectedContext* inspectedContex
createBoundFunctionProperty(context, console, "timeEnd", V8Console::timeEndCallback);
createBoundFunctionProperty(context, console, "timeStamp", V8Console::timeStampCallback);
+ suppressBoolUnused(console->SetPrototype(context, v8::Object::New(isolate)).FromMaybe(false));
dgozman 2016/05/20 18:26:36 Use DCHECK.
kozy 2016/05/20 18:32:52 Done.
+
if (hasMemoryAttribute)
console->SetAccessorProperty(toV8StringInternalized(isolate, "memory"), v8::Function::New(isolate, V8Console::memoryGetterCallback, console), v8::Function::New(isolate, V8Console::memorySetterCallback), static_cast<v8::PropertyAttribute>(v8::None), v8::DEFAULT);

Powered by Google App Engine
This is Rietveld 408576698