| 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); | |
| 60 | 59 |
| 61 this.enableDebugger(); | 60 this.enableDebugger(); |
| 62 | 61 |
| 63 this._applySkipStackFrameSettings(); | 62 this._applySkipStackFrameSettings(); |
| 64 } | 63 } |
| 65 | 64 |
| 66 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, sourceURL: ?strin
g, functionName: string, scopeChain: (Array.<!DebuggerAgent.Scope>|null)}} */ | 65 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, sourceURL: ?strin
g, functionName: string, scopeChain: (Array.<!DebuggerAgent.Scope>|null)}} */ |
| 67 WebInspector.DebuggerModel.FunctionDetails; | 66 WebInspector.DebuggerModel.FunctionDetails; |
| 68 | 67 |
| 69 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, sourceURL: ?strin
g, functionName: string, status: string}} */ | 68 /** @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... |
| 197 | 196 |
| 198 asyncStackTracesStateChanged: function() | 197 asyncStackTracesStateChanged: function() |
| 199 { | 198 { |
| 200 const maxAsyncStackChainDepth = 4; | 199 const maxAsyncStackChainDepth = 4; |
| 201 var enabled = WebInspector.settings.enableAsyncStackTraces.get() && !Web
Inspector.targetManager.allTargetsSuspended(); | 200 var enabled = WebInspector.settings.enableAsyncStackTraces.get() && !Web
Inspector.targetManager.allTargetsSuspended(); |
| 202 this._agent.setAsyncCallStackDepth(enabled ? maxAsyncStackChainDepth : 0
); | 201 this._agent.setAsyncCallStackDepth(enabled ? maxAsyncStackChainDepth : 0
); |
| 203 }, | 202 }, |
| 204 | 203 |
| 205 stepInto: function() | 204 stepInto: function() |
| 206 { | 205 { |
| 207 /** | 206 this._agent.stepInto(); |
| 208 * @this {WebInspector.DebuggerModel} | |
| 209 */ | |
| 210 function callback() | |
| 211 { | |
| 212 this._agent.stepInto(); | |
| 213 } | |
| 214 this._setOverlayMessage(undefined).then(callback.bind(this)); | |
| 215 }, | 207 }, |
| 216 | 208 |
| 217 stepIntoAsync: function() | 209 stepIntoAsync: function() |
| 218 { | 210 { |
| 219 /** | 211 this._agent.stepIntoAsync(); |
| 220 * @this {WebInspector.DebuggerModel} | |
| 221 */ | |
| 222 function callback() | |
| 223 { | |
| 224 this._agent.stepIntoAsync(); | |
| 225 } | |
| 226 this._setOverlayMessage(undefined).then(callback.bind(this)); | |
| 227 }, | 212 }, |
| 228 | 213 |
| 229 stepOver: function() | 214 stepOver: function() |
| 230 { | 215 { |
| 231 /** | 216 this._agent.stepOver(); |
| 232 * @this {WebInspector.DebuggerModel} | |
| 233 */ | |
| 234 function callback() | |
| 235 { | |
| 236 this._agent.stepOver(); | |
| 237 } | |
| 238 this._setOverlayMessage(undefined).then(callback.bind(this)); | |
| 239 }, | 217 }, |
| 240 | 218 |
| 241 stepOut: function() | 219 stepOut: function() |
| 242 { | 220 { |
| 243 /** | 221 this._agent.stepOut(); |
| 244 * @this {WebInspector.DebuggerModel} | |
| 245 */ | |
| 246 function callback() | |
| 247 { | |
| 248 this._agent.stepOut(); | |
| 249 } | |
| 250 this._setOverlayMessage(undefined).then(callback.bind(this)); | |
| 251 }, | 222 }, |
| 252 | 223 |
| 253 resume: function() | 224 resume: function() |
| 254 { | 225 { |
| 255 /** | 226 this._agent.resume(); |
| 256 * @this {WebInspector.DebuggerModel} | |
| 257 */ | |
| 258 function callback() | |
| 259 { | |
| 260 this._agent.resume(); | |
| 261 } | |
| 262 this._setOverlayMessage(undefined).then(callback.bind(this)); | |
| 263 this._isPausing = false; | 227 this._isPausing = false; |
| 264 }, | 228 }, |
| 265 | 229 |
| 266 pause: function() | 230 pause: function() |
| 267 { | 231 { |
| 268 this._isPausing = true; | 232 this._isPausing = true; |
| 269 this.skipAllPauses(false); | 233 this.skipAllPauses(false); |
| 270 this._agent.pause(); | 234 this._agent.pause(); |
| 271 }, | 235 }, |
| 272 | 236 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 _setDebuggerPausedDetails: function(debuggerPausedDetails) | 442 _setDebuggerPausedDetails: function(debuggerPausedDetails) |
| 479 { | 443 { |
| 480 this._isPausing = false; | 444 this._isPausing = false; |
| 481 this._debuggerPausedDetails = debuggerPausedDetails; | 445 this._debuggerPausedDetails = debuggerPausedDetails; |
| 482 if (this._debuggerPausedDetails) | 446 if (this._debuggerPausedDetails) |
| 483 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Debu
ggerPaused, this._debuggerPausedDetails); | 447 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Debu
ggerPaused, this._debuggerPausedDetails); |
| 484 if (debuggerPausedDetails) | 448 if (debuggerPausedDetails) |
| 485 this.setSelectedCallFrame(debuggerPausedDetails.callFrames[0]); | 449 this.setSelectedCallFrame(debuggerPausedDetails.callFrames[0]); |
| 486 else | 450 else |
| 487 this.setSelectedCallFrame(null); | 451 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); | |
| 495 }, | 452 }, |
| 496 | 453 |
| 497 /** | 454 /** |
| 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 /** | |
| 520 * @param {!Array.<!DebuggerAgent.CallFrame>} callFrames | 455 * @param {!Array.<!DebuggerAgent.CallFrame>} callFrames |
| 521 * @param {string} reason | 456 * @param {string} reason |
| 522 * @param {!Object|undefined} auxData | 457 * @param {!Object|undefined} auxData |
| 523 * @param {!Array.<string>} breakpointIds | 458 * @param {!Array.<string>} breakpointIds |
| 524 * @param {!DebuggerAgent.StackTrace=} asyncStackTrace | 459 * @param {!DebuggerAgent.StackTrace=} asyncStackTrace |
| 525 */ | 460 */ |
| 526 _pausedScript: function(callFrames, reason, auxData, breakpointIds, asyncSta
ckTrace) | 461 _pausedScript: function(callFrames, reason, auxData, breakpointIds, asyncSta
ckTrace) |
| 527 { | 462 { |
| 528 this._setDebuggerPausedDetails(new WebInspector.DebuggerPausedDetails(th
is.target(), callFrames, reason, auxData, breakpointIds, asyncStackTrace)); | 463 this._setDebuggerPausedDetails(new WebInspector.DebuggerPausedDetails(th
is.target(), callFrames, reason, auxData, breakpointIds, asyncStackTrace)); |
| 529 if (this._pendingLiveEditCallback) { | 464 if (this._pendingLiveEditCallback) { |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1227 */ | 1162 */ |
| 1228 exception: function() | 1163 exception: function() |
| 1229 { | 1164 { |
| 1230 if (this.reason !== WebInspector.DebuggerModel.BreakReason.Exception &&
this.reason !== WebInspector.DebuggerModel.BreakReason.PromiseRejection) | 1165 if (this.reason !== WebInspector.DebuggerModel.BreakReason.Exception &&
this.reason !== WebInspector.DebuggerModel.BreakReason.PromiseRejection) |
| 1231 return null; | 1166 return null; |
| 1232 return this.target().runtimeModel.createRemoteObject(/** @type {!Runtime
Agent.RemoteObject} */(this.auxData)); | 1167 return this.target().runtimeModel.createRemoteObject(/** @type {!Runtime
Agent.RemoteObject} */(this.auxData)); |
| 1233 }, | 1168 }, |
| 1234 | 1169 |
| 1235 __proto__: WebInspector.SDKObject.prototype | 1170 __proto__: WebInspector.SDKObject.prototype |
| 1236 } | 1171 } |
| OLD | NEW |