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

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

Issue 2484283004: [DevTools] added BreakpointManager.possibleBreakpoints method (Closed)
Patch Set: addressed comments 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..98854514db235b85bb0e9dc5c084a4e69ce04ac0 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,31 @@ 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 fulfill;
+ var promise = new Promise(resolve => fulfill = 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) {
+ fulfill([]);
+ return;
+ }
+ fulfill(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