| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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-debugger-agent-impl.h" | 5 #include "src/inspector/v8-debugger-agent-impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "src/debug/debug-interface.h" | 9 #include "src/debug/debug-interface.h" |
| 10 #include "src/inspector/injected-script.h" | 10 #include "src/inspector/injected-script.h" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 | 279 |
| 280 String16 blackboxPattern; | 280 String16 blackboxPattern; |
| 281 if (m_state->getString(DebuggerAgentState::blackboxPattern, | 281 if (m_state->getString(DebuggerAgentState::blackboxPattern, |
| 282 &blackboxPattern)) { | 282 &blackboxPattern)) { |
| 283 setBlackboxPattern(blackboxPattern); | 283 setBlackboxPattern(blackboxPattern); |
| 284 } | 284 } |
| 285 } | 285 } |
| 286 | 286 |
| 287 Response V8DebuggerAgentImpl::setBreakpointsActive(bool active) { | 287 Response V8DebuggerAgentImpl::setBreakpointsActive(bool active) { |
| 288 if (!enabled()) return Response::Error(kDebuggerNotEnabled); | 288 if (!enabled()) return Response::Error(kDebuggerNotEnabled); |
| 289 // TODO(dgozman): this state should be per-session, not global per debugger. |
| 289 m_debugger->setBreakpointsActivated(active); | 290 m_debugger->setBreakpointsActivated(active); |
| 290 if (!active && !m_breakReason.empty()) { | 291 if (!active && !m_breakReason.empty()) { |
| 291 clearBreakDetails(); | 292 clearBreakDetails(); |
| 292 m_debugger->setPauseOnNextStatement(false, m_session->contextGroupId()); | 293 m_debugger->setPauseOnNextStatement(false, m_session->contextGroupId()); |
| 293 } | 294 } |
| 294 return Response::OK(); | 295 return Response::OK(); |
| 295 } | 296 } |
| 296 | 297 |
| 297 Response V8DebuggerAgentImpl::setSkipAllPauses(bool skip) { | 298 Response V8DebuggerAgentImpl::setSkipAllPauses(bool skip) { |
| 298 m_state->setBoolean(DebuggerAgentState::skipAllPauses, skip); | 299 m_state->setBoolean(DebuggerAgentState::skipAllPauses, skip); |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1026 std::unique_ptr<protocol::Runtime::StackTrace> | 1027 std::unique_ptr<protocol::Runtime::StackTrace> |
| 1027 V8DebuggerAgentImpl::currentAsyncStackTrace() { | 1028 V8DebuggerAgentImpl::currentAsyncStackTrace() { |
| 1028 std::shared_ptr<AsyncStackTrace> asyncParent = | 1029 std::shared_ptr<AsyncStackTrace> asyncParent = |
| 1029 m_debugger->currentAsyncParent(); | 1030 m_debugger->currentAsyncParent(); |
| 1030 if (!asyncParent) return nullptr; | 1031 if (!asyncParent) return nullptr; |
| 1031 return asyncParent->buildInspectorObject( | 1032 return asyncParent->buildInspectorObject( |
| 1032 m_debugger->currentAsyncCreation().get(), | 1033 m_debugger->currentAsyncCreation().get(), |
| 1033 m_debugger->maxAsyncCallChainDepth() - 1); | 1034 m_debugger->maxAsyncCallChainDepth() - 1); |
| 1034 } | 1035 } |
| 1035 | 1036 |
| 1036 bool V8DebuggerAgentImpl::isPaused() const { return m_debugger->isPaused(); } | 1037 bool V8DebuggerAgentImpl::isPaused() const { |
| 1038 // TODO(dgozman): this check allows once context group to resume the other, |
| 1039 // since they share debugger. |
| 1040 return m_debugger->isPaused(); |
| 1041 } |
| 1037 | 1042 |
| 1038 void V8DebuggerAgentImpl::didParseSource( | 1043 void V8DebuggerAgentImpl::didParseSource( |
| 1039 std::unique_ptr<V8DebuggerScript> script, bool success) { | 1044 std::unique_ptr<V8DebuggerScript> script, bool success) { |
| 1040 v8::HandleScope handles(m_isolate); | 1045 v8::HandleScope handles(m_isolate); |
| 1041 String16 scriptSource = script->source(); | 1046 String16 scriptSource = script->source(); |
| 1042 if (!success) script->setSourceURL(findSourceURL(scriptSource, false)); | 1047 if (!success) script->setSourceURL(findSourceURL(scriptSource, false)); |
| 1043 if (!success) | 1048 if (!success) |
| 1044 script->setSourceMappingURL(findSourceMapURL(scriptSource, false)); | 1049 script->setSourceMappingURL(findSourceMapURL(scriptSource, false)); |
| 1045 | 1050 |
| 1046 int contextId = script->executionContextId(); | 1051 int contextId = script->executionContextId(); |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1278 | 1283 |
| 1279 void V8DebuggerAgentImpl::reset() { | 1284 void V8DebuggerAgentImpl::reset() { |
| 1280 if (!enabled()) return; | 1285 if (!enabled()) return; |
| 1281 m_blackboxedPositions.clear(); | 1286 m_blackboxedPositions.clear(); |
| 1282 resetBlackboxedStateCache(); | 1287 resetBlackboxedStateCache(); |
| 1283 m_scripts.clear(); | 1288 m_scripts.clear(); |
| 1284 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1289 m_breakpointIdToDebuggerBreakpointIds.clear(); |
| 1285 } | 1290 } |
| 1286 | 1291 |
| 1287 } // namespace v8_inspector | 1292 } // namespace v8_inspector |
| OLD | NEW |