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

Unified Diff: third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js

Issue 2422803002: DevTools: prefix node.js scripts's sourceURL with "file://" to make them a valid url (Closed)
Patch Set: WI.ParsedURL.platformPathToURL Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystemManager.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js b/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
index 3942369a391dd3a8caafedf3443b2cbb1603ca51..5a89227ade816600b4a7ed0b083ec9d519ce3ac1 100644
--- a/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
+++ b/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
@@ -41,10 +41,18 @@ WebInspector.UISourceCode = function(project, url, contentType)
this._project = project;
this._url = url;
- var pathComponents = WebInspector.ParsedURL.splitURLIntoPathComponents(url);
- this._origin = pathComponents[0];
- this._parentURL = pathComponents.slice(0, -1).join("/");
- this._name = pathComponents[pathComponents.length - 1];
+ var parsedURL = url.asParsedURL();
+ if (parsedURL) {
+ this._origin = parsedURL.securityOrigin();
+ this._parentURL = this._origin + parsedURL.folderPathComponents;
+ this._name = parsedURL.lastPathComponent;
+ if (parsedURL.queryParams)
+ this._name += "?" + parsedURL.queryParams;
+ } else {
+ this._origin = "";
+ this._parentURL = "";
+ this._name = url;
+ }
this._contentType = contentType;
/** @type {?function(?string)} */
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystemManager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698