OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 } | 404 } |
405 | 405 |
406 /** | 406 /** |
407 * @param {?SDK.DebuggerPausedDetails} debuggerPausedDetails | 407 * @param {?SDK.DebuggerPausedDetails} debuggerPausedDetails |
408 * @return {boolean} | 408 * @return {boolean} |
409 */ | 409 */ |
410 _setDebuggerPausedDetails(debuggerPausedDetails) { | 410 _setDebuggerPausedDetails(debuggerPausedDetails) { |
411 this._isPausing = false; | 411 this._isPausing = false; |
412 this._debuggerPausedDetails = debuggerPausedDetails; | 412 this._debuggerPausedDetails = debuggerPausedDetails; |
413 if (this._debuggerPausedDetails) { | 413 if (this._debuggerPausedDetails) { |
414 if (Runtime.experiments.isEnabled('emptySourceMapAutoStepping') && this._b
eforePausedCallback) { | 414 if (Runtime.experiments.isEnabled('emptySourceMapAutoStepping')) { |
415 if (!this._beforePausedCallback.call(null, this._debuggerPausedDetails)) | 415 if (this.dispatchEventToListeners(SDK.DebuggerModel.Events.BeforeDebugge
rPaused, this._debuggerPausedDetails)) |
416 return false; | 416 return false; |
417 } | 417 } |
418 this.dispatchEventToListeners(SDK.DebuggerModel.Events.DebuggerPaused, thi
s._debuggerPausedDetails); | 418 this.dispatchEventToListeners(SDK.DebuggerModel.Events.DebuggerPaused, thi
s._debuggerPausedDetails); |
419 } | 419 } |
420 if (debuggerPausedDetails) | 420 if (debuggerPausedDetails) |
421 this.setSelectedCallFrame(debuggerPausedDetails.callFrames[0]); | 421 this.setSelectedCallFrame(debuggerPausedDetails.callFrames[0]); |
422 else | 422 else |
423 this.setSelectedCallFrame(null); | 423 this.setSelectedCallFrame(null); |
424 return true; | 424 return true; |
425 } | 425 } |
426 | 426 |
427 /** | 427 /** |
428 * @param {?function(!SDK.DebuggerPausedDetails):boolean} callback | |
429 */ | |
430 setBeforePausedCallback(callback) { | |
431 this._beforePausedCallback = callback; | |
432 } | |
433 | |
434 /** | |
435 * @param {!Array.<!Protocol.Debugger.CallFrame>} callFrames | 428 * @param {!Array.<!Protocol.Debugger.CallFrame>} callFrames |
436 * @param {string} reason | 429 * @param {string} reason |
437 * @param {!Object|undefined} auxData | 430 * @param {!Object|undefined} auxData |
438 * @param {!Array.<string>} breakpointIds | 431 * @param {!Array.<string>} breakpointIds |
439 * @param {!Protocol.Runtime.StackTrace=} asyncStackTrace | 432 * @param {!Protocol.Runtime.StackTrace=} asyncStackTrace |
440 */ | 433 */ |
441 _pausedScript(callFrames, reason, auxData, breakpointIds, asyncStackTrace) { | 434 _pausedScript(callFrames, reason, auxData, breakpointIds, asyncStackTrace) { |
442 var pausedDetails = | 435 var pausedDetails = |
443 new SDK.DebuggerPausedDetails(this, callFrames, reason, auxData, breakpo
intIds, asyncStackTrace); | 436 new SDK.DebuggerPausedDetails(this, callFrames, reason, auxData, breakpo
intIds, asyncStackTrace); |
444 if (!this._setDebuggerPausedDetails(pausedDetails)) | 437 if (!this._setDebuggerPausedDetails(pausedDetails)) |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 SDK.DebuggerModel.PauseOnExceptionsState = { | 800 SDK.DebuggerModel.PauseOnExceptionsState = { |
808 DontPauseOnExceptions: 'none', | 801 DontPauseOnExceptions: 'none', |
809 PauseOnAllExceptions: 'all', | 802 PauseOnAllExceptions: 'all', |
810 PauseOnUncaughtExceptions: 'uncaught' | 803 PauseOnUncaughtExceptions: 'uncaught' |
811 }; | 804 }; |
812 | 805 |
813 /** @enum {symbol} */ | 806 /** @enum {symbol} */ |
814 SDK.DebuggerModel.Events = { | 807 SDK.DebuggerModel.Events = { |
815 DebuggerWasEnabled: Symbol('DebuggerWasEnabled'), | 808 DebuggerWasEnabled: Symbol('DebuggerWasEnabled'), |
816 DebuggerWasDisabled: Symbol('DebuggerWasDisabled'), | 809 DebuggerWasDisabled: Symbol('DebuggerWasDisabled'), |
| 810 BeforeDebuggerPaused: Symbol('BeforeDebuggerPaused'), |
817 DebuggerPaused: Symbol('DebuggerPaused'), | 811 DebuggerPaused: Symbol('DebuggerPaused'), |
818 DebuggerResumed: Symbol('DebuggerResumed'), | 812 DebuggerResumed: Symbol('DebuggerResumed'), |
819 ParsedScriptSource: Symbol('ParsedScriptSource'), | 813 ParsedScriptSource: Symbol('ParsedScriptSource'), |
820 FailedToParseScriptSource: Symbol('FailedToParseScriptSource'), | 814 FailedToParseScriptSource: Symbol('FailedToParseScriptSource'), |
821 GlobalObjectCleared: Symbol('GlobalObjectCleared'), | 815 GlobalObjectCleared: Symbol('GlobalObjectCleared'), |
822 CallFrameSelected: Symbol('CallFrameSelected'), | 816 CallFrameSelected: Symbol('CallFrameSelected'), |
823 ConsoleCommandEvaluatedInSelectedCallFrame: Symbol('ConsoleCommandEvaluatedInS
electedCallFrame') | 817 ConsoleCommandEvaluatedInSelectedCallFrame: Symbol('ConsoleCommandEvaluatedInS
electedCallFrame') |
824 }; | 818 }; |
825 | 819 |
826 /** @enum {string} */ | 820 /** @enum {string} */ |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1313 stack.callFrames.shift(); | 1307 stack.callFrames.shift(); |
1314 if (previous && !stack.callFrames.length) | 1308 if (previous && !stack.callFrames.length) |
1315 previous.parent = stack.parent; | 1309 previous.parent = stack.parent; |
1316 else | 1310 else |
1317 previous = stack; | 1311 previous = stack; |
1318 stack = stack.parent; | 1312 stack = stack.parent; |
1319 } | 1313 } |
1320 return asyncStackTrace; | 1314 return asyncStackTrace; |
1321 } | 1315 } |
1322 }; | 1316 }; |
OLD | NEW |