| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/inspector/V8DebuggerAgent.h" | 6 #include "core/inspector/V8DebuggerAgent.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptCallStackFactory.h" | 8 #include "bindings/core/v8/ScriptCallStackFactory.h" |
| 9 #include "bindings/core/v8/ScriptRegexp.h" | 9 #include "bindings/core/v8/ScriptRegexp.h" |
| 10 #include "bindings/core/v8/ScriptValue.h" | 10 #include "bindings/core/v8/ScriptValue.h" |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 if (!m_skippedStepFrameCount) | 528 if (!m_skippedStepFrameCount) |
| 529 m_recursionLevelForStepFrame = 1; | 529 m_recursionLevelForStepFrame = 1; |
| 530 | 530 |
| 531 ++m_skippedStepFrameCount; | 531 ++m_skippedStepFrameCount; |
| 532 return V8DebuggerListener::StepFrame; | 532 return V8DebuggerListener::StepFrame; |
| 533 } | 533 } |
| 534 | 534 |
| 535 PassRefPtr<TypeBuilder::Debugger::Location> V8DebuggerAgent::resolveBreakpoint(c
onst String& breakpointId, const String& scriptId, const ScriptBreakpoint& break
point, BreakpointSource source) | 535 PassRefPtr<TypeBuilder::Debugger::Location> V8DebuggerAgent::resolveBreakpoint(c
onst String& breakpointId, const String& scriptId, const ScriptBreakpoint& break
point, BreakpointSource source) |
| 536 { | 536 { |
| 537 ASSERT(enabled()); | 537 ASSERT(enabled()); |
| 538 if (breakpointId.isEmpty()) { | 538 // FIXME: remove these checks once crbug.com/520702 is resolved. |
| 539 ASSERT_NOT_REACHED(); | 539 RELEASE_ASSERT(!breakpointId.isEmpty()); |
| 540 return nullptr; | 540 RELEASE_ASSERT(!scriptId.isEmpty()); |
| 541 } | |
| 542 ScriptsMap::iterator scriptIterator = m_scripts.find(scriptId); | 541 ScriptsMap::iterator scriptIterator = m_scripts.find(scriptId); |
| 543 if (scriptIterator == m_scripts.end()) | 542 if (scriptIterator == m_scripts.end()) |
| 544 return nullptr; | 543 return nullptr; |
| 545 Script& script = scriptIterator->value; | 544 Script& script = scriptIterator->value; |
| 546 if (breakpoint.lineNumber < script.startLine() || script.endLine() < breakpo
int.lineNumber) | 545 if (breakpoint.lineNumber < script.startLine() || script.endLine() < breakpo
int.lineNumber) |
| 547 return nullptr; | 546 return nullptr; |
| 548 | 547 |
| 549 int actualLineNumber; | 548 int actualLineNumber; |
| 550 int actualColumnNumber; | 549 int actualColumnNumber; |
| 551 String debuggerBreakpointId = debugger().setBreakpoint(scriptId, breakpoint,
&actualLineNumber, &actualColumnNumber, false); | 550 String debuggerBreakpointId = debugger().setBreakpoint(scriptId, breakpoint,
&actualLineNumber, &actualColumnNumber, false); |
| 552 if (debuggerBreakpointId.isEmpty()) | 551 if (debuggerBreakpointId.isEmpty()) |
| 553 return nullptr; | 552 return nullptr; |
| 554 | 553 |
| 555 m_serverBreakpoints.set(debuggerBreakpointId, std::make_pair(breakpointId, s
ource)); | 554 m_serverBreakpoints.set(debuggerBreakpointId, std::make_pair(breakpointId, s
ource)); |
| 556 | 555 |
| 556 RELEASE_ASSERT(!breakpointId.isEmpty()); |
| 557 BreakpointIdToDebuggerBreakpointIdsMap::iterator debuggerBreakpointIdsIterat
or = m_breakpointIdToDebuggerBreakpointIds.find(breakpointId); | 557 BreakpointIdToDebuggerBreakpointIdsMap::iterator debuggerBreakpointIdsIterat
or = m_breakpointIdToDebuggerBreakpointIds.find(breakpointId); |
| 558 if (debuggerBreakpointIdsIterator == m_breakpointIdToDebuggerBreakpointIds.e
nd()) | 558 if (debuggerBreakpointIdsIterator == m_breakpointIdToDebuggerBreakpointIds.e
nd()) |
| 559 m_breakpointIdToDebuggerBreakpointIds.set(breakpointId, Vector<String>()
).storedValue->value.append(debuggerBreakpointId); | 559 m_breakpointIdToDebuggerBreakpointIds.set(breakpointId, Vector<String>()
).storedValue->value.append(debuggerBreakpointId); |
| 560 else | 560 else |
| 561 debuggerBreakpointIdsIterator->value.append(debuggerBreakpointId); | 561 debuggerBreakpointIdsIterator->value.append(debuggerBreakpointId); |
| 562 | 562 |
| 563 RefPtr<TypeBuilder::Debugger::Location> location = TypeBuilder::Debugger::Lo
cation::create() | 563 RefPtr<TypeBuilder::Debugger::Location> location = TypeBuilder::Debugger::Lo
cation::create() |
| 564 .setScriptId(scriptId) | 564 .setScriptId(scriptId) |
| 565 .setLineNumber(actualLineNumber); | 565 .setLineNumber(actualLineNumber); |
| 566 location->setColumnNumber(actualColumnNumber); | 566 location->setColumnNumber(actualColumnNumber); |
| (...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1724 RefPtr<ExceptionDetails> exceptionDetails = ExceptionDetails::create().setTe
xt(toCoreStringWithUndefinedOrNullCheck(message->Get())); | 1724 RefPtr<ExceptionDetails> exceptionDetails = ExceptionDetails::create().setTe
xt(toCoreStringWithUndefinedOrNullCheck(message->Get())); |
| 1725 exceptionDetails->setLine(message->GetLineNumber()); | 1725 exceptionDetails->setLine(message->GetLineNumber()); |
| 1726 exceptionDetails->setColumn(message->GetStartColumn()); | 1726 exceptionDetails->setColumn(message->GetStartColumn()); |
| 1727 v8::Local<v8::StackTrace> messageStackTrace = message->GetStackTrace(); | 1727 v8::Local<v8::StackTrace> messageStackTrace = message->GetStackTrace(); |
| 1728 if (!messageStackTrace.IsEmpty() && messageStackTrace->GetFrameCount() > 0) | 1728 if (!messageStackTrace.IsEmpty() && messageStackTrace->GetFrameCount() > 0) |
| 1729 exceptionDetails->setStackTrace(createScriptCallStack(isolate, messageSt
ackTrace, messageStackTrace->GetFrameCount())->buildInspectorArray()); | 1729 exceptionDetails->setStackTrace(createScriptCallStack(isolate, messageSt
ackTrace, messageStackTrace->GetFrameCount())->buildInspectorArray()); |
| 1730 return exceptionDetails.release(); | 1730 return exceptionDetails.release(); |
| 1731 } | 1731 } |
| 1732 | 1732 |
| 1733 } // namespace blink | 1733 } // namespace blink |
| OLD | NEW |