| OLD | NEW |
| 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/inspector_protocol/Parser.h" | 7 #include "platform/inspector_protocol/Parser.h" |
| 8 #include "platform/v8_inspector/InjectedScript.h" | 8 #include "platform/v8_inspector/InjectedScript.h" |
| 9 #include "platform/v8_inspector/InspectedContext.h" | 9 #include "platform/v8_inspector/InspectedContext.h" |
| 10 #include "platform/v8_inspector/RemoteObjectId.h" | 10 #include "platform/v8_inspector/RemoteObjectId.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 std::unique_ptr<V8InspectorSessionImpl> V8InspectorSessionImpl::create(V8Debugge
rImpl* debugger, int contextGroupId, protocol::FrontendChannel* channel, V8Inspe
ctorSessionClient* client, const String16* state) | 30 std::unique_ptr<V8InspectorSessionImpl> V8InspectorSessionImpl::create(V8Debugge
rImpl* debugger, int contextGroupId, protocol::FrontendChannel* channel, V8Inspe
ctorSessionClient* client, const String16* state) |
| 31 { | 31 { |
| 32 return wrapUnique(new V8InspectorSessionImpl(debugger, contextGroupId, chann
el, client, state)); | 32 return wrapUnique(new V8InspectorSessionImpl(debugger, contextGroupId, chann
el, client, state)); |
| 33 } | 33 } |
| 34 | 34 |
| 35 V8InspectorSessionImpl::V8InspectorSessionImpl(V8DebuggerImpl* debugger, int con
textGroupId, protocol::FrontendChannel* channel, V8InspectorSessionClient* clien
t, const String16* savedState) | 35 V8InspectorSessionImpl::V8InspectorSessionImpl(V8DebuggerImpl* debugger, int con
textGroupId, protocol::FrontendChannel* channel, V8InspectorSessionClient* clien
t, const String16* savedState) |
| 36 : m_contextGroupId(contextGroupId) | 36 : m_contextGroupId(contextGroupId) |
| 37 , m_debugger(debugger) | 37 , m_debugger(debugger) |
| 38 , m_client(client) | 38 , m_client(client) |
| 39 , m_customObjectFormatterEnabled(false) | 39 , m_customObjectFormatterEnabled(false) |
| 40 , m_instrumentationCounter(0) | |
| 41 , m_dispatcher(channel) | 40 , m_dispatcher(channel) |
| 42 , m_state(nullptr) | 41 , m_state(nullptr) |
| 43 , m_runtimeAgent(nullptr) | 42 , m_runtimeAgent(nullptr) |
| 44 , m_debuggerAgent(nullptr) | 43 , m_debuggerAgent(nullptr) |
| 45 , m_heapProfilerAgent(nullptr) | 44 , m_heapProfilerAgent(nullptr) |
| 46 , m_profilerAgent(nullptr) | 45 , m_profilerAgent(nullptr) |
| 47 , m_consoleAgent(nullptr) | 46 , m_consoleAgent(nullptr) |
| 48 { | 47 { |
| 49 if (savedState) { | 48 if (savedState) { |
| 50 std::unique_ptr<protocol::Value> state = protocol::parseJSON(*savedState
); | 49 std::unique_ptr<protocol::Value> state = protocol::parseJSON(*savedState
); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 238 |
| 240 void V8InspectorSessionImpl::reportAllContexts(V8RuntimeAgentImpl* agent) | 239 void V8InspectorSessionImpl::reportAllContexts(V8RuntimeAgentImpl* agent) |
| 241 { | 240 { |
| 242 const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->contextGroup(m_
contextGroupId); | 241 const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->contextGroup(m_
contextGroupId); |
| 243 if (!contexts) | 242 if (!contexts) |
| 244 return; | 243 return; |
| 245 for (auto& idContext : *contexts) | 244 for (auto& idContext : *contexts) |
| 246 agent->reportExecutionContextCreated(idContext.second.get()); | 245 agent->reportExecutionContextCreated(idContext.second.get()); |
| 247 } | 246 } |
| 248 | 247 |
| 249 void V8InspectorSessionImpl::changeInstrumentationCounter(int delta) | |
| 250 { | |
| 251 DCHECK_GE(m_instrumentationCounter + delta, 0); | |
| 252 if (!m_instrumentationCounter) | |
| 253 m_client->startInstrumenting(); | |
| 254 m_instrumentationCounter += delta; | |
| 255 if (!m_instrumentationCounter) | |
| 256 m_client->stopInstrumenting(); | |
| 257 } | |
| 258 | |
| 259 void V8InspectorSessionImpl::dispatchProtocolMessage(const String16& message) | 248 void V8InspectorSessionImpl::dispatchProtocolMessage(const String16& message) |
| 260 { | 249 { |
| 261 m_dispatcher.dispatch(message); | 250 m_dispatcher.dispatch(message); |
| 262 } | 251 } |
| 263 | 252 |
| 264 String16 V8InspectorSessionImpl::stateJSON() | 253 String16 V8InspectorSessionImpl::stateJSON() |
| 265 { | 254 { |
| 266 return m_state->toJSONString(); | 255 return m_state->toJSONString(); |
| 267 } | 256 } |
| 268 | 257 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 m_debuggerAgent->resume(&errorString); | 301 m_debuggerAgent->resume(&errorString); |
| 313 } | 302 } |
| 314 | 303 |
| 315 void V8InspectorSessionImpl::stepOver() | 304 void V8InspectorSessionImpl::stepOver() |
| 316 { | 305 { |
| 317 ErrorString errorString; | 306 ErrorString errorString; |
| 318 m_debuggerAgent->stepOver(&errorString); | 307 m_debuggerAgent->stepOver(&errorString); |
| 319 } | 308 } |
| 320 | 309 |
| 321 } // namespace blink | 310 } // namespace blink |
| OLD | NEW |