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/JSONValues.h" | 7 #include "platform/inspector_protocol/Values.h" |
8 #include "platform/v8_inspector/AsyncCallChain.h" | 8 #include "platform/v8_inspector/AsyncCallChain.h" |
9 #include "platform/v8_inspector/IgnoreExceptionsScope.h" | 9 #include "platform/v8_inspector/IgnoreExceptionsScope.h" |
10 #include "platform/v8_inspector/InjectedScript.h" | 10 #include "platform/v8_inspector/InjectedScript.h" |
11 #include "platform/v8_inspector/InjectedScriptHost.h" | 11 #include "platform/v8_inspector/InjectedScriptHost.h" |
12 #include "platform/v8_inspector/InjectedScriptManager.h" | 12 #include "platform/v8_inspector/InjectedScriptManager.h" |
13 #include "platform/v8_inspector/JavaScriptCallFrame.h" | 13 #include "platform/v8_inspector/JavaScriptCallFrame.h" |
14 #include "platform/v8_inspector/PromiseTracker.h" | 14 #include "platform/v8_inspector/PromiseTracker.h" |
15 #include "platform/v8_inspector/RemoteObjectId.h" | 15 #include "platform/v8_inspector/RemoteObjectId.h" |
16 #include "platform/v8_inspector/V8AsyncCallTracker.h" | 16 #include "platform/v8_inspector/V8AsyncCallTracker.h" |
17 #include "platform/v8_inspector/V8JavaScriptCallFrame.h" | 17 #include "platform/v8_inspector/V8JavaScriptCallFrame.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 enable(); | 189 enable(); |
190 | 190 |
191 ASSERT(m_frontend); | 191 ASSERT(m_frontend); |
192 } | 192 } |
193 | 193 |
194 void V8DebuggerAgentImpl::disable(ErrorString*) | 194 void V8DebuggerAgentImpl::disable(ErrorString*) |
195 { | 195 { |
196 if (!enabled()) | 196 if (!enabled()) |
197 return; | 197 return; |
198 | 198 |
199 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, JSONObject::cr
eate()); | 199 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, protocol::Dict
ionaryValue::create()); |
200 m_state->setNumber(DebuggerAgentState::pauseOnExceptionsState, V8DebuggerImp
l::DontPauseOnExceptions); | 200 m_state->setNumber(DebuggerAgentState::pauseOnExceptionsState, V8DebuggerImp
l::DontPauseOnExceptions); |
201 m_state->setNumber(DebuggerAgentState::asyncCallStackDepth, 0); | 201 m_state->setNumber(DebuggerAgentState::asyncCallStackDepth, 0); |
202 m_state->setBoolean(DebuggerAgentState::promiseTrackerEnabled, false); | 202 m_state->setBoolean(DebuggerAgentState::promiseTrackerEnabled, false); |
203 m_state->setBoolean(DebuggerAgentState::promiseTrackerCaptureStacks, false); | 203 m_state->setBoolean(DebuggerAgentState::promiseTrackerCaptureStacks, false); |
204 | 204 |
205 debugger().removeAgent(m_contextGroupId); | 205 debugger().removeAgent(m_contextGroupId); |
206 m_pausedContext.Reset(); | 206 m_pausedContext.Reset(); |
207 m_currentCallStack.Reset(); | 207 m_currentCallStack.Reset(); |
208 m_scripts.clear(); | 208 m_scripts.clear(); |
209 m_blackboxedPositions.clear(); | 209 m_blackboxedPositions.clear(); |
(...skipping 19 matching lines...) Expand all Loading... |
229 { | 229 { |
230 if (depth <= 0) { | 230 if (depth <= 0) { |
231 m_maxAsyncCallStackDepth = 0; | 231 m_maxAsyncCallStackDepth = 0; |
232 resetAsyncCallTracker(); | 232 resetAsyncCallTracker(); |
233 } else { | 233 } else { |
234 m_maxAsyncCallStackDepth = depth; | 234 m_maxAsyncCallStackDepth = depth; |
235 } | 235 } |
236 m_v8AsyncCallTracker->asyncCallTrackingStateChanged(m_maxAsyncCallStackDepth
); | 236 m_v8AsyncCallTracker->asyncCallTrackingStateChanged(m_maxAsyncCallStackDepth
); |
237 } | 237 } |
238 | 238 |
239 void V8DebuggerAgentImpl::setInspectorState(PassRefPtr<JSONObject> state) | 239 void V8DebuggerAgentImpl::setInspectorState(PassRefPtr<protocol::DictionaryValue
> state) |
240 { | 240 { |
241 m_state = state; | 241 m_state = state; |
242 } | 242 } |
243 | 243 |
244 void V8DebuggerAgentImpl::clearFrontend() | 244 void V8DebuggerAgentImpl::clearFrontend() |
245 { | 245 { |
246 ErrorString error; | 246 ErrorString error; |
247 disable(&error); | 247 disable(&error); |
248 ASSERT(m_frontend); | 248 ASSERT(m_frontend); |
249 m_frontend = nullptr; | 249 m_frontend = nullptr; |
250 } | 250 } |
251 | 251 |
252 void V8DebuggerAgentImpl::restore() | 252 void V8DebuggerAgentImpl::restore() |
253 { | 253 { |
254 ASSERT(!m_enabled); | 254 ASSERT(!m_enabled); |
255 m_frontend->globalObjectCleared(); | 255 m_frontend->globalObjectCleared(); |
256 enable(); | 256 enable(); |
257 String error; | 257 String error; |
258 | 258 |
259 long pauseState = V8DebuggerImpl::DontPauseOnExceptions; | 259 int pauseState = V8DebuggerImpl::DontPauseOnExceptions; |
260 m_state->getNumber(DebuggerAgentState::pauseOnExceptionsState, &pauseState); | 260 m_state->getNumber(DebuggerAgentState::pauseOnExceptionsState, &pauseState); |
261 setPauseOnExceptionsImpl(&error, pauseState); | 261 setPauseOnExceptionsImpl(&error, pauseState); |
262 | 262 |
263 m_skipAllPauses = m_state->booleanProperty(DebuggerAgentState::skipAllPauses
, false); | 263 m_skipAllPauses = m_state->booleanProperty(DebuggerAgentState::skipAllPauses
, false); |
264 | 264 |
265 int asyncCallStackDepth = 0; | 265 int asyncCallStackDepth = 0; |
266 m_state->getNumber(DebuggerAgentState::asyncCallStackDepth, &asyncCallStackD
epth); | 266 m_state->getNumber(DebuggerAgentState::asyncCallStackDepth, &asyncCallStackD
epth); |
267 internalSetAsyncCallStackDepth(asyncCallStackDepth); | 267 internalSetAsyncCallStackDepth(asyncCallStackDepth); |
268 | 268 |
269 m_promiseTracker->setEnabled(m_state->booleanProperty(DebuggerAgentState::pr
omiseTrackerEnabled, false), m_state->booleanProperty(DebuggerAgentState::promis
eTrackerCaptureStacks, false)); | 269 m_promiseTracker->setEnabled(m_state->booleanProperty(DebuggerAgentState::pr
omiseTrackerEnabled, false), m_state->booleanProperty(DebuggerAgentState::promis
eTrackerCaptureStacks, false)); |
(...skipping 10 matching lines...) Expand all Loading... |
280 { | 280 { |
281 m_skipAllPauses = skipped; | 281 m_skipAllPauses = skipped; |
282 m_state->setBoolean(DebuggerAgentState::skipAllPauses, m_skipAllPauses); | 282 m_state->setBoolean(DebuggerAgentState::skipAllPauses, m_skipAllPauses); |
283 } | 283 } |
284 | 284 |
285 bool V8DebuggerAgentImpl::isPaused() | 285 bool V8DebuggerAgentImpl::isPaused() |
286 { | 286 { |
287 return debugger().isPaused(); | 287 return debugger().isPaused(); |
288 } | 288 } |
289 | 289 |
290 static PassRefPtr<JSONObject> buildObjectForBreakpointCookie(const String& url,
int lineNumber, int columnNumber, const String& condition, bool isRegex) | 290 static PassRefPtr<protocol::DictionaryValue> buildObjectForBreakpointCookie(cons
t String& url, int lineNumber, int columnNumber, const String& condition, bool i
sRegex) |
291 { | 291 { |
292 RefPtr<JSONObject> breakpointObject = JSONObject::create(); | 292 RefPtr<protocol::DictionaryValue> breakpointObject = protocol::DictionaryVal
ue::create(); |
293 breakpointObject->setString(DebuggerAgentState::url, url); | 293 breakpointObject->setString(DebuggerAgentState::url, url); |
294 breakpointObject->setNumber(DebuggerAgentState::lineNumber, lineNumber); | 294 breakpointObject->setNumber(DebuggerAgentState::lineNumber, lineNumber); |
295 breakpointObject->setNumber(DebuggerAgentState::columnNumber, columnNumber); | 295 breakpointObject->setNumber(DebuggerAgentState::columnNumber, columnNumber); |
296 breakpointObject->setString(DebuggerAgentState::condition, condition); | 296 breakpointObject->setString(DebuggerAgentState::condition, condition); |
297 breakpointObject->setBoolean(DebuggerAgentState::isRegex, isRegex); | 297 breakpointObject->setBoolean(DebuggerAgentState::isRegex, isRegex); |
298 return breakpointObject.release(); | 298 return breakpointObject.release(); |
299 } | 299 } |
300 | 300 |
301 static bool matches(V8DebuggerImpl* debugger, const String& url, const String& p
attern, bool isRegex) | 301 static bool matches(V8DebuggerImpl* debugger, const String& url, const String& p
attern, bool isRegex) |
302 { | 302 { |
(...skipping 25 matching lines...) Expand all Loading... |
328 columnNumber = optionalColumnNumber.fromJust(); | 328 columnNumber = optionalColumnNumber.fromJust(); |
329 if (columnNumber < 0) { | 329 if (columnNumber < 0) { |
330 *errorString = "Incorrect column number"; | 330 *errorString = "Incorrect column number"; |
331 return; | 331 return; |
332 } | 332 } |
333 } | 333 } |
334 String condition = optionalCondition.fromMaybe(""); | 334 String condition = optionalCondition.fromMaybe(""); |
335 bool isRegex = optionalURLRegex.isJust(); | 335 bool isRegex = optionalURLRegex.isJust(); |
336 | 336 |
337 String breakpointId = (isRegex ? "/" + url + "/" : url) + ':' + String::numb
er(lineNumber) + ':' + String::number(columnNumber); | 337 String breakpointId = (isRegex ? "/" + url + "/" : url) + ':' + String::numb
er(lineNumber) + ':' + String::number(columnNumber); |
338 RefPtr<JSONObject> breakpointsCookie = m_state->getObject(DebuggerAgentState
::javaScriptBreakpoints); | 338 RefPtr<protocol::DictionaryValue> breakpointsCookie = m_state->getObject(Deb
uggerAgentState::javaScriptBreakpoints); |
339 if (!breakpointsCookie) { | 339 if (!breakpointsCookie) { |
340 breakpointsCookie = JSONObject::create(); | 340 breakpointsCookie = protocol::DictionaryValue::create(); |
341 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, breakpoint
sCookie); | 341 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, breakpoint
sCookie); |
342 } | 342 } |
343 if (breakpointsCookie->find(breakpointId) != breakpointsCookie->end()) { | 343 if (breakpointsCookie->find(breakpointId) != breakpointsCookie->end()) { |
344 *errorString = "Breakpoint at specified location already exists."; | 344 *errorString = "Breakpoint at specified location already exists."; |
345 return; | 345 return; |
346 } | 346 } |
347 | 347 |
348 breakpointsCookie->setObject(breakpointId, buildObjectForBreakpointCookie(ur
l, lineNumber, columnNumber, condition, isRegex)); | 348 breakpointsCookie->setObject(breakpointId, buildObjectForBreakpointCookie(ur
l, lineNumber, columnNumber, condition, isRegex)); |
349 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, breakpointsCoo
kie); | 349 m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, breakpointsCoo
kie); |
350 | 350 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 if (*actualLocation) | 393 if (*actualLocation) |
394 *outBreakpointId = breakpointId; | 394 *outBreakpointId = breakpointId; |
395 else | 395 else |
396 *errorString = "Could not resolve breakpoint"; | 396 *errorString = "Could not resolve breakpoint"; |
397 } | 397 } |
398 | 398 |
399 void V8DebuggerAgentImpl::removeBreakpoint(ErrorString* errorString, const Strin
g& breakpointId) | 399 void V8DebuggerAgentImpl::removeBreakpoint(ErrorString* errorString, const Strin
g& breakpointId) |
400 { | 400 { |
401 if (!checkEnabled(errorString)) | 401 if (!checkEnabled(errorString)) |
402 return; | 402 return; |
403 RefPtr<JSONObject> breakpointsCookie = m_state->getObject(DebuggerAgentState
::javaScriptBreakpoints); | 403 RefPtr<protocol::DictionaryValue> breakpointsCookie = m_state->getObject(Deb
uggerAgentState::javaScriptBreakpoints); |
404 if (breakpointsCookie) | 404 if (breakpointsCookie) |
405 breakpointsCookie->remove(breakpointId); | 405 breakpointsCookie->remove(breakpointId); |
406 removeBreakpoint(breakpointId); | 406 removeBreakpoint(breakpointId); |
407 } | 407 } |
408 | 408 |
409 void V8DebuggerAgentImpl::removeBreakpoint(const String& breakpointId) | 409 void V8DebuggerAgentImpl::removeBreakpoint(const String& breakpointId) |
410 { | 410 { |
411 ASSERT(enabled()); | 411 ASSERT(enabled()); |
412 BreakpointIdToDebuggerBreakpointIdsMap::iterator debuggerBreakpointIdsIterat
or = m_breakpointIdToDebuggerBreakpointIds.find(breakpointId); | 412 BreakpointIdToDebuggerBreakpointIdsMap::iterator debuggerBreakpointIdsIterat
or = m_breakpointIdToDebuggerBreakpointIds.find(breakpointId); |
413 if (debuggerBreakpointIdsIterator == m_breakpointIdToDebuggerBreakpointIds.e
nd()) | 413 if (debuggerBreakpointIdsIterator == m_breakpointIdToDebuggerBreakpointIds.e
nd()) |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 return; | 720 return; |
721 } | 721 } |
722 InjectedScript* injectedScript = m_injectedScriptManager->findInjectedScript
(remoteId.get()); | 722 InjectedScript* injectedScript = m_injectedScriptManager->findInjectedScript
(remoteId.get()); |
723 if (!injectedScript) { | 723 if (!injectedScript) { |
724 *errorString = "Inspected frame has gone"; | 724 *errorString = "Inspected frame has gone"; |
725 return; | 725 return; |
726 } | 726 } |
727 injectedScript->getCollectionEntries(errorString, objectId, entries); | 727 injectedScript->getCollectionEntries(errorString, objectId, entries); |
728 } | 728 } |
729 | 729 |
730 void V8DebuggerAgentImpl::schedulePauseOnNextStatement(const String& breakReason
, PassRefPtr<JSONObject> data) | 730 void V8DebuggerAgentImpl::schedulePauseOnNextStatement(const String& breakReason
, PassRefPtr<protocol::DictionaryValue> data) |
731 { | 731 { |
732 ASSERT(enabled()); | 732 ASSERT(enabled()); |
733 if (m_scheduledDebuggerStep == StepInto || m_javaScriptPauseScheduled || isP
aused()) | 733 if (m_scheduledDebuggerStep == StepInto || m_javaScriptPauseScheduled || isP
aused()) |
734 return; | 734 return; |
735 m_breakReason = breakReason; | 735 m_breakReason = breakReason; |
736 m_breakAuxData = data; | 736 m_breakAuxData = data; |
737 m_pausingOnNativeEvent = true; | 737 m_pausingOnNativeEvent = true; |
738 m_skipNextDebuggerStepOut = false; | 738 m_skipNextDebuggerStepOut = false; |
739 debugger().setPauseOnNextStatement(true); | 739 debugger().setPauseOnNextStatement(true); |
740 } | 740 } |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 if (parsedScript.success) | 1438 if (parsedScript.success) |
1439 m_frontend->scriptParsed(parsedScript.scriptId, scriptURL, script.startL
ine(), script.startColumn(), script.endLine(), script.endColumn(), executionCont
extId, isContentScriptParam, isInternalScriptParam, isLiveEditParam, sourceMapUR
LParam, hasSourceURLParam, deprecatedCommentWasUsedParam); | 1439 m_frontend->scriptParsed(parsedScript.scriptId, scriptURL, script.startL
ine(), script.startColumn(), script.endLine(), script.endColumn(), executionCont
extId, isContentScriptParam, isInternalScriptParam, isLiveEditParam, sourceMapUR
LParam, hasSourceURLParam, deprecatedCommentWasUsedParam); |
1440 else | 1440 else |
1441 m_frontend->scriptFailedToParse(parsedScript.scriptId, scriptURL, script
.startLine(), script.startColumn(), script.endLine(), script.endColumn(), execut
ionContextId, isContentScriptParam, isInternalScriptParam, sourceMapURLParam, ha
sSourceURLParam, deprecatedCommentWasUsedParam); | 1441 m_frontend->scriptFailedToParse(parsedScript.scriptId, scriptURL, script
.startLine(), script.startColumn(), script.endLine(), script.endColumn(), execut
ionContextId, isContentScriptParam, isInternalScriptParam, sourceMapURLParam, ha
sSourceURLParam, deprecatedCommentWasUsedParam); |
1442 | 1442 |
1443 m_scripts.set(parsedScript.scriptId, script); | 1443 m_scripts.set(parsedScript.scriptId, script); |
1444 | 1444 |
1445 if (scriptURL.isEmpty() || !parsedScript.success) | 1445 if (scriptURL.isEmpty() || !parsedScript.success) |
1446 return; | 1446 return; |
1447 | 1447 |
1448 RefPtr<JSONObject> breakpointsCookie = m_state->getObject(DebuggerAgentState
::javaScriptBreakpoints); | 1448 RefPtr<protocol::DictionaryValue> breakpointsCookie = m_state->getObject(Deb
uggerAgentState::javaScriptBreakpoints); |
1449 if (!breakpointsCookie) | 1449 if (!breakpointsCookie) |
1450 return; | 1450 return; |
1451 | 1451 |
1452 for (auto& cookie : *breakpointsCookie) { | 1452 for (auto& cookie : *breakpointsCookie) { |
1453 RefPtr<JSONObject> breakpointObject = JSONObject::cast(cookie.value); | 1453 RefPtr<protocol::DictionaryValue> breakpointObject = protocol::Dictionar
yValue::cast(cookie.value); |
1454 bool isRegex; | 1454 bool isRegex; |
1455 breakpointObject->getBoolean(DebuggerAgentState::isRegex, &isRegex); | 1455 breakpointObject->getBoolean(DebuggerAgentState::isRegex, &isRegex); |
1456 String url; | 1456 String url; |
1457 breakpointObject->getString(DebuggerAgentState::url, &url); | 1457 breakpointObject->getString(DebuggerAgentState::url, &url); |
1458 if (!matches(m_debugger, scriptURL, url, isRegex)) | 1458 if (!matches(m_debugger, scriptURL, url, isRegex)) |
1459 continue; | 1459 continue; |
1460 ScriptBreakpoint breakpoint; | 1460 ScriptBreakpoint breakpoint; |
1461 breakpointObject->getNumber(DebuggerAgentState::lineNumber, &breakpoint.
lineNumber); | 1461 breakpointObject->getNumber(DebuggerAgentState::lineNumber, &breakpoint.
lineNumber); |
1462 breakpointObject->getNumber(DebuggerAgentState::columnNumber, &breakpoin
t.columnNumber); | 1462 breakpointObject->getNumber(DebuggerAgentState::columnNumber, &breakpoin
t.columnNumber); |
1463 breakpointObject->getString(DebuggerAgentState::condition, &breakpoint.c
ondition); | 1463 breakpointObject->getString(DebuggerAgentState::condition, &breakpoint.c
ondition); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1500 if (!exception.IsEmpty()) { | 1500 if (!exception.IsEmpty()) { |
1501 InjectedScript* injectedScript = m_injectedScriptManager->injectedScript
For(context); | 1501 InjectedScript* injectedScript = m_injectedScriptManager->injectedScript
For(context); |
1502 if (injectedScript) { | 1502 if (injectedScript) { |
1503 m_breakReason = isPromiseRejection ? protocol::Debugger::Paused::Rea
sonEnum::PromiseRejection : protocol::Debugger::Paused::ReasonEnum::Exception; | 1503 m_breakReason = isPromiseRejection ? protocol::Debugger::Paused::Rea
sonEnum::PromiseRejection : protocol::Debugger::Paused::ReasonEnum::Exception; |
1504 auto obj = injectedScript->wrapObject(exception, V8DebuggerAgentImpl
::backtraceObjectGroup); | 1504 auto obj = injectedScript->wrapObject(exception, V8DebuggerAgentImpl
::backtraceObjectGroup); |
1505 m_breakAuxData = obj ? obj->serialize() : nullptr; | 1505 m_breakAuxData = obj ? obj->serialize() : nullptr; |
1506 // m_breakAuxData might be null after this. | 1506 // m_breakAuxData might be null after this. |
1507 } | 1507 } |
1508 } else if (m_pausingOnAsyncOperation) { | 1508 } else if (m_pausingOnAsyncOperation) { |
1509 m_breakReason = protocol::Debugger::Paused::ReasonEnum::AsyncOperation; | 1509 m_breakReason = protocol::Debugger::Paused::ReasonEnum::AsyncOperation; |
1510 m_breakAuxData = JSONObject::create(); | 1510 m_breakAuxData = protocol::DictionaryValue::create(); |
1511 m_breakAuxData->setNumber("operationId", m_currentAsyncOperationId); | 1511 m_breakAuxData->setNumber("operationId", m_currentAsyncOperationId); |
1512 } | 1512 } |
1513 | 1513 |
1514 OwnPtr<Array<String>> hitBreakpointIds = Array<String>::create(); | 1514 OwnPtr<Array<String>> hitBreakpointIds = Array<String>::create(); |
1515 | 1515 |
1516 for (const auto& point : hitBreakpoints) { | 1516 for (const auto& point : hitBreakpoints) { |
1517 DebugServerBreakpointToBreakpointIdAndSourceMap::iterator breakpointIter
ator = m_serverBreakpoints.find(point); | 1517 DebugServerBreakpointToBreakpointIdAndSourceMap::iterator breakpointIter
ator = m_serverBreakpoints.find(point); |
1518 if (breakpointIterator != m_serverBreakpoints.end()) { | 1518 if (breakpointIterator != m_serverBreakpoints.end()) { |
1519 const String& localId = breakpointIterator->value.first; | 1519 const String& localId = breakpointIterator->value.first; |
1520 hitBreakpointIds->addItem(localId); | 1520 hitBreakpointIds->addItem(localId); |
(...skipping 29 matching lines...) Expand all Loading... |
1550 m_currentCallStack.Reset(); | 1550 m_currentCallStack.Reset(); |
1551 clearBreakDetails(); | 1551 clearBreakDetails(); |
1552 m_frontend->resumed(); | 1552 m_frontend->resumed(); |
1553 } | 1553 } |
1554 | 1554 |
1555 bool V8DebuggerAgentImpl::canBreakProgram() | 1555 bool V8DebuggerAgentImpl::canBreakProgram() |
1556 { | 1556 { |
1557 return debugger().canBreakProgram(); | 1557 return debugger().canBreakProgram(); |
1558 } | 1558 } |
1559 | 1559 |
1560 void V8DebuggerAgentImpl::breakProgram(const String& breakReason, PassRefPtr<JSO
NObject> data) | 1560 void V8DebuggerAgentImpl::breakProgram(const String& breakReason, PassRefPtr<pro
tocol::DictionaryValue> data) |
1561 { | 1561 { |
1562 ASSERT(enabled()); | 1562 ASSERT(enabled()); |
1563 if (m_skipAllPauses || !m_pausedContext.IsEmpty() || isCallStackEmptyOrBlack
boxed()) | 1563 if (m_skipAllPauses || !m_pausedContext.IsEmpty() || isCallStackEmptyOrBlack
boxed()) |
1564 return; | 1564 return; |
1565 m_breakReason = breakReason; | 1565 m_breakReason = breakReason; |
1566 m_breakAuxData = data; | 1566 m_breakAuxData = data; |
1567 m_scheduledDebuggerStep = NoStep; | 1567 m_scheduledDebuggerStep = NoStep; |
1568 m_steppingFromFramework = false; | 1568 m_steppingFromFramework = false; |
1569 m_pausingOnNativeEvent = false; | 1569 m_pausingOnNativeEvent = false; |
1570 clearStepIntoAsync(); | 1570 clearStepIntoAsync(); |
1571 debugger().breakProgram(); | 1571 debugger().breakProgram(); |
1572 } | 1572 } |
1573 | 1573 |
1574 void V8DebuggerAgentImpl::breakProgramOnException(const String& breakReason, Pas
sRefPtr<JSONObject> data) | 1574 void V8DebuggerAgentImpl::breakProgramOnException(const String& breakReason, Pas
sRefPtr<protocol::DictionaryValue> data) |
1575 { | 1575 { |
1576 if (m_debugger->pauseOnExceptionsState() == V8DebuggerImpl::DontPauseOnExcep
tions) | 1576 if (m_debugger->pauseOnExceptionsState() == V8DebuggerImpl::DontPauseOnExcep
tions) |
1577 return; | 1577 return; |
1578 breakProgram(breakReason, data); | 1578 breakProgram(breakReason, data); |
1579 } | 1579 } |
1580 | 1580 |
1581 void V8DebuggerAgentImpl::clearStepIntoAsync() | 1581 void V8DebuggerAgentImpl::clearStepIntoAsync() |
1582 { | 1582 { |
1583 m_startingStepIntoAsync = false; | 1583 m_startingStepIntoAsync = false; |
1584 m_pausingOnAsyncOperation = false; | 1584 m_pausingOnAsyncOperation = false; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1618 m_scripts.clear(); | 1618 m_scripts.clear(); |
1619 m_blackboxedPositions.clear(); | 1619 m_blackboxedPositions.clear(); |
1620 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1620 m_breakpointIdToDebuggerBreakpointIds.clear(); |
1621 resetAsyncCallTracker(); | 1621 resetAsyncCallTracker(); |
1622 m_promiseTracker->clear(); | 1622 m_promiseTracker->clear(); |
1623 if (m_frontend) | 1623 if (m_frontend) |
1624 m_frontend->globalObjectCleared(); | 1624 m_frontend->globalObjectCleared(); |
1625 } | 1625 } |
1626 | 1626 |
1627 } // namespace blink | 1627 } // namespace blink |
OLD | NEW |