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

Side by Side Diff: src/inspector/inspected-context.cc

Issue 2906153002: [inspector] Support multiple sessions per context group (Closed)
Patch Set: setSkipAllPauses test Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/inspector/inspected-context.h" 5 #include "src/inspector/inspected-context.h"
6 6
7 #include "src/debug/debug-interface.h" 7 #include "src/debug/debug-interface.h"
8 #include "src/inspector/injected-script.h" 8 #include "src/inspector/injected-script.h"
9 #include "src/inspector/string-util.h" 9 #include "src/inspector/string-util.h"
10 #include "src/inspector/v8-console.h" 10 #include "src/inspector/v8-console.h"
11 #include "src/inspector/v8-inspector-impl.h" 11 #include "src/inspector/v8-inspector-impl.h"
12 #include "src/inspector/v8-value-copier.h" 12 #include "src/inspector/v8-value-copier.h"
13 13
14 #include "include/v8-inspector.h" 14 #include "include/v8-inspector.h"
15 15
16 namespace v8_inspector { 16 namespace v8_inspector {
17 17
18 InspectedContext::InspectedContext(V8InspectorImpl* inspector, 18 InspectedContext::InspectedContext(V8InspectorImpl* inspector,
19 const V8ContextInfo& info, int contextId) 19 const V8ContextInfo& info, int contextId)
20 : m_inspector(inspector), 20 : m_inspector(inspector),
21 m_context(info.context->GetIsolate(), info.context), 21 m_context(info.context->GetIsolate(), info.context),
22 m_contextId(contextId), 22 m_contextId(contextId),
23 m_contextGroupId(info.contextGroupId), 23 m_contextGroupId(info.contextGroupId),
24 m_origin(toString16(info.origin)), 24 m_origin(toString16(info.origin)),
25 m_humanReadableName(toString16(info.humanReadableName)), 25 m_humanReadableName(toString16(info.humanReadableName)),
26 m_auxData(toString16(info.auxData)), 26 m_auxData(toString16(info.auxData)) {
27 m_reported(false) {
28 v8::debug::SetContextId(info.context, contextId); 27 v8::debug::SetContextId(info.context, contextId);
29 if (!info.hasMemoryOnConsole) return; 28 if (!info.hasMemoryOnConsole) return;
30 v8::Context::Scope contextScope(info.context); 29 v8::Context::Scope contextScope(info.context);
31 v8::Local<v8::Object> global = info.context->Global(); 30 v8::Local<v8::Object> global = info.context->Global();
32 v8::Local<v8::Value> console; 31 v8::Local<v8::Value> console;
33 if (global->Get(info.context, toV8String(m_inspector->isolate(), "console")) 32 if (global->Get(info.context, toV8String(m_inspector->isolate(), "console"))
34 .ToLocal(&console) && 33 .ToLocal(&console) &&
35 console->IsObject()) { 34 console->IsObject()) {
36 m_inspector->console()->installMemoryGetter( 35 m_inspector->console()->installMemoryGetter(
37 info.context, v8::Local<v8::Object>::Cast(console)); 36 info.context, v8::Local<v8::Object>::Cast(console));
(...skipping 21 matching lines...) Expand all
59 std::unique_ptr<InjectedScript> injectedScript = InjectedScript::create(this); 58 std::unique_ptr<InjectedScript> injectedScript = InjectedScript::create(this);
60 // InjectedScript::create can destroy |this|. 59 // InjectedScript::create can destroy |this|.
61 if (!injectedScript) return false; 60 if (!injectedScript) return false;
62 m_injectedScript = std::move(injectedScript); 61 m_injectedScript = std::move(injectedScript);
63 return true; 62 return true;
64 } 63 }
65 64
66 void InspectedContext::discardInjectedScript() { m_injectedScript.reset(); } 65 void InspectedContext::discardInjectedScript() { m_injectedScript.reset(); }
67 66
68 } // namespace v8_inspector 67 } // namespace v8_inspector
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698