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

Unified Diff: third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js

Issue 2859073002: Revert of DevTools: support resolving a UILocation to multiple raw script locations (Closed)
Patch Set: Created 3 years, 8 months 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/bindings/BreakpointManager.js
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js b/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js
index 5ab6e7770ff63d94bd37d6390d556da320e9e163..88df8c07de7cbb1c99df450002bbcead19cc7d72 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js
@@ -266,15 +266,13 @@
* @return {!Promise<!Array<!Workspace.UILocation>>}
*/
possibleBreakpoints(uiSourceCode, textRange) {
- var startLocations = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(
+ var startLocation = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(
uiSourceCode, textRange.startLine, textRange.startColumn);
- var endLocations = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(
- uiSourceCode, textRange.endLine, textRange.endColumn);
- var startLocationsByScript = new Map(startLocations.map(location => [location.script(), location]));
- var endLocation = endLocations.find(location => location.script() && startLocationsByScript.get(location.script()));
- if (!endLocation)
+ var endLocation =
+ Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(uiSourceCode, textRange.endLine, textRange.endColumn);
+ if (!startLocation || !endLocation || startLocation.debuggerModel !== endLocation.debuggerModel)
return Promise.resolve([]);
- var startLocation = startLocationsByScript.get(endLocation.script());
+
return startLocation.debuggerModel
.getPossibleBreakpoints(startLocation, endLocation, /* restrictToFunction */ false)
.then(toUILocations.bind(this));
@@ -811,7 +809,7 @@
var condition = this._breakpoint.condition();
var debuggerLocation = uiSourceCode &&
- Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode, lineNumber, columnNumber)[0];
+ Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber);
var newState;
if (this._breakpoint._isRemoved || !this._breakpoint.enabled() || this._scriptDiverged()) {
newState = null;

Powered by Google App Engine
This is Rietveld 408576698