| 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 itStartRange, ranges.end(), | 451 itStartRange, ranges.end(), |
| 452 std::make_pair(end.GetLineNumber(), end.GetColumnNumber()), | 452 std::make_pair(end.GetLineNumber(), end.GetColumnNumber()), |
| 453 positionComparator); | 453 positionComparator); |
| 454 // Ranges array contains positions in script where blackbox state is changed. | 454 // Ranges array contains positions in script where blackbox state is changed. |
| 455 // [(0,0) ... ranges[0]) isn't blackboxed, [ranges[0] ... ranges[1]) is | 455 // [(0,0) ... ranges[0]) isn't blackboxed, [ranges[0] ... ranges[1]) is |
| 456 // blackboxed... | 456 // blackboxed... |
| 457 return itStartRange == itEndRange && | 457 return itStartRange == itEndRange && |
| 458 std::distance(ranges.begin(), itStartRange) % 2; | 458 std::distance(ranges.begin(), itStartRange) % 2; |
| 459 } | 459 } |
| 460 | 460 |
| 461 void V8DebuggerAgentImpl::asyncTaskCreated() { |
| 462 if (m_scheduledDebuggerStep == StepInto) { |
| 463 breakProgram(protocol::Debugger::Paused::ReasonEnum::CallbackScheduled, |
| 464 nullptr); |
| 465 } |
| 466 } |
| 467 |
| 468 Response V8DebuggerAgentImpl::stepIntoAsync() { |
| 469 return m_debugger->stepIntoAsync(); |
| 470 } |
| 471 |
| 472 void V8DebuggerAgentImpl::asyncTaskStarted() { |
| 473 schedulePauseOnNextStatement(protocol::Debugger::Paused::ReasonEnum::Other, |
| 474 nullptr); |
| 475 } |
| 476 |
| 477 void V8DebuggerAgentImpl::asyncTaskFinished() { cancelPauseOnNextStatement(); } |
| 478 |
| 461 std::unique_ptr<protocol::Debugger::Location> | 479 std::unique_ptr<protocol::Debugger::Location> |
| 462 V8DebuggerAgentImpl::resolveBreakpoint(const String16& breakpointId, | 480 V8DebuggerAgentImpl::resolveBreakpoint(const String16& breakpointId, |
| 463 const ScriptBreakpoint& breakpoint, | 481 const ScriptBreakpoint& breakpoint, |
| 464 BreakpointSource source) { | 482 BreakpointSource source) { |
| 465 v8::HandleScope handles(m_isolate); | 483 v8::HandleScope handles(m_isolate); |
| 466 DCHECK(enabled()); | 484 DCHECK(enabled()); |
| 467 // FIXME: remove these checks once crbug.com/520702 is resolved. | 485 // FIXME: remove these checks once crbug.com/520702 is resolved. |
| 468 CHECK(!breakpointId.isEmpty()); | 486 CHECK(!breakpointId.isEmpty()); |
| 469 CHECK(!breakpoint.script_id.isEmpty()); | 487 CHECK(!breakpoint.script_id.isEmpty()); |
| 470 ScriptsMap::iterator scriptIterator = m_scripts.find(breakpoint.script_id); | 488 ScriptsMap::iterator scriptIterator = m_scripts.find(breakpoint.script_id); |
| (...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 void V8DebuggerAgentImpl::reset() { | 1204 void V8DebuggerAgentImpl::reset() { |
| 1187 if (!enabled()) return; | 1205 if (!enabled()) return; |
| 1188 m_scheduledDebuggerStep = NoStep; | 1206 m_scheduledDebuggerStep = NoStep; |
| 1189 m_blackboxedPositions.clear(); | 1207 m_blackboxedPositions.clear(); |
| 1190 resetBlackboxedStateCache(); | 1208 resetBlackboxedStateCache(); |
| 1191 m_scripts.clear(); | 1209 m_scripts.clear(); |
| 1192 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1210 m_breakpointIdToDebuggerBreakpointIds.clear(); |
| 1193 } | 1211 } |
| 1194 | 1212 |
| 1195 } // namespace v8_inspector | 1213 } // namespace v8_inspector |
| OLD | NEW |