Chromium Code Reviews| 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 88df8c07de7cbb1c99df450002bbcead19cc7d72..cdf521a934f4154805016c34610befba2de2fa70 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js |
| @@ -266,13 +266,15 @@ Bindings.BreakpointManager = class extends Common.Object { |
| * @return {!Promise<!Array<!Workspace.UILocation>>} |
| */ |
| possibleBreakpoints(uiSourceCode, textRange) { |
| - var startLocation = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation( |
| + var startLocations = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations( |
| uiSourceCode, textRange.startLine, textRange.startColumn); |
| - var endLocation = |
| - Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(uiSourceCode, textRange.endLine, textRange.endColumn); |
| - if (!startLocation || !endLocation || startLocation.debuggerModel !== endLocation.debuggerModel) |
| + var endLocations = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations( |
| + uiSourceCode, textRange.endLine, textRange.endColumn); |
| + var startLocationsByScript = new Map(startLocations.map(location => [location.uniqueScriptId(), location])); |
|
dgozman
2017/05/02 21:36:45
Why not just compare them all?
for (var startLoca
|
| + var endLocation = endLocations.find(location => startLocationsByScript.get(location.uniqueScriptId())); |
| + if (!endLocation) |
| return Promise.resolve([]); |
| - |
| + var startLocation = startLocationsByScript.get(endLocation.uniqueScriptId()); |
| return startLocation.debuggerModel |
| .getPossibleBreakpoints(startLocation, endLocation, /* restrictToFunction */ false) |
| .then(toUILocations.bind(this)); |
| @@ -809,7 +811,7 @@ Bindings.BreakpointManager.ModelBreakpoint = class { |
| var condition = this._breakpoint.condition(); |
| var debuggerLocation = uiSourceCode && |
| - Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber); |
| + Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode, lineNumber, columnNumber)[0]; |
| var newState; |
| if (this._breakpoint._isRemoved || !this._breakpoint.enabled() || this._scriptDiverged()) { |
| newState = null; |