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

Unified Diff: src/inspector/inspected-context.cc

Issue 2785293002: [inspector] move console to builtins (Closed)
Patch Set: removed unused variable Created 3 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
« no previous file with comments | « src/debug/interface-types.h ('k') | src/inspector/v8-console.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/inspected-context.cc
diff --git a/src/inspector/inspected-context.cc b/src/inspector/inspected-context.cc
index 8a87a12ecf16c18de973efe5b0779cab0e8a2a6a..27766f200a5d21a3263f84b2dbc84206c774c4a7 100644
--- a/src/inspector/inspected-context.cc
+++ b/src/inspector/inspected-context.cc
@@ -25,19 +25,16 @@ InspectedContext::InspectedContext(V8InspectorImpl* inspector,
m_humanReadableName(toString16(info.humanReadableName)),
m_auxData(toString16(info.auxData)),
m_reported(false) {
- v8::Isolate* isolate = m_inspector->isolate();
v8::debug::SetContextId(info.context, contextId);
+ if (!info.hasMemoryOnConsole) return;
+ v8::Context::Scope contextScope(info.context);
v8::Local<v8::Object> global = info.context->Global();
- v8::Local<v8::Object> console =
- m_inspector->console()->createConsole(info.context);
- if (info.hasMemoryOnConsole) {
- m_inspector->console()->installMemoryGetter(info.context, console);
- }
- if (!global
- ->Set(info.context, toV8StringInternalized(isolate, "console"),
- console)
- .FromMaybe(false)) {
- return;
+ v8::Local<v8::Value> console;
+ if (global->Get(info.context, toV8String(m_inspector->isolate(), "console"))
+ .ToLocal(&console) &&
+ console->IsObject()) {
+ m_inspector->console()->installMemoryGetter(
+ info.context, v8::Local<v8::Object>::Cast(console));
}
}
« no previous file with comments | « src/debug/interface-types.h ('k') | src/inspector/v8-console.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698