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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 /** @type {!WebInspector.Object} */ | 50 /** @type {!WebInspector.Object} */ |
51 this._breakpointResolvedEventTarget = new WebInspector.Object(); | 51 this._breakpointResolvedEventTarget = new WebInspector.Object(); |
52 | 52 |
53 this._isPausing = false; | 53 this._isPausing = false; |
54 WebInspector.settings.pauseOnExceptionEnabled.addChangeListener(this._pauseO
nExceptionStateChanged, this); | 54 WebInspector.settings.pauseOnExceptionEnabled.addChangeListener(this._pauseO
nExceptionStateChanged, this); |
55 WebInspector.settings.pauseOnCaughtException.addChangeListener(this._pauseOn
ExceptionStateChanged, this); | 55 WebInspector.settings.pauseOnCaughtException.addChangeListener(this._pauseOn
ExceptionStateChanged, this); |
56 WebInspector.settings.enableAsyncStackTraces.addChangeListener(this.asyncSta
ckTracesStateChanged, this); | 56 WebInspector.settings.enableAsyncStackTraces.addChangeListener(this.asyncSta
ckTracesStateChanged, this); |
57 WebInspector.settings.skipStackFramesPattern.addChangeListener(this._applySk
ipStackFrameSettings, this); | 57 WebInspector.settings.skipStackFramesPattern.addChangeListener(this._applySk
ipStackFrameSettings, this); |
58 WebInspector.settings.skipContentScripts.addChangeListener(this._applySkipSt
ackFrameSettings, this); | 58 WebInspector.settings.skipContentScripts.addChangeListener(this._applySkipSt
ackFrameSettings, this); |
| 59 WebInspector.settings.disablePausedStateOverlay.addChangeListener(this._upda
teOverlayMessage, this); |
59 | 60 |
60 this.enableDebugger(); | 61 this.enableDebugger(); |
61 | 62 |
62 this._applySkipStackFrameSettings(); | 63 this._applySkipStackFrameSettings(); |
63 } | 64 } |
64 | 65 |
65 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, sourceURL: ?strin
g, functionName: string, scopeChain: (Array.<!DebuggerAgent.Scope>|null)}} */ | 66 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, sourceURL: ?strin
g, functionName: string, scopeChain: (Array.<!DebuggerAgent.Scope>|null)}} */ |
66 WebInspector.DebuggerModel.FunctionDetails; | 67 WebInspector.DebuggerModel.FunctionDetails; |
67 | 68 |
68 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, sourceURL: ?strin
g, functionName: string, status: string}} */ | 69 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, sourceURL: ?strin
g, functionName: string, status: string}} */ |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 197 |
197 asyncStackTracesStateChanged: function() | 198 asyncStackTracesStateChanged: function() |
198 { | 199 { |
199 const maxAsyncStackChainDepth = 4; | 200 const maxAsyncStackChainDepth = 4; |
200 var enabled = WebInspector.settings.enableAsyncStackTraces.get() && !Web
Inspector.targetManager.allTargetsSuspended(); | 201 var enabled = WebInspector.settings.enableAsyncStackTraces.get() && !Web
Inspector.targetManager.allTargetsSuspended(); |
201 this._agent.setAsyncCallStackDepth(enabled ? maxAsyncStackChainDepth : 0
); | 202 this._agent.setAsyncCallStackDepth(enabled ? maxAsyncStackChainDepth : 0
); |
202 }, | 203 }, |
203 | 204 |
204 stepInto: function() | 205 stepInto: function() |
205 { | 206 { |
206 this._agent.stepInto(); | 207 /** |
| 208 * @this {WebInspector.DebuggerModel} |
| 209 */ |
| 210 function callback() |
| 211 { |
| 212 this._agent.stepInto(); |
| 213 } |
| 214 this._setOverlayMessage(undefined).then(callback.bind(this)); |
207 }, | 215 }, |
208 | 216 |
209 stepIntoAsync: function() | 217 stepIntoAsync: function() |
210 { | 218 { |
211 this._agent.stepIntoAsync(); | 219 /** |
| 220 * @this {WebInspector.DebuggerModel} |
| 221 */ |
| 222 function callback() |
| 223 { |
| 224 this._agent.stepIntoAsync(); |
| 225 } |
| 226 this._setOverlayMessage(undefined).then(callback.bind(this)); |
212 }, | 227 }, |
213 | 228 |
214 stepOver: function() | 229 stepOver: function() |
215 { | 230 { |
216 this._agent.stepOver(); | 231 /** |
| 232 * @this {WebInspector.DebuggerModel} |
| 233 */ |
| 234 function callback() |
| 235 { |
| 236 this._agent.stepOver(); |
| 237 } |
| 238 this._setOverlayMessage(undefined).then(callback.bind(this)); |
217 }, | 239 }, |
218 | 240 |
219 stepOut: function() | 241 stepOut: function() |
220 { | 242 { |
221 this._agent.stepOut(); | 243 /** |
| 244 * @this {WebInspector.DebuggerModel} |
| 245 */ |
| 246 function callback() |
| 247 { |
| 248 this._agent.stepOut(); |
| 249 } |
| 250 this._setOverlayMessage(undefined).then(callback.bind(this)); |
222 }, | 251 }, |
223 | 252 |
224 resume: function() | 253 resume: function() |
225 { | 254 { |
226 this._agent.resume(); | 255 /** |
| 256 * @this {WebInspector.DebuggerModel} |
| 257 */ |
| 258 function callback() |
| 259 { |
| 260 this._agent.resume(); |
| 261 } |
| 262 this._setOverlayMessage(undefined).then(callback.bind(this)); |
227 this._isPausing = false; | 263 this._isPausing = false; |
228 }, | 264 }, |
229 | 265 |
230 pause: function() | 266 pause: function() |
231 { | 267 { |
232 this._isPausing = true; | 268 this._isPausing = true; |
233 this.skipAllPauses(false); | 269 this.skipAllPauses(false); |
234 this._agent.pause(); | 270 this._agent.pause(); |
235 }, | 271 }, |
236 | 272 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 _setDebuggerPausedDetails: function(debuggerPausedDetails) | 478 _setDebuggerPausedDetails: function(debuggerPausedDetails) |
443 { | 479 { |
444 this._isPausing = false; | 480 this._isPausing = false; |
445 this._debuggerPausedDetails = debuggerPausedDetails; | 481 this._debuggerPausedDetails = debuggerPausedDetails; |
446 if (this._debuggerPausedDetails) | 482 if (this._debuggerPausedDetails) |
447 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Debu
ggerPaused, this._debuggerPausedDetails); | 483 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Debu
ggerPaused, this._debuggerPausedDetails); |
448 if (debuggerPausedDetails) | 484 if (debuggerPausedDetails) |
449 this.setSelectedCallFrame(debuggerPausedDetails.callFrames[0]); | 485 this.setSelectedCallFrame(debuggerPausedDetails.callFrames[0]); |
450 else | 486 else |
451 this.setSelectedCallFrame(null); | 487 this.setSelectedCallFrame(null); |
| 488 this._updateOverlayMessage(); |
| 489 }, |
| 490 |
| 491 _updateOverlayMessage: function() |
| 492 { |
| 493 var message = this._debuggerPausedDetails && !WebInspector.settings.disa
blePausedStateOverlay.get() ? WebInspector.UIString("Paused in debugger") : unde
fined; |
| 494 this._setOverlayMessage(message); |
452 }, | 495 }, |
453 | 496 |
454 /** | 497 /** |
| 498 * @param {string=} message |
| 499 * @return {!Promise.<undefined>} |
| 500 */ |
| 501 _setOverlayMessage: function(message) |
| 502 { |
| 503 /** |
| 504 * @param {function(?):?} fulfill |
| 505 * @param {function(*):?} reject |
| 506 * @this {WebInspector.DebuggerModel} |
| 507 */ |
| 508 function setOverlayMessagePromiseCallback(fulfill, reject) |
| 509 { |
| 510 var pageAgent = this.target().pageAgent(); |
| 511 if (pageAgent) |
| 512 pageAgent.setOverlayMessage(message, fulfill); |
| 513 else |
| 514 fulfill(undefined); |
| 515 } |
| 516 return new Promise(setOverlayMessagePromiseCallback.bind(this)); |
| 517 }, |
| 518 |
| 519 /** |
455 * @param {!Array.<!DebuggerAgent.CallFrame>} callFrames | 520 * @param {!Array.<!DebuggerAgent.CallFrame>} callFrames |
456 * @param {string} reason | 521 * @param {string} reason |
457 * @param {!Object|undefined} auxData | 522 * @param {!Object|undefined} auxData |
458 * @param {!Array.<string>} breakpointIds | 523 * @param {!Array.<string>} breakpointIds |
459 * @param {!DebuggerAgent.StackTrace=} asyncStackTrace | 524 * @param {!DebuggerAgent.StackTrace=} asyncStackTrace |
460 */ | 525 */ |
461 _pausedScript: function(callFrames, reason, auxData, breakpointIds, asyncSta
ckTrace) | 526 _pausedScript: function(callFrames, reason, auxData, breakpointIds, asyncSta
ckTrace) |
462 { | 527 { |
463 this._setDebuggerPausedDetails(new WebInspector.DebuggerPausedDetails(th
is.target(), callFrames, reason, auxData, breakpointIds, asyncStackTrace)); | 528 this._setDebuggerPausedDetails(new WebInspector.DebuggerPausedDetails(th
is.target(), callFrames, reason, auxData, breakpointIds, asyncStackTrace)); |
464 if (this._pendingLiveEditCallback) { | 529 if (this._pendingLiveEditCallback) { |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1162 */ | 1227 */ |
1163 exception: function() | 1228 exception: function() |
1164 { | 1229 { |
1165 if (this.reason !== WebInspector.DebuggerModel.BreakReason.Exception &&
this.reason !== WebInspector.DebuggerModel.BreakReason.PromiseRejection) | 1230 if (this.reason !== WebInspector.DebuggerModel.BreakReason.Exception &&
this.reason !== WebInspector.DebuggerModel.BreakReason.PromiseRejection) |
1166 return null; | 1231 return null; |
1167 return this.target().runtimeModel.createRemoteObject(/** @type {!Runtime
Agent.RemoteObject} */(this.auxData)); | 1232 return this.target().runtimeModel.createRemoteObject(/** @type {!Runtime
Agent.RemoteObject} */(this.auxData)); |
1168 }, | 1233 }, |
1169 | 1234 |
1170 __proto__: WebInspector.SDKObject.prototype | 1235 __proto__: WebInspector.SDKObject.prototype |
1171 } | 1236 } |
OLD | NEW |