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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp

Issue 1924713002: [DevTools] Removed InjectedScriptHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-inspect-to-native
Patch Set: Created 4 years, 7 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 Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium 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 "platform/v8_inspector/V8InspectorSessionImpl.h" 5 #include "platform/v8_inspector/V8InspectorSessionImpl.h"
6 6
7 #include "platform/v8_inspector/InjectedScript.h" 7 #include "platform/v8_inspector/InjectedScript.h"
8 #include "platform/v8_inspector/InjectedScriptHost.h"
9 #include "platform/v8_inspector/InspectedContext.h" 8 #include "platform/v8_inspector/InspectedContext.h"
10 #include "platform/v8_inspector/RemoteObjectId.h" 9 #include "platform/v8_inspector/RemoteObjectId.h"
11 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" 10 #include "platform/v8_inspector/V8DebuggerAgentImpl.h"
12 #include "platform/v8_inspector/V8DebuggerImpl.h" 11 #include "platform/v8_inspector/V8DebuggerImpl.h"
13 #include "platform/v8_inspector/V8HeapProfilerAgentImpl.h" 12 #include "platform/v8_inspector/V8HeapProfilerAgentImpl.h"
14 #include "platform/v8_inspector/V8ProfilerAgentImpl.h" 13 #include "platform/v8_inspector/V8ProfilerAgentImpl.h"
15 #include "platform/v8_inspector/V8RuntimeAgentImpl.h" 14 #include "platform/v8_inspector/V8RuntimeAgentImpl.h"
16 #include "platform/v8_inspector/public/V8ContextInfo.h" 15 #include "platform/v8_inspector/public/V8ContextInfo.h"
17 #include "platform/v8_inspector/public/V8DebuggerClient.h" 16 #include "platform/v8_inspector/public/V8DebuggerClient.h"
18 17
19 namespace blink { 18 namespace blink {
20 19
21 PassOwnPtr<V8InspectorSessionImpl> V8InspectorSessionImpl::create(V8DebuggerImpl * debugger, int contextGroupId) 20 PassOwnPtr<V8InspectorSessionImpl> V8InspectorSessionImpl::create(V8DebuggerImpl * debugger, int contextGroupId)
22 { 21 {
23 return adoptPtr(new V8InspectorSessionImpl(debugger, contextGroupId)); 22 return adoptPtr(new V8InspectorSessionImpl(debugger, contextGroupId));
24 } 23 }
25 24
26 V8InspectorSessionImpl::V8InspectorSessionImpl(V8DebuggerImpl* debugger, int con textGroupId) 25 V8InspectorSessionImpl::V8InspectorSessionImpl(V8DebuggerImpl* debugger, int con textGroupId)
27 : m_contextGroupId(contextGroupId) 26 : m_contextGroupId(contextGroupId)
28 , m_debugger(debugger) 27 , m_debugger(debugger)
29 , m_client(nullptr) 28 , m_client(nullptr)
30 , m_injectedScriptHost(InjectedScriptHost::create(debugger))
31 , m_customObjectFormatterEnabled(false) 29 , m_customObjectFormatterEnabled(false)
32 , m_instrumentationCounter(0) 30 , m_instrumentationCounter(0)
33 , m_runtimeAgent(adoptPtr(new V8RuntimeAgentImpl(this))) 31 , m_runtimeAgent(adoptPtr(new V8RuntimeAgentImpl(this)))
34 , m_debuggerAgent(adoptPtr(new V8DebuggerAgentImpl(this))) 32 , m_debuggerAgent(adoptPtr(new V8DebuggerAgentImpl(this)))
35 , m_heapProfilerAgent(adoptPtr(new V8HeapProfilerAgentImpl(this))) 33 , m_heapProfilerAgent(adoptPtr(new V8HeapProfilerAgentImpl(this)))
36 , m_profilerAgent(adoptPtr(new V8ProfilerAgentImpl(this))) 34 , m_profilerAgent(adoptPtr(new V8ProfilerAgentImpl(this)))
37 { 35 {
38 } 36 }
39 37
40 V8InspectorSessionImpl::~V8InspectorSessionImpl() 38 V8InspectorSessionImpl::~V8InspectorSessionImpl()
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 98 }
101 99
102 const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->contextGroup(m_ contextGroupId); 100 const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->contextGroup(m_ contextGroupId);
103 if (!contexts || !contexts->contains(contextId)) { 101 if (!contexts || !contexts->contains(contextId)) {
104 *errorString = "Cannot find context with specified id"; 102 *errorString = "Cannot find context with specified id";
105 return nullptr; 103 return nullptr;
106 } 104 }
107 105
108 InspectedContext* context = contexts->get(contextId); 106 InspectedContext* context = contexts->get(contextId);
109 if (!context->getInjectedScript()) { 107 if (!context->getInjectedScript()) {
110 context->createInjectedScript(m_injectedScriptHost.get()); 108 context->createInjectedScript();
111 if (!context->getInjectedScript()) { 109 if (!context->getInjectedScript()) {
112 *errorString = "Cannot access specified execution context"; 110 *errorString = "Cannot access specified execution context";
113 return nullptr; 111 return nullptr;
114 } 112 }
115 if (m_customObjectFormatterEnabled) 113 if (m_customObjectFormatterEnabled)
116 context->getInjectedScript()->setCustomObjectFormatterEnabled(true); 114 context->getInjectedScript()->setCustomObjectFormatterEnabled(true);
117 } 115 }
118 return context->getInjectedScript(); 116 return context->getInjectedScript();
119 } 117 }
120 118
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 180 }
183 181
184 V8RuntimeAgent::Inspectable* V8InspectorSessionImpl::inspectedObject(unsigned nu m) 182 V8RuntimeAgent::Inspectable* V8InspectorSessionImpl::inspectedObject(unsigned nu m)
185 { 183 {
186 if (num >= m_inspectedObjects.size()) 184 if (num >= m_inspectedObjects.size())
187 return nullptr; 185 return nullptr;
188 return m_inspectedObjects[num].get(); 186 return m_inspectedObjects[num].get();
189 } 187 }
190 188
191 } // namespace blink 189 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698