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

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

Issue 1523193002: DevTools: merge UISourceCode's parentPath, name, originURL and uri. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: all tests pass Created 5 years 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/workspace/FileSystemMapping.js
diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js b/third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js
index c5cf47e55119068dd7b553d743277dcd3df31a0f..ce64c75a83a6d0602785e4024cb26a54c65aee9a 100644
--- a/third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js
+++ b/third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js
@@ -53,7 +53,6 @@ WebInspector.FileSystemMapping.prototype = {
this._fileSystemMappings = {};
for (var fileSystemPath in savedMapping) {
var savedFileSystemMappings = savedMapping[fileSystemPath];
-
this._fileSystemMappings[fileSystemPath] = [];
var fileSystemMappings = this._fileSystemMappings[fileSystemPath];
@@ -209,7 +208,7 @@ WebInspector.FileSystemMapping.prototype = {
// We are looking for the longest pathPrefix match.
if (entry && entry.pathPrefix.length > pathPrefix.length)
continue;
- if (filePath.startsWith(pathPrefix.substr(1)))
+ if (filePath.startsWith(pathPrefix))
entry = entries[i];
}
return entry;
@@ -270,10 +269,11 @@ WebInspector.FileSystemMapping.prototype = {
*/
urlForPath: function(fileSystemPath, filePath)
{
- var entry = this._mappingEntryForPath(fileSystemPath, filePath);
+ var relativePath = filePath.substring("file://".length + fileSystemPath.length);
+ var entry = this._mappingEntryForPath(fileSystemPath, relativePath);
if (!entry)
return "";
- return entry.urlPrefix + filePath.substring(entry.pathPrefix.length - 1);
+ return entry.urlPrefix + relativePath.substring(entry.pathPrefix.length);
},
/**

Powered by Google App Engine
This is Rietveld 408576698