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

Side by Side 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 unified diff | Download patch
OLDNEW
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
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 resolveCallback;
dgozman 2016/11/09 20:44:03 fulfill
kozy 2016/11/10 03:17:36 Done.
289 var promise = new Promise(resolve => resolveCallback = 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 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.
301 resolveCallback([]);
302 return;
303 }
304 resolveCallback(locations.map(location => WebInspector.DebuggerModel.Locat ion.fromPayload(this, location)));
305 }
306 }
307
308 /**
283 * @param {!Protocol.Debugger.BreakpointId} breakpointId 309 * @param {!Protocol.Debugger.BreakpointId} breakpointId
284 * @param {!Protocol.Debugger.Location} location 310 * @param {!Protocol.Debugger.Location} location
285 */ 311 */
286 _breakpointResolved(breakpointId, location) { 312 _breakpointResolved(breakpointId, location) {
287 this._breakpointResolvedEventTarget.dispatchEventToListeners( 313 this._breakpointResolvedEventTarget.dispatchEventToListeners(
288 breakpointId, WebInspector.DebuggerModel.Location.fromPayload(this, loca tion)); 314 breakpointId, WebInspector.DebuggerModel.Location.fromPayload(this, loca tion));
289 } 315 }
290 316
291 globalObjectCleared() { 317 globalObjectCleared() {
292 this._setDebuggerPausedDetails(null); 318 this._setDebuggerPausedDetails(null);
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 stack.callFrames.shift(); 1315 stack.callFrames.shift();
1290 if (previous && !stack.callFrames.length) 1316 if (previous && !stack.callFrames.length)
1291 previous.parent = stack.parent; 1317 previous.parent = stack.parent;
1292 else 1318 else
1293 previous = stack; 1319 previous = stack;
1294 stack = stack.parent; 1320 stack = stack.parent;
1295 } 1321 }
1296 return asyncStackTrace; 1322 return asyncStackTrace;
1297 } 1323 }
1298 }; 1324 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698