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')) { | 414 if (Runtime.experiments.isEnabled('emptySourceMapAutoStepping') && this._b
eforePausedCallback) { |
415 if (this.dispatchEventToListeners(SDK.DebuggerModel.Events.BeforeDebugge
rPaused, this._debuggerPausedDetails)) | 415 if (!this._beforePausedCallback.call(null, 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 /** |
428 * @param {!Array.<!Protocol.Debugger.CallFrame>} callFrames | 435 * @param {!Array.<!Protocol.Debugger.CallFrame>} callFrames |
429 * @param {string} reason | 436 * @param {string} reason |
430 * @param {!Object|undefined} auxData | 437 * @param {!Object|undefined} auxData |
431 * @param {!Array.<string>} breakpointIds | 438 * @param {!Array.<string>} breakpointIds |
432 * @param {!Protocol.Runtime.StackTrace=} asyncStackTrace | 439 * @param {!Protocol.Runtime.StackTrace=} asyncStackTrace |
433 */ | 440 */ |
434 _pausedScript(callFrames, reason, auxData, breakpointIds, asyncStackTrace) { | 441 _pausedScript(callFrames, reason, auxData, breakpointIds, asyncStackTrace) { |
435 var pausedDetails = | 442 var pausedDetails = |
436 new SDK.DebuggerPausedDetails(this, callFrames, reason, auxData, breakpo
intIds, asyncStackTrace); | 443 new SDK.DebuggerPausedDetails(this, callFrames, reason, auxData, breakpo
intIds, asyncStackTrace); |
437 if (!this._setDebuggerPausedDetails(pausedDetails)) | 444 if (!this._setDebuggerPausedDetails(pausedDetails)) |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 SDK.DebuggerModel.PauseOnExceptionsState = { | 807 SDK.DebuggerModel.PauseOnExceptionsState = { |
801 DontPauseOnExceptions: 'none', | 808 DontPauseOnExceptions: 'none', |
802 PauseOnAllExceptions: 'all', | 809 PauseOnAllExceptions: 'all', |
803 PauseOnUncaughtExceptions: 'uncaught' | 810 PauseOnUncaughtExceptions: 'uncaught' |
804 }; | 811 }; |
805 | 812 |
806 /** @enum {symbol} */ | 813 /** @enum {symbol} */ |
807 SDK.DebuggerModel.Events = { | 814 SDK.DebuggerModel.Events = { |
808 DebuggerWasEnabled: Symbol('DebuggerWasEnabled'), | 815 DebuggerWasEnabled: Symbol('DebuggerWasEnabled'), |
809 DebuggerWasDisabled: Symbol('DebuggerWasDisabled'), | 816 DebuggerWasDisabled: Symbol('DebuggerWasDisabled'), |
810 BeforeDebuggerPaused: Symbol('BeforeDebuggerPaused'), | |
811 DebuggerPaused: Symbol('DebuggerPaused'), | 817 DebuggerPaused: Symbol('DebuggerPaused'), |
812 DebuggerResumed: Symbol('DebuggerResumed'), | 818 DebuggerResumed: Symbol('DebuggerResumed'), |
813 ParsedScriptSource: Symbol('ParsedScriptSource'), | 819 ParsedScriptSource: Symbol('ParsedScriptSource'), |
814 FailedToParseScriptSource: Symbol('FailedToParseScriptSource'), | 820 FailedToParseScriptSource: Symbol('FailedToParseScriptSource'), |
815 GlobalObjectCleared: Symbol('GlobalObjectCleared'), | 821 GlobalObjectCleared: Symbol('GlobalObjectCleared'), |
816 CallFrameSelected: Symbol('CallFrameSelected'), | 822 CallFrameSelected: Symbol('CallFrameSelected'), |
817 ConsoleCommandEvaluatedInSelectedCallFrame: Symbol('ConsoleCommandEvaluatedInS
electedCallFrame') | 823 ConsoleCommandEvaluatedInSelectedCallFrame: Symbol('ConsoleCommandEvaluatedInS
electedCallFrame') |
818 }; | 824 }; |
819 | 825 |
820 /** @enum {string} */ | 826 /** @enum {string} */ |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1307 stack.callFrames.shift(); | 1313 stack.callFrames.shift(); |
1308 if (previous && !stack.callFrames.length) | 1314 if (previous && !stack.callFrames.length) |
1309 previous.parent = stack.parent; | 1315 previous.parent = stack.parent; |
1310 else | 1316 else |
1311 previous = stack; | 1317 previous = stack; |
1312 stack = stack.parent; | 1318 stack = stack.parent; |
1313 } | 1319 } |
1314 return asyncStackTrace; | 1320 return asyncStackTrace; |
1315 } | 1321 } |
1316 }; | 1322 }; |
OLD | NEW |