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

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: 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..3646b72e73adb1847c89c4ce5ebd7ec8430caa14 100644
--- a/third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js
+++ b/third_party/WebKit/Source/devtools/front_end/workspace/FileSystemMapping.js
@@ -53,13 +53,12 @@ WebInspector.FileSystemMapping.prototype = {
this._fileSystemMappings = {};
for (var fileSystemPath in savedMapping) {
var savedFileSystemMappings = savedMapping[fileSystemPath];
-
this._fileSystemMappings[fileSystemPath] = [];
var fileSystemMappings = this._fileSystemMappings[fileSystemPath];
for (var i = 0; i < savedFileSystemMappings.length; ++i) {
var savedEntry = savedFileSystemMappings[i];
- var entry = new WebInspector.FileSystemMapping.Entry(savedEntry.fileSystemPath, savedEntry.urlPrefix, savedEntry.pathPrefix, true);
+ var entry = new WebInspector.FileSystemMapping.Entry(fileSystemPath, savedEntry.urlPrefix, savedEntry.pathPrefix, true);
dgozman 2015/12/15 22:22:47 Why change this?
pfeldman 2015/12/16 01:34:28 Done. (there were more changes)
fileSystemMappings.push(entry);
}
}
@@ -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