Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js

Issue 2484283004: [DevTools] added BreakpointManager.possibleBreakpoints method (Closed)
Patch Set: rebased tests Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
*/

Powered by Google App Engine
This is Rietveld 408576698