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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 this._debuggerPausedDetails = null; | 44 this._debuggerPausedDetails = null; |
45 /** @type {!Object.<string, !WebInspector.Script>} */ | 45 /** @type {!Object.<string, !WebInspector.Script>} */ |
46 this._scripts = {}; | 46 this._scripts = {}; |
47 /** @type {!StringMap.<!Array.<!WebInspector.Script>>} */ | 47 /** @type {!StringMap.<!Array.<!WebInspector.Script>>} */ |
48 this._scriptsBySourceURL = new StringMap(); | 48 this._scriptsBySourceURL = new StringMap(); |
49 | 49 |
50 this._breakpointsActive = true; | 50 this._breakpointsActive = true; |
51 /** @type {!WebInspector.Object} */ | 51 /** @type {!WebInspector.Object} */ |
52 this._breakpointResolvedEventTarget = new WebInspector.Object(); | 52 this._breakpointResolvedEventTarget = new WebInspector.Object(); |
53 | 53 |
| 54 this._isPausing = false; |
54 WebInspector.settings.pauseOnExceptionEnabled.addChangeListener(this._pauseO
nExceptionStateChanged, this); | 55 WebInspector.settings.pauseOnExceptionEnabled.addChangeListener(this._pauseO
nExceptionStateChanged, this); |
55 WebInspector.settings.pauseOnCaughtException.addChangeListener(this._pauseOn
ExceptionStateChanged, this); | 56 WebInspector.settings.pauseOnCaughtException.addChangeListener(this._pauseOn
ExceptionStateChanged, this); |
56 | 57 |
57 WebInspector.settings.enableAsyncStackTraces.addChangeListener(this._asyncSt
ackTracesStateChanged, this); | 58 WebInspector.settings.enableAsyncStackTraces.addChangeListener(this._asyncSt
ackTracesStateChanged, this); |
58 target.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged,
this._profilingStateChanged, this); | 59 target.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged,
this._profilingStateChanged, this); |
59 | 60 |
60 this.enableDebugger(); | 61 this.enableDebugger(); |
61 | 62 |
62 WebInspector.settings.skipStackFramesSwitch.addChangeListener(this._applySki
pStackFrameSettings, this); | 63 WebInspector.settings.skipStackFramesSwitch.addChangeListener(this._applySki
pStackFrameSettings, this); |
63 WebInspector.settings.skipStackFramesPattern.addChangeListener(this._applySk
ipStackFrameSettings, this); | 64 WebInspector.settings.skipStackFramesPattern.addChangeListener(this._applySk
ipStackFrameSettings, this); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 _asyncStackTracesStateChanged: function() | 184 _asyncStackTracesStateChanged: function() |
184 { | 185 { |
185 const maxAsyncStackChainDepth = 4; | 186 const maxAsyncStackChainDepth = 4; |
186 var enabled = WebInspector.settings.enableAsyncStackTraces.get() && !thi
s.target().profilingLock.isAcquired(); | 187 var enabled = WebInspector.settings.enableAsyncStackTraces.get() && !thi
s.target().profilingLock.isAcquired(); |
187 this._agent.setAsyncCallStackDepth(enabled ? maxAsyncStackChainDepth : 0
); | 188 this._agent.setAsyncCallStackDepth(enabled ? maxAsyncStackChainDepth : 0
); |
188 }, | 189 }, |
189 | 190 |
190 _debuggerWasDisabled: function() | 191 _debuggerWasDisabled: function() |
191 { | 192 { |
192 this._debuggerEnabled = false; | 193 this._debuggerEnabled = false; |
| 194 this._isPausing = false; |
193 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Debugger
WasDisabled); | 195 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Debugger
WasDisabled); |
194 }, | 196 }, |
195 | 197 |
196 stepInto: function() | 198 stepInto: function() |
197 { | 199 { |
198 /** | 200 /** |
199 * @this {WebInspector.DebuggerModel} | 201 * @this {WebInspector.DebuggerModel} |
200 */ | 202 */ |
201 function callback() | 203 function callback() |
202 { | 204 { |
(...skipping 29 matching lines...) Expand all Loading... |
232 resume: function() | 234 resume: function() |
233 { | 235 { |
234 /** | 236 /** |
235 * @this {WebInspector.DebuggerModel} | 237 * @this {WebInspector.DebuggerModel} |
236 */ | 238 */ |
237 function callback() | 239 function callback() |
238 { | 240 { |
239 this._agent.resume(); | 241 this._agent.resume(); |
240 } | 242 } |
241 this._agent.setOverlayMessage(undefined, callback.bind(this)); | 243 this._agent.setOverlayMessage(undefined, callback.bind(this)); |
| 244 this._isPausing = false; |
| 245 }, |
| 246 |
| 247 pause: function() |
| 248 { |
| 249 this._isPausing = true; |
| 250 this.skipAllPauses(false); |
| 251 this._agent.pause(); |
242 }, | 252 }, |
243 | 253 |
244 /** | 254 /** |
245 * @param {!WebInspector.DebuggerModel.Location} rawLocation | 255 * @param {!WebInspector.DebuggerModel.Location} rawLocation |
246 * @param {string} condition | 256 * @param {string} condition |
247 * @param {function(?DebuggerAgent.BreakpointId, !Array.<!WebInspector.Debug
gerModel.Location>):void=} callback | 257 * @param {function(?DebuggerAgent.BreakpointId, !Array.<!WebInspector.Debug
gerModel.Location>):void=} callback |
248 */ | 258 */ |
249 setBreakpointByScriptLocation: function(rawLocation, condition, callback) | 259 setBreakpointByScriptLocation: function(rawLocation, condition, callback) |
250 { | 260 { |
251 var script = rawLocation.script(); | 261 var script = rawLocation.script(); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 debuggerPausedDetails: function() | 438 debuggerPausedDetails: function() |
429 { | 439 { |
430 return this._debuggerPausedDetails; | 440 return this._debuggerPausedDetails; |
431 }, | 441 }, |
432 | 442 |
433 /** | 443 /** |
434 * @param {?WebInspector.DebuggerPausedDetails} debuggerPausedDetails | 444 * @param {?WebInspector.DebuggerPausedDetails} debuggerPausedDetails |
435 */ | 445 */ |
436 _setDebuggerPausedDetails: function(debuggerPausedDetails) | 446 _setDebuggerPausedDetails: function(debuggerPausedDetails) |
437 { | 447 { |
| 448 this._isPausing = false; |
438 if (this._debuggerPausedDetails) | 449 if (this._debuggerPausedDetails) |
439 this._debuggerPausedDetails.dispose(); | 450 this._debuggerPausedDetails.dispose(); |
440 this._debuggerPausedDetails = debuggerPausedDetails; | 451 this._debuggerPausedDetails = debuggerPausedDetails; |
441 if (this._debuggerPausedDetails) | 452 if (this._debuggerPausedDetails) |
442 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Debu
ggerPaused, this._debuggerPausedDetails); | 453 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Debu
ggerPaused, this._debuggerPausedDetails); |
443 if (debuggerPausedDetails) { | 454 if (debuggerPausedDetails) { |
444 this.setSelectedCallFrame(debuggerPausedDetails.callFrames[0]); | 455 this.setSelectedCallFrame(debuggerPausedDetails.callFrames[0]); |
445 this._agent.setOverlayMessage(WebInspector.UIString("Paused in debug
ger")); | 456 this._agent.setOverlayMessage(WebInspector.UIString("Paused in debug
ger")); |
446 } else { | 457 } else { |
447 this.setSelectedCallFrame(null); | 458 this.setSelectedCallFrame(null); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 | 552 |
542 /** | 553 /** |
543 * @return {boolean} | 554 * @return {boolean} |
544 */ | 555 */ |
545 isPaused: function() | 556 isPaused: function() |
546 { | 557 { |
547 return !!this.debuggerPausedDetails(); | 558 return !!this.debuggerPausedDetails(); |
548 }, | 559 }, |
549 | 560 |
550 /** | 561 /** |
| 562 * @return {boolean} |
| 563 */ |
| 564 isPausing: function() |
| 565 { |
| 566 return this._isPausing; |
| 567 }, |
| 568 |
| 569 /** |
551 * @param {?WebInspector.DebuggerModel.CallFrame} callFrame | 570 * @param {?WebInspector.DebuggerModel.CallFrame} callFrame |
552 */ | 571 */ |
553 setSelectedCallFrame: function(callFrame) | 572 setSelectedCallFrame: function(callFrame) |
554 { | 573 { |
555 this._selectedCallFrame = callFrame; | 574 this._selectedCallFrame = callFrame; |
556 if (!this._selectedCallFrame) | 575 if (!this._selectedCallFrame) |
557 return; | 576 return; |
558 | 577 |
559 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.CallFram
eSelected, callFrame); | 578 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.CallFram
eSelected, callFrame); |
560 }, | 579 }, |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 this.asyncStackTrace.dispose(); | 1182 this.asyncStackTrace.dispose(); |
1164 }, | 1183 }, |
1165 | 1184 |
1166 __proto__: WebInspector.TargetAware.prototype | 1185 __proto__: WebInspector.TargetAware.prototype |
1167 } | 1186 } |
1168 | 1187 |
1169 /** | 1188 /** |
1170 * @type {!WebInspector.DebuggerModel} | 1189 * @type {!WebInspector.DebuggerModel} |
1171 */ | 1190 */ |
1172 WebInspector.debuggerModel; | 1191 WebInspector.debuggerModel; |
OLD | NEW |