| 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 "platform/v8_inspector/V8DebuggerAgentImpl.h" | 5 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" |
| 6 | 6 |
| 7 #include "platform/inspector_protocol/String16.h" | 7 #include "platform/inspector_protocol/String16.h" |
| 8 #include "platform/inspector_protocol/Values.h" | 8 #include "platform/inspector_protocol/Values.h" |
| 9 #include "platform/v8_inspector/InjectedScript.h" | 9 #include "platform/v8_inspector/InjectedScript.h" |
| 10 #include "platform/v8_inspector/InspectedContext.h" | 10 #include "platform/v8_inspector/InspectedContext.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 case V8DebuggerAgentImpl::DebugCommandBreakpointSource: | 61 case V8DebuggerAgentImpl::DebugCommandBreakpointSource: |
| 62 return ":debug"; | 62 return ":debug"; |
| 63 case V8DebuggerAgentImpl::MonitorCommandBreakpointSource: | 63 case V8DebuggerAgentImpl::MonitorCommandBreakpointSource: |
| 64 return ":monitor"; | 64 return ":monitor"; |
| 65 } | 65 } |
| 66 return String16(); | 66 return String16(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 static String16 generateBreakpointId(const String16& scriptId, int lineNumber, i
nt columnNumber, V8DebuggerAgentImpl::BreakpointSource source) | 69 static String16 generateBreakpointId(const String16& scriptId, int lineNumber, i
nt columnNumber, V8DebuggerAgentImpl::BreakpointSource source) |
| 70 { | 70 { |
| 71 return scriptId + ":" + String16::number(lineNumber) + ":" + String16::numbe
r(columnNumber) + breakpointIdSuffix(source); | 71 return scriptId + ":" + String16::fromInteger(lineNumber) + ":" + String16::
fromInteger(columnNumber) + breakpointIdSuffix(source); |
| 72 } | 72 } |
| 73 | 73 |
| 74 static bool positionComparator(const std::pair<int, int>& a, const std::pair<int
, int>& b) | 74 static bool positionComparator(const std::pair<int, int>& a, const std::pair<int
, int>& b) |
| 75 { | 75 { |
| 76 if (a.first != b.first) | 76 if (a.first != b.first) |
| 77 return a.first < b.first; | 77 return a.first < b.first; |
| 78 return a.second < b.second; | 78 return a.second < b.second; |
| 79 } | 79 } |
| 80 | 80 |
| 81 static bool hasInternalError(ErrorString* errorString, bool hasError) | 81 static bool hasInternalError(ErrorString* errorString, bool hasError) |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 160 |
| 161 enable(); | 161 enable(); |
| 162 } | 162 } |
| 163 | 163 |
| 164 void V8DebuggerAgentImpl::disable(ErrorString*) | 164 void V8DebuggerAgentImpl::disable(ErrorString*) |
| 165 { | 165 { |
| 166 if (!enabled()) | 166 if (!enabled()) |
| 167 return; | 167 return; |
| 168 | 168 |
| 169 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, protocol::Dict
ionaryValue::create()); | 169 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, protocol::Dict
ionaryValue::create()); |
| 170 m_state->setNumber(DebuggerAgentState::pauseOnExceptionsState, V8DebuggerImp
l::DontPauseOnExceptions); | 170 m_state->setInteger(DebuggerAgentState::pauseOnExceptionsState, V8DebuggerIm
pl::DontPauseOnExceptions); |
| 171 m_state->setNumber(DebuggerAgentState::asyncCallStackDepth, 0); | 171 m_state->setInteger(DebuggerAgentState::asyncCallStackDepth, 0); |
| 172 | 172 |
| 173 if (!m_pausedContext.IsEmpty()) | 173 if (!m_pausedContext.IsEmpty()) |
| 174 debugger().continueProgram(); | 174 debugger().continueProgram(); |
| 175 debugger().debuggerAgentDisabled(); | 175 debugger().debuggerAgentDisabled(); |
| 176 m_pausedContext.Reset(); | 176 m_pausedContext.Reset(); |
| 177 JavaScriptCallFrames emptyCallFrames; | 177 JavaScriptCallFrames emptyCallFrames; |
| 178 m_pausedCallFrames.swap(emptyCallFrames); | 178 m_pausedCallFrames.swap(emptyCallFrames); |
| 179 m_scripts.clear(); | 179 m_scripts.clear(); |
| 180 m_blackboxedPositions.clear(); | 180 m_blackboxedPositions.clear(); |
| 181 m_breakpointIdToDebuggerBreakpointIds.clear(); | 181 m_breakpointIdToDebuggerBreakpointIds.clear(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 201 DCHECK(!m_enabled); | 201 DCHECK(!m_enabled); |
| 202 if (!m_state->booleanProperty(DebuggerAgentState::debuggerEnabled, false)) | 202 if (!m_state->booleanProperty(DebuggerAgentState::debuggerEnabled, false)) |
| 203 return; | 203 return; |
| 204 if (!m_session->client()->canExecuteScripts()) | 204 if (!m_session->client()->canExecuteScripts()) |
| 205 return; | 205 return; |
| 206 | 206 |
| 207 enable(); | 207 enable(); |
| 208 ErrorString error; | 208 ErrorString error; |
| 209 | 209 |
| 210 int pauseState = V8DebuggerImpl::DontPauseOnExceptions; | 210 int pauseState = V8DebuggerImpl::DontPauseOnExceptions; |
| 211 m_state->getNumber(DebuggerAgentState::pauseOnExceptionsState, &pauseState); | 211 m_state->getInteger(DebuggerAgentState::pauseOnExceptionsState, &pauseState)
; |
| 212 setPauseOnExceptionsImpl(&error, pauseState); | 212 setPauseOnExceptionsImpl(&error, pauseState); |
| 213 DCHECK(error.isEmpty()); | 213 DCHECK(error.isEmpty()); |
| 214 | 214 |
| 215 m_skipAllPauses = m_state->booleanProperty(DebuggerAgentState::skipAllPauses
, false); | 215 m_skipAllPauses = m_state->booleanProperty(DebuggerAgentState::skipAllPauses
, false); |
| 216 | 216 |
| 217 int asyncCallStackDepth = 0; | 217 int asyncCallStackDepth = 0; |
| 218 m_state->getNumber(DebuggerAgentState::asyncCallStackDepth, &asyncCallStackD
epth); | 218 m_state->getInteger(DebuggerAgentState::asyncCallStackDepth, &asyncCallStack
Depth); |
| 219 m_debugger->setAsyncCallStackDepth(this, asyncCallStackDepth); | 219 m_debugger->setAsyncCallStackDepth(this, asyncCallStackDepth); |
| 220 | 220 |
| 221 String16 blackboxPattern; | 221 String16 blackboxPattern; |
| 222 if (m_state->getString(DebuggerAgentState::blackboxPattern, &blackboxPattern
)) { | 222 if (m_state->getString(DebuggerAgentState::blackboxPattern, &blackboxPattern
)) { |
| 223 if (!setBlackboxPattern(&error, blackboxPattern)) | 223 if (!setBlackboxPattern(&error, blackboxPattern)) |
| 224 NOTREACHED(); | 224 NOTREACHED(); |
| 225 } | 225 } |
| 226 } | 226 } |
| 227 | 227 |
| 228 void V8DebuggerAgentImpl::setBreakpointsActive(ErrorString* errorString, bool ac
tive) | 228 void V8DebuggerAgentImpl::setBreakpointsActive(ErrorString* errorString, bool ac
tive) |
| 229 { | 229 { |
| 230 if (!checkEnabled(errorString)) | 230 if (!checkEnabled(errorString)) |
| 231 return; | 231 return; |
| 232 debugger().setBreakpointsActivated(active); | 232 debugger().setBreakpointsActivated(active); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void V8DebuggerAgentImpl::setSkipAllPauses(ErrorString*, bool skipped) | 235 void V8DebuggerAgentImpl::setSkipAllPauses(ErrorString*, bool skipped) |
| 236 { | 236 { |
| 237 m_skipAllPauses = skipped; | 237 m_skipAllPauses = skipped; |
| 238 m_state->setBoolean(DebuggerAgentState::skipAllPauses, m_skipAllPauses); | 238 m_state->setBoolean(DebuggerAgentState::skipAllPauses, m_skipAllPauses); |
| 239 } | 239 } |
| 240 | 240 |
| 241 static std::unique_ptr<protocol::DictionaryValue> buildObjectForBreakpointCookie
(const String16& url, int lineNumber, int columnNumber, const String16& conditio
n, bool isRegex) | 241 static std::unique_ptr<protocol::DictionaryValue> buildObjectForBreakpointCookie
(const String16& url, int lineNumber, int columnNumber, const String16& conditio
n, bool isRegex) |
| 242 { | 242 { |
| 243 std::unique_ptr<protocol::DictionaryValue> breakpointObject = protocol::Dict
ionaryValue::create(); | 243 std::unique_ptr<protocol::DictionaryValue> breakpointObject = protocol::Dict
ionaryValue::create(); |
| 244 breakpointObject->setString(DebuggerAgentState::url, url); | 244 breakpointObject->setString(DebuggerAgentState::url, url); |
| 245 breakpointObject->setNumber(DebuggerAgentState::lineNumber, lineNumber); | 245 breakpointObject->setInteger(DebuggerAgentState::lineNumber, lineNumber); |
| 246 breakpointObject->setNumber(DebuggerAgentState::columnNumber, columnNumber); | 246 breakpointObject->setInteger(DebuggerAgentState::columnNumber, columnNumber)
; |
| 247 breakpointObject->setString(DebuggerAgentState::condition, condition); | 247 breakpointObject->setString(DebuggerAgentState::condition, condition); |
| 248 breakpointObject->setBoolean(DebuggerAgentState::isRegex, isRegex); | 248 breakpointObject->setBoolean(DebuggerAgentState::isRegex, isRegex); |
| 249 return breakpointObject; | 249 return breakpointObject; |
| 250 } | 250 } |
| 251 | 251 |
| 252 static bool matches(V8DebuggerImpl* debugger, const String16& url, const String1
6& pattern, bool isRegex) | 252 static bool matches(V8DebuggerImpl* debugger, const String16& url, const String1
6& pattern, bool isRegex) |
| 253 { | 253 { |
| 254 if (isRegex) { | 254 if (isRegex) { |
| 255 V8Regex regex(debugger, pattern, true); | 255 V8Regex regex(debugger, pattern, true); |
| 256 return regex.match(url) != -1; | 256 return regex.match(url) != -1; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 278 if (optionalColumnNumber.isJust()) { | 278 if (optionalColumnNumber.isJust()) { |
| 279 columnNumber = optionalColumnNumber.fromJust(); | 279 columnNumber = optionalColumnNumber.fromJust(); |
| 280 if (columnNumber < 0) { | 280 if (columnNumber < 0) { |
| 281 *errorString = "Incorrect column number"; | 281 *errorString = "Incorrect column number"; |
| 282 return; | 282 return; |
| 283 } | 283 } |
| 284 } | 284 } |
| 285 String16 condition = optionalCondition.fromMaybe(""); | 285 String16 condition = optionalCondition.fromMaybe(""); |
| 286 bool isRegex = optionalURLRegex.isJust(); | 286 bool isRegex = optionalURLRegex.isJust(); |
| 287 | 287 |
| 288 String16 breakpointId = (isRegex ? "/" + url + "/" : url) + ":" + String16::
number(lineNumber) + ":" + String16::number(columnNumber); | 288 String16 breakpointId = (isRegex ? "/" + url + "/" : url) + ":" + String16::
fromInteger(lineNumber) + ":" + String16::fromInteger(columnNumber); |
| 289 protocol::DictionaryValue* breakpointsCookie = m_state->getObject(DebuggerAg
entState::javaScriptBreakpoints); | 289 protocol::DictionaryValue* breakpointsCookie = m_state->getObject(DebuggerAg
entState::javaScriptBreakpoints); |
| 290 if (!breakpointsCookie) { | 290 if (!breakpointsCookie) { |
| 291 std::unique_ptr<protocol::DictionaryValue> newValue = protocol::Dictiona
ryValue::create(); | 291 std::unique_ptr<protocol::DictionaryValue> newValue = protocol::Dictiona
ryValue::create(); |
| 292 breakpointsCookie = newValue.get(); | 292 breakpointsCookie = newValue.get(); |
| 293 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, std::move(
newValue)); | 293 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, std::move(
newValue)); |
| 294 } | 294 } |
| 295 if (breakpointsCookie->get(breakpointId)) { | 295 if (breakpointsCookie->get(breakpointId)) { |
| 296 *errorString = "Breakpoint at specified location already exists."; | 296 *errorString = "Breakpoint at specified location already exists."; |
| 297 return; | 297 return; |
| 298 } | 298 } |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 { | 423 { |
| 424 DCHECK(enabled()); | 424 DCHECK(enabled()); |
| 425 JavaScriptCallFrame* frame = m_pausedCallFrames.size() ? m_pausedCallFrames[
0].get() : nullptr; | 425 JavaScriptCallFrame* frame = m_pausedCallFrames.size() ? m_pausedCallFrames[
0].get() : nullptr; |
| 426 return isCallFrameWithUnknownScriptOrBlackboxed(frame); | 426 return isCallFrameWithUnknownScriptOrBlackboxed(frame); |
| 427 } | 427 } |
| 428 | 428 |
| 429 bool V8DebuggerAgentImpl::isCallFrameWithUnknownScriptOrBlackboxed(JavaScriptCal
lFrame* frame) | 429 bool V8DebuggerAgentImpl::isCallFrameWithUnknownScriptOrBlackboxed(JavaScriptCal
lFrame* frame) |
| 430 { | 430 { |
| 431 if (!frame) | 431 if (!frame) |
| 432 return true; | 432 return true; |
| 433 ScriptsMap::iterator it = m_scripts.find(String16::number(frame->sourceID())
); | 433 ScriptsMap::iterator it = m_scripts.find(String16::fromInteger(frame->source
ID())); |
| 434 if (it == m_scripts.end()) { | 434 if (it == m_scripts.end()) { |
| 435 // Unknown scripts are blackboxed. | 435 // Unknown scripts are blackboxed. |
| 436 return true; | 436 return true; |
| 437 } | 437 } |
| 438 if (m_blackboxPattern) { | 438 if (m_blackboxPattern) { |
| 439 const String16& scriptSourceURL = it->second->sourceURL(); | 439 const String16& scriptSourceURL = it->second->sourceURL(); |
| 440 if (!scriptSourceURL.isEmpty() && m_blackboxPattern->match(scriptSourceU
RL) != -1) | 440 if (!scriptSourceURL.isEmpty() && m_blackboxPattern->match(scriptSourceU
RL) != -1) |
| 441 return true; | 441 return true; |
| 442 } | 442 } |
| 443 auto itBlackboxedPositions = m_blackboxedPositions.find(String16::number(fra
me->sourceID())); | 443 auto itBlackboxedPositions = m_blackboxedPositions.find(String16::fromIntege
r(frame->sourceID())); |
| 444 if (itBlackboxedPositions == m_blackboxedPositions.end()) | 444 if (itBlackboxedPositions == m_blackboxedPositions.end()) |
| 445 return false; | 445 return false; |
| 446 | 446 |
| 447 const std::vector<std::pair<int, int>>& ranges = itBlackboxedPositions->seco
nd; | 447 const std::vector<std::pair<int, int>>& ranges = itBlackboxedPositions->seco
nd; |
| 448 auto itRange = std::lower_bound(ranges.cbegin(), ranges.cend(), | 448 auto itRange = std::lower_bound(ranges.cbegin(), ranges.cend(), |
| 449 std::make_pair(frame->line(), frame->column()), positionComparator); | 449 std::make_pair(frame->line(), frame->column()), positionComparator); |
| 450 // Ranges array contains positions in script where blackbox state is changed
. | 450 // Ranges array contains positions in script where blackbox state is changed
. |
| 451 // [(0,0) ... ranges[0]) isn't blackboxed, [ranges[0] ... ranges[1]) is blac
kboxed... | 451 // [(0,0) ... ranges[0]) isn't blackboxed, [ranges[0] ... ranges[1]) is blac
kboxed... |
| 452 return std::distance(ranges.begin(), itRange) % 2; | 452 return std::distance(ranges.begin(), itRange) % 2; |
| 453 } | 453 } |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 } | 705 } |
| 706 setPauseOnExceptionsImpl(errorString, pauseState); | 706 setPauseOnExceptionsImpl(errorString, pauseState); |
| 707 } | 707 } |
| 708 | 708 |
| 709 void V8DebuggerAgentImpl::setPauseOnExceptionsImpl(ErrorString* errorString, int
pauseState) | 709 void V8DebuggerAgentImpl::setPauseOnExceptionsImpl(ErrorString* errorString, int
pauseState) |
| 710 { | 710 { |
| 711 debugger().setPauseOnExceptionsState(static_cast<V8DebuggerImpl::PauseOnExce
ptionsState>(pauseState)); | 711 debugger().setPauseOnExceptionsState(static_cast<V8DebuggerImpl::PauseOnExce
ptionsState>(pauseState)); |
| 712 if (debugger().getPauseOnExceptionsState() != pauseState) | 712 if (debugger().getPauseOnExceptionsState() != pauseState) |
| 713 *errorString = "Internal error. Could not change pause on exceptions sta
te"; | 713 *errorString = "Internal error. Could not change pause on exceptions sta
te"; |
| 714 else | 714 else |
| 715 m_state->setNumber(DebuggerAgentState::pauseOnExceptionsState, pauseStat
e); | 715 m_state->setInteger(DebuggerAgentState::pauseOnExceptionsState, pauseSta
te); |
| 716 } | 716 } |
| 717 | 717 |
| 718 void V8DebuggerAgentImpl::evaluateOnCallFrame(ErrorString* errorString, | 718 void V8DebuggerAgentImpl::evaluateOnCallFrame(ErrorString* errorString, |
| 719 const String16& callFrameId, | 719 const String16& callFrameId, |
| 720 const String16& expression, | 720 const String16& expression, |
| 721 const Maybe<String16>& objectGroup, | 721 const Maybe<String16>& objectGroup, |
| 722 const Maybe<bool>& includeCommandLineAPI, | 722 const Maybe<bool>& includeCommandLineAPI, |
| 723 const Maybe<bool>& doNotPauseOnExceptionsAndMuteConsole, | 723 const Maybe<bool>& doNotPauseOnExceptionsAndMuteConsole, |
| 724 const Maybe<bool>& returnByValue, | 724 const Maybe<bool>& returnByValue, |
| 725 const Maybe<bool>& generatePreview, | 725 const Maybe<bool>& generatePreview, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 if (scope.tryCatch().HasCaught() || result.IsEmpty()) { | 784 if (scope.tryCatch().HasCaught() || result.IsEmpty()) { |
| 785 *errorString = "Internal error"; | 785 *errorString = "Internal error"; |
| 786 return; | 786 return; |
| 787 } | 787 } |
| 788 } | 788 } |
| 789 | 789 |
| 790 void V8DebuggerAgentImpl::setAsyncCallStackDepth(ErrorString* errorString, int d
epth) | 790 void V8DebuggerAgentImpl::setAsyncCallStackDepth(ErrorString* errorString, int d
epth) |
| 791 { | 791 { |
| 792 if (!checkEnabled(errorString)) | 792 if (!checkEnabled(errorString)) |
| 793 return; | 793 return; |
| 794 m_state->setNumber(DebuggerAgentState::asyncCallStackDepth, depth); | 794 m_state->setInteger(DebuggerAgentState::asyncCallStackDepth, depth); |
| 795 m_debugger->setAsyncCallStackDepth(this, depth); | 795 m_debugger->setAsyncCallStackDepth(this, depth); |
| 796 } | 796 } |
| 797 | 797 |
| 798 void V8DebuggerAgentImpl::setBlackboxPatterns(ErrorString* errorString, std::uni
que_ptr<protocol::Array<String16>> patterns) | 798 void V8DebuggerAgentImpl::setBlackboxPatterns(ErrorString* errorString, std::uni
que_ptr<protocol::Array<String16>> patterns) |
| 799 { | 799 { |
| 800 if (!patterns->length()) { | 800 if (!patterns->length()) { |
| 801 m_blackboxPattern = nullptr; | 801 m_blackboxPattern = nullptr; |
| 802 m_state->remove(DebuggerAgentState::blackboxPattern); | 802 m_state->remove(DebuggerAgentState::blackboxPattern); |
| 803 return; | 803 return; |
| 804 } | 804 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 m_blackboxedPositions[scriptId] = positions; | 868 m_blackboxedPositions[scriptId] = positions; |
| 869 } | 869 } |
| 870 | 870 |
| 871 void V8DebuggerAgentImpl::willExecuteScript(int scriptId) | 871 void V8DebuggerAgentImpl::willExecuteScript(int scriptId) |
| 872 { | 872 { |
| 873 changeJavaScriptRecursionLevel(+1); | 873 changeJavaScriptRecursionLevel(+1); |
| 874 // Fast return. | 874 // Fast return. |
| 875 if (m_scheduledDebuggerStep != StepInto) | 875 if (m_scheduledDebuggerStep != StepInto) |
| 876 return; | 876 return; |
| 877 // Skip unknown scripts (e.g. InjectedScript). | 877 // Skip unknown scripts (e.g. InjectedScript). |
| 878 if (m_scripts.find(String16::number(scriptId)) == m_scripts.end()) | 878 if (m_scripts.find(String16::fromInteger(scriptId)) == m_scripts.end()) |
| 879 return; | 879 return; |
| 880 schedulePauseOnNextStatementIfSteppingInto(); | 880 schedulePauseOnNextStatementIfSteppingInto(); |
| 881 } | 881 } |
| 882 | 882 |
| 883 void V8DebuggerAgentImpl::didExecuteScript() | 883 void V8DebuggerAgentImpl::didExecuteScript() |
| 884 { | 884 { |
| 885 changeJavaScriptRecursionLevel(-1); | 885 changeJavaScriptRecursionLevel(-1); |
| 886 } | 886 } |
| 887 | 887 |
| 888 void V8DebuggerAgentImpl::changeJavaScriptRecursionLevel(int step) | 888 void V8DebuggerAgentImpl::changeJavaScriptRecursionLevel(int step) |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 for (size_t i = 0; i < breakpointsCookie->size(); ++i) { | 1034 for (size_t i = 0; i < breakpointsCookie->size(); ++i) { |
| 1035 auto cookie = breakpointsCookie->at(i); | 1035 auto cookie = breakpointsCookie->at(i); |
| 1036 protocol::DictionaryValue* breakpointObject = protocol::DictionaryValue:
:cast(cookie.second); | 1036 protocol::DictionaryValue* breakpointObject = protocol::DictionaryValue:
:cast(cookie.second); |
| 1037 bool isRegex; | 1037 bool isRegex; |
| 1038 breakpointObject->getBoolean(DebuggerAgentState::isRegex, &isRegex); | 1038 breakpointObject->getBoolean(DebuggerAgentState::isRegex, &isRegex); |
| 1039 String16 url; | 1039 String16 url; |
| 1040 breakpointObject->getString(DebuggerAgentState::url, &url); | 1040 breakpointObject->getString(DebuggerAgentState::url, &url); |
| 1041 if (!matches(m_debugger, scriptURL, url, isRegex)) | 1041 if (!matches(m_debugger, scriptURL, url, isRegex)) |
| 1042 continue; | 1042 continue; |
| 1043 ScriptBreakpoint breakpoint; | 1043 ScriptBreakpoint breakpoint; |
| 1044 breakpointObject->getNumber(DebuggerAgentState::lineNumber, &breakpoint.
lineNumber); | 1044 breakpointObject->getInteger(DebuggerAgentState::lineNumber, &breakpoint
.lineNumber); |
| 1045 breakpointObject->getNumber(DebuggerAgentState::columnNumber, &breakpoin
t.columnNumber); | 1045 breakpointObject->getInteger(DebuggerAgentState::columnNumber, &breakpoi
nt.columnNumber); |
| 1046 breakpointObject->getString(DebuggerAgentState::condition, &breakpoint.c
ondition); | 1046 breakpointObject->getString(DebuggerAgentState::condition, &breakpoint.c
ondition); |
| 1047 std::unique_ptr<protocol::Debugger::Location> location = resolveBreakpoi
nt(cookie.first, scriptId, breakpoint, UserBreakpointSource); | 1047 std::unique_ptr<protocol::Debugger::Location> location = resolveBreakpoi
nt(cookie.first, scriptId, breakpoint, UserBreakpointSource); |
| 1048 if (location) | 1048 if (location) |
| 1049 m_frontend.breakpointResolved(cookie.first, std::move(location)); | 1049 m_frontend.breakpointResolved(cookie.first, std::move(location)); |
| 1050 } | 1050 } |
| 1051 } | 1051 } |
| 1052 | 1052 |
| 1053 V8DebuggerAgentImpl::SkipPauseRequest V8DebuggerAgentImpl::didPause(v8::Local<v8
::Context> context, v8::Local<v8::Value> exception, const std::vector<String16>&
hitBreakpoints, bool isPromiseRejection) | 1053 V8DebuggerAgentImpl::SkipPauseRequest V8DebuggerAgentImpl::didPause(v8::Local<v8
::Context> context, v8::Local<v8::Value> exception, const std::vector<String16>&
hitBreakpoints, bool isPromiseRejection) |
| 1054 { | 1054 { |
| 1055 JavaScriptCallFrames callFrames = debugger().currentCallFrames(1); | 1055 JavaScriptCallFrames callFrames = debugger().currentCallFrames(1); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1181 { | 1181 { |
| 1182 if (!enabled()) | 1182 if (!enabled()) |
| 1183 return; | 1183 return; |
| 1184 m_scheduledDebuggerStep = NoStep; | 1184 m_scheduledDebuggerStep = NoStep; |
| 1185 m_scripts.clear(); | 1185 m_scripts.clear(); |
| 1186 m_blackboxedPositions.clear(); | 1186 m_blackboxedPositions.clear(); |
| 1187 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1187 m_breakpointIdToDebuggerBreakpointIds.clear(); |
| 1188 } | 1188 } |
| 1189 | 1189 |
| 1190 } // namespace blink | 1190 } // namespace blink |
| OLD | NEW |