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

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

Issue 2784713002: [inspector] console get all information from inspector when needed (Closed)
Patch Set: fixed last test Created 3 years, 9 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/inspector/inspected-context.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 6d9f51ed3fd987bf1d94b585bf3faba54fbe4e5e..7f00721908b9b2b713cf818ac1b65dc9f9d68b40 100644
--- a/src/inspector/inspected-context.cc
+++ b/src/inspector/inspected-context.cc
@@ -14,23 +14,6 @@
namespace v8_inspector {
-namespace {
-
-void clearContext(const v8::WeakCallbackInfo<v8::Global<v8::Context>>& data) {
- // Inspected context is created in V8InspectorImpl::contextCreated method
- // and destroyed in V8InspectorImpl::contextDestroyed.
- // Both methods takes valid v8::Local<v8::Context> handle to the same context,
- // it means that context is created before InspectedContext constructor and is
- // always destroyed after InspectedContext destructor therefore this callback
- // should be never called.
- // It's possible only if inspector client doesn't call contextDestroyed which
- // is considered an error.
- CHECK(false);
- data.GetParameter()->Reset();
-}
-
-} // namespace
-
InspectedContext::InspectedContext(V8InspectorImpl* inspector,
const V8ContextInfo& info, int contextId)
: m_inspector(inspector),
@@ -44,27 +27,18 @@ InspectedContext::InspectedContext(V8InspectorImpl* inspector,
v8::Isolate* isolate = m_inspector->isolate();
info.context->SetEmbedderData(static_cast<int>(v8::Context::kDebugIdIndex),
v8::Int32::New(isolate, contextId));
- m_context.SetWeak(&m_context, &clearContext,
- v8::WeakCallbackType::kParameter);
-
v8::Local<v8::Object> global = info.context->Global();
v8::Local<v8::Object> console =
V8Console::createConsole(this, info.hasMemoryOnConsole);
if (!global
->Set(info.context, toV8StringInternalized(isolate, "console"),
console)
- .FromMaybe(false))
+ .FromMaybe(false)) {
return;
- m_console.Reset(isolate, console);
- m_console.SetWeak();
+ }
}
InspectedContext::~InspectedContext() {
- if (!m_console.IsEmpty()) {
- v8::HandleScope scope(isolate());
- V8Console::clearInspectedContextIfNeeded(context(),
- m_console.Get(isolate()));
- }
}
// static
« no previous file with comments | « src/inspector/inspected-context.h ('k') | src/inspector/v8-console.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698