DevTools: support provisional breakpoings with persistence and Node.js
This patch starts unconditionally translating fileURLs into node.js paths
if the attached target is node.js.
R=dgozman, pfeldman
Change-Id: Ief2677e21001c7c1dea3e0f2b7ef74372ae89145
Reviewed-on: https://chromium-review.googlesource.com/896594
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536287}
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 f8e8731..5618a772 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
@@ -251,8 +251,8 @@
*/
async setBreakpointByURL(url, lineNumber, columnNumber, condition) {
// Convert file url to node-js path.
- if (this.target().isNodeJS() && SDK.DebuggerModel._fileURLToNodeJSPath.has(url))
- url = SDK.DebuggerModel._fileURLToNodeJSPath.get(url);
+ if (this.target().isNodeJS())
+ url = Common.ParsedURL.urlToPlatformPath(url, Host.isWin());
// Adjust column if needed.
var minColumnNumber = 0;
var scripts = this._scriptsBySourceURL.get(url) || [];
@@ -564,7 +564,6 @@
var nodeJSPath = sourceURL;
sourceURL = Common.ParsedURL.platformPathToURL(nodeJSPath);
sourceURL = this._internString(sourceURL);
- SDK.DebuggerModel._fileURLToNodeJSPath.set(sourceURL, nodeJSPath);
} else {
sourceURL = this._internString(sourceURL);
}
@@ -899,9 +898,6 @@
/** @type {?Protocol.Runtime.StackTraceId} */
SDK.DebuggerModel._scheduledPauseOnAsyncCall = null;
-/** @type {!Map<string, string>} */
-SDK.DebuggerModel._fileURLToNodeJSPath = new Map();
-
SDK.SDKModel.register(SDK.DebuggerModel, SDK.Target.Capability.JS, true);
/** @typedef {{location: ?SDK.DebuggerModel.Location, functionName: string}} */