| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 */ | 273 */ |
| 274 function innerCallback(error) { | 274 function innerCallback(error) { |
| 275 if (error) | 275 if (error) |
| 276 console.error('Failed to remove breakpoint: ' + error); | 276 console.error('Failed to remove breakpoint: ' + error); |
| 277 if (callback) | 277 if (callback) |
| 278 callback(); | 278 callback(); |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 | 281 |
| 282 /** | 282 /** |
| 283 * @param {!WebInspector.DebuggerModel.Location} startLocation |
| 284 * @param {!WebInspector.DebuggerModel.Location} endLocation |
| 285 * @return {!Promise<!Array<!WebInspector.DebuggerModel.Location>>} |
| 286 */ |
| 287 getPossibleBreakpoints(startLocation, endLocation) { |
| 288 var fulfill; |
| 289 var promise = new Promise(resolve => fulfill = resolve); |
| 290 this._agent.getPossibleBreakpoints(startLocation.payload(), endLocation.payl
oad(), checkErrorAndReturn.bind(this)); |
| 291 return promise; |
| 292 |
| 293 /** |
| 294 * @this {!WebInspector.DebuggerModel} |
| 295 * @param {?Protocol.Error} error |
| 296 * @param {?Array<!Protocol.Debugger.Location>} locations |
| 297 */ |
| 298 function checkErrorAndReturn(error, locations) { |
| 299 if (error || !locations) { |
| 300 fulfill([]); |
| 301 return; |
| 302 } |
| 303 fulfill(locations.map(location => WebInspector.DebuggerModel.Location.from
Payload(this, location))); |
| 304 } |
| 305 } |
| 306 |
| 307 /** |
| 283 * @param {!Protocol.Debugger.BreakpointId} breakpointId | 308 * @param {!Protocol.Debugger.BreakpointId} breakpointId |
| 284 * @param {!Protocol.Debugger.Location} location | 309 * @param {!Protocol.Debugger.Location} location |
| 285 */ | 310 */ |
| 286 _breakpointResolved(breakpointId, location) { | 311 _breakpointResolved(breakpointId, location) { |
| 287 this._breakpointResolvedEventTarget.dispatchEventToListeners( | 312 this._breakpointResolvedEventTarget.dispatchEventToListeners( |
| 288 breakpointId, WebInspector.DebuggerModel.Location.fromPayload(this, loca
tion)); | 313 breakpointId, WebInspector.DebuggerModel.Location.fromPayload(this, loca
tion)); |
| 289 } | 314 } |
| 290 | 315 |
| 291 globalObjectCleared() { | 316 globalObjectCleared() { |
| 292 this._setDebuggerPausedDetails(null); | 317 this._setDebuggerPausedDetails(null); |
| (...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 stack.callFrames.shift(); | 1314 stack.callFrames.shift(); |
| 1290 if (previous && !stack.callFrames.length) | 1315 if (previous && !stack.callFrames.length) |
| 1291 previous.parent = stack.parent; | 1316 previous.parent = stack.parent; |
| 1292 else | 1317 else |
| 1293 previous = stack; | 1318 previous = stack; |
| 1294 stack = stack.parent; | 1319 stack = stack.parent; |
| 1295 } | 1320 } |
| 1296 return asyncStackTrace; | 1321 return asyncStackTrace; |
| 1297 } | 1322 } |
| 1298 }; | 1323 }; |
| OLD | NEW |