Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js |
| index 45bf9ed1377780f64d391860aa04d41d25501496..6ab69e1f2e300031e88ab710be73c039cb6aa35f 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js |
| @@ -280,6 +280,32 @@ WebInspector.DebuggerModel = class extends WebInspector.SDKModel { |
| } |
| /** |
| + * @param {!WebInspector.DebuggerModel.Location} startLocation |
| + * @param {!WebInspector.DebuggerModel.Location} endLocation |
| + * @return {!Promise<!Array<!WebInspector.DebuggerModel.Location>>} |
| + */ |
| + getPossibleBreakpoints(startLocation, endLocation) { |
| + var resolveCallback; |
|
dgozman
2016/11/09 20:44:03
fulfill
kozy
2016/11/10 03:17:36
Done.
|
| + var promise = new Promise(resolve => resolveCallback = resolve); |
| + this._agent.getPossibleBreakpoints(startLocation.payload(), endLocation.payload(), checkErrorAndReturn.bind(this)); |
| + return promise; |
| + |
| + /** |
| + * @this {!WebInspector.DebuggerModel} |
| + * @param {?Protocol.Error} error |
| + * @param {?Array<!Protocol.Debugger.Location>} locations |
| + */ |
| + function checkErrorAndReturn(error, locations) { |
| + if (error || !locations) { |
| + console.error('Failed to get possible breakpoints: ' + (error || 'empty output locations')); |
|
dgozman
2016/11/09 20:44:03
Don't spam the console. I expect this to happen fr
kozy
2016/11/10 03:17:36
Done.
|
| + resolveCallback([]); |
| + return; |
| + } |
| + resolveCallback(locations.map(location => WebInspector.DebuggerModel.Location.fromPayload(this, location))); |
| + } |
| + } |
| + |
| + /** |
| * @param {!Protocol.Debugger.BreakpointId} breakpointId |
| * @param {!Protocol.Debugger.Location} location |
| */ |