Commit 35cd140e authored by lushnikov's avatar lushnikov Committed by Commit bot

DevTools: do not kill breakpoints in case of persistence and auto-reconnecting target.

The investigation revealed:
- BreakpointManager does not know how to set breakpoints in the UISourceCodes
  with exact URLs. For this reason, breakpoints are removed inside workers
  in case of multilpe workers launched with the same URL.
- node.js reports file URLs which clash with the file URLs from persistence.
  This provokes the same illicit behavior in BreakpointManager.
- the same would happen with file-url web sites with persistence folder

This behavior is a conceptual issue of BreakpointManager, which is relied
upon in different parts of BreakpointManager.

Given the poor state of the things in the BreakpointManager, this patch
suggests a trade-off solution for the issue:
- it is localized to persistence only
- it is localized to the case of URL collisition between FileSystem and
  network URLs

Unfortunately, the attempts to write a test with workers failed due to the
BreakpointManager's poor handling of breakpoints in workers.

BUG=722636
R=dgozman

Review-Url: https://codereview.chromium.org/2886643002
Cr-Commit-Position: refs/heads/master@{#472196}
parent 875a2fa4
...@@ -110,6 +110,12 @@ Bindings.BreakpointManager = class extends Common.Object { ...@@ -110,6 +110,12 @@ Bindings.BreakpointManager = class extends Common.Object {
var breakpointItems = this._storage.breakpointItems(fromURL); var breakpointItems = this._storage.breakpointItems(fromURL);
for (var item of breakpointItems) for (var item of breakpointItems)
this.setBreakpoint(toSourceCode, item.lineNumber, item.columnNumber, item.condition, item.enabled); this.setBreakpoint(toSourceCode, item.lineNumber, item.columnNumber, item.condition, item.enabled);
// Since we can not have two provisional breakpoints which point to the same url, remove one of them.
if (fromURL === toSourceCode.url()) {
var provisionalBreakpoints = this._provisionalBreakpointsForURL(fromURL);
for (var breakpoint of provisionalBreakpoints.values())
breakpoint.remove();
}
} }
removeProvisionalBreakpointsForTest() { removeProvisionalBreakpointsForTest() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment