OLD | NEW |
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/v8-inspector-session-impl.h" | 5 #include "src/inspector/v8-inspector-session-impl.h" |
6 | 6 |
7 #include "src/inspector/injected-script.h" | 7 #include "src/inspector/injected-script.h" |
8 #include "src/inspector/inspected-context.h" | 8 #include "src/inspector/inspected-context.h" |
9 #include "src/inspector/protocol/Protocol.h" | 9 #include "src/inspector/protocol/Protocol.h" |
10 #include "src/inspector/remote-object-id.h" | 10 #include "src/inspector/remote-object-id.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 if (savedState.length()) { | 97 if (savedState.length()) { |
98 m_runtimeAgent->restore(); | 98 m_runtimeAgent->restore(); |
99 m_debuggerAgent->restore(); | 99 m_debuggerAgent->restore(); |
100 m_heapProfilerAgent->restore(); | 100 m_heapProfilerAgent->restore(); |
101 m_profilerAgent->restore(); | 101 m_profilerAgent->restore(); |
102 m_consoleAgent->restore(); | 102 m_consoleAgent->restore(); |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 V8InspectorSessionImpl::~V8InspectorSessionImpl() { | 106 V8InspectorSessionImpl::~V8InspectorSessionImpl() { |
107 protocol::ErrorString errorString; | |
108 m_consoleAgent->disable(); | 107 m_consoleAgent->disable(); |
109 m_profilerAgent->disable(); | 108 m_profilerAgent->disable(); |
110 m_heapProfilerAgent->disable(); | 109 m_heapProfilerAgent->disable(); |
111 m_debuggerAgent->disable(&errorString); | 110 m_debuggerAgent->disable(); |
112 m_runtimeAgent->disable(); | 111 m_runtimeAgent->disable(); |
113 | 112 |
114 discardInjectedScripts(); | 113 discardInjectedScripts(); |
115 m_inspector->disconnect(this); | 114 m_inspector->disconnect(this); |
116 } | 115 } |
117 | 116 |
118 protocol::DictionaryValue* V8InspectorSessionImpl::agentState( | 117 protocol::DictionaryValue* V8InspectorSessionImpl::agentState( |
119 const String16& name) { | 118 const String16& name) { |
120 protocol::DictionaryValue* state = m_state->getObject(name); | 119 protocol::DictionaryValue* state = m_state->getObject(name); |
121 if (!state) { | 120 if (!state) { |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 } | 374 } |
376 | 375 |
377 void V8InspectorSessionImpl::breakProgram(const StringView& breakReason, | 376 void V8InspectorSessionImpl::breakProgram(const StringView& breakReason, |
378 const StringView& breakDetails) { | 377 const StringView& breakDetails) { |
379 m_debuggerAgent->breakProgram( | 378 m_debuggerAgent->breakProgram( |
380 toString16(breakReason), | 379 toString16(breakReason), |
381 protocol::DictionaryValue::cast(protocol::parseJSON(breakDetails))); | 380 protocol::DictionaryValue::cast(protocol::parseJSON(breakDetails))); |
382 } | 381 } |
383 | 382 |
384 void V8InspectorSessionImpl::setSkipAllPauses(bool skip) { | 383 void V8InspectorSessionImpl::setSkipAllPauses(bool skip) { |
385 protocol::ErrorString errorString; | 384 m_debuggerAgent->setSkipAllPauses(skip); |
386 m_debuggerAgent->setSkipAllPauses(&errorString, skip); | |
387 } | 385 } |
388 | 386 |
389 void V8InspectorSessionImpl::resume() { | 387 void V8InspectorSessionImpl::resume() { m_debuggerAgent->resume(); } |
390 protocol::ErrorString errorString; | |
391 m_debuggerAgent->resume(&errorString); | |
392 } | |
393 | 388 |
394 void V8InspectorSessionImpl::stepOver() { | 389 void V8InspectorSessionImpl::stepOver() { m_debuggerAgent->stepOver(); } |
395 protocol::ErrorString errorString; | |
396 m_debuggerAgent->stepOver(&errorString); | |
397 } | |
398 | 390 |
399 std::vector<std::unique_ptr<protocol::Debugger::API::SearchMatch>> | 391 std::vector<std::unique_ptr<protocol::Debugger::API::SearchMatch>> |
400 V8InspectorSessionImpl::searchInTextByLines(const StringView& text, | 392 V8InspectorSessionImpl::searchInTextByLines(const StringView& text, |
401 const StringView& query, | 393 const StringView& query, |
402 bool caseSensitive, bool isRegex) { | 394 bool caseSensitive, bool isRegex) { |
403 // TODO(dgozman): search may operate on StringView and avoid copying |text|. | 395 // TODO(dgozman): search may operate on StringView and avoid copying |text|. |
404 std::vector<std::unique_ptr<protocol::Debugger::SearchMatch>> matches = | 396 std::vector<std::unique_ptr<protocol::Debugger::SearchMatch>> matches = |
405 searchInTextByLinesImpl(this, toString16(text), toString16(query), | 397 searchInTextByLinesImpl(this, toString16(text), toString16(query), |
406 caseSensitive, isRegex); | 398 caseSensitive, isRegex); |
407 std::vector<std::unique_ptr<protocol::Debugger::API::SearchMatch>> result; | 399 std::vector<std::unique_ptr<protocol::Debugger::API::SearchMatch>> result; |
408 for (size_t i = 0; i < matches.size(); ++i) | 400 for (size_t i = 0; i < matches.size(); ++i) |
409 result.push_back(std::move(matches[i])); | 401 result.push_back(std::move(matches[i])); |
410 return result; | 402 return result; |
411 } | 403 } |
412 | 404 |
413 } // namespace v8_inspector | 405 } // namespace v8_inspector |
OLD | NEW |