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

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

Issue 1859293002: [DevTools] Move Console to v8_inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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/InspectedContext.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/InspectedContext.cpp b/third_party/WebKit/Source/platform/v8_inspector/InspectedContext.cpp
index fb9e4c5161c082a0427aaa6becc1c4f473b4fb6e..1403b06f9cbf247771a1607545da46e86b31a363 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/InspectedContext.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/InspectedContext.cpp
@@ -5,7 +5,9 @@
#include "platform/v8_inspector/InspectedContext.h"
#include "platform/v8_inspector/InjectedScript.h"
+#include "platform/v8_inspector/V8Console.h"
#include "platform/v8_inspector/V8DebuggerImpl.h"
+#include "platform/v8_inspector/V8StringUtil.h"
#include "platform/v8_inspector/public/V8ContextInfo.h"
#include "platform/v8_inspector/public/V8DebuggerClient.h"
@@ -28,6 +30,14 @@ InspectedContext::InspectedContext(V8DebuggerImpl* debugger, const V8ContextInfo
, m_reported(false)
{
m_context.SetWeak(this, &InspectedContext::weakCallback, v8::WeakCallbackType::kParameter);
+
+ v8::Isolate* isolate = m_debugger->isolate();
+ v8::Local<v8::Object> global = info.context->Global();
+ v8::Local<v8::Object> console;
+ if (!V8Console::create(info.context, this, info.hasMemoryOnConsole).ToLocal(&console))
+ return;
+ if (!global->Set(info.context, toV8StringInternalized(isolate, "console"), console).FromMaybe(false))
+ return;
}
InspectedContext::~InspectedContext()

Powered by Google App Engine
This is Rietveld 408576698