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

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

Issue 2253643002: [DevTools] Copy objects from debugger context to inspected context properly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: copier Created 4 years, 4 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 b2e96b089f5f413b253a0ebd85db375d22dbbf43..73a90e225e11aeac62626e36a217ceaa5b2ecf51 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp
@@ -659,6 +659,8 @@ v8::Local<v8::Object> V8Console::createConsole(InspectedContext* inspectedContex
v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
v8::Local<v8::Object> console = v8::Object::New(isolate);
+ bool success = console->SetPrototype(context, v8::Object::New(isolate)).FromMaybe(false);
+ DCHECK(success);
createBoundFunctionProperty(context, console, "debug", V8Console::debugCallback);
createBoundFunctionProperty(context, console, "error", V8Console::errorCallback);
@@ -684,9 +686,6 @@ v8::Local<v8::Object> V8Console::createConsole(InspectedContext* inspectedContex
createBoundFunctionProperty(context, console, "timeEnd", V8Console::timeEndCallback);
createBoundFunctionProperty(context, console, "timeStamp", V8Console::timeStampCallback);
- bool success = console->SetPrototype(context, v8::Object::New(isolate)).FromMaybe(false);
- DCHECK(success);
-
if (hasMemoryAttribute)
console->SetAccessorProperty(toV8StringInternalized(isolate, "memory"), V8_FUNCTION_NEW_REMOVE_PROTOTYPE(context, V8Console::memoryGetterCallback, console, 0).ToLocalChecked(), V8_FUNCTION_NEW_REMOVE_PROTOTYPE(context, V8Console::memorySetterCallback, v8::Local<v8::Value>(), 0).ToLocalChecked(), static_cast<v8::PropertyAttribute>(v8::None), v8::DEFAULT);
@@ -707,6 +706,8 @@ v8::Local<v8::Object> V8Console::createCommandLineAPI(InspectedContext* inspecte
v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
v8::Local<v8::Object> commandLineAPI = v8::Object::New(isolate);
+ bool success = commandLineAPI->SetPrototype(context, v8::Null(isolate)).FromMaybe(false);
+ DCHECK(success);
createBoundFunctionProperty(context, commandLineAPI, "dir", V8Console::dirCallback, "function dir(value) { [Command Line API] }");
createBoundFunctionProperty(context, commandLineAPI, "dirxml", V8Console::dirxmlCallback, "function dirxml(value) { [Command Line API] }");
« no previous file with comments | « third_party/WebKit/Source/platform/blink_platform.gypi ('k') | third_party/WebKit/Source/platform/v8_inspector/V8Debugger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698