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

Unified Diff: third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js

Issue 1363993007: DevTools: remove UISourceCode.networkURL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaselined Created 5 years, 3 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
Index: third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js
index b008811c9871807f0174c4957ffbf721086f8976..017bf71947d81fef850497cb9a9ae1edce297bbd 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js
@@ -5,12 +5,14 @@
/**
* @constructor
* @param {!WebInspector.Workspace} workspace
+ * @param {!WebInspector.FileSystemWorkspaceBinding} fileSystemWorkspaceBinding
* @param {!WebInspector.FileSystemMapping} fileSystemMapping
*/
-WebInspector.NetworkMapping = function(workspace, fileSystemMapping)
+WebInspector.NetworkMapping = function(workspace, fileSystemWorkspaceBinding, fileSystemMapping)
{
this._workspace = workspace;
this._fileSystemMapping = fileSystemMapping;
+ this._fileSystemWorkspaceBinding = fileSystemWorkspaceBinding;
InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.RevealSourceLine, this._revealSourceLine, this);
}
@@ -21,8 +23,11 @@ WebInspector.NetworkMapping.prototype = {
*/
networkURL: function(uiSourceCode)
{
- // FIXME: This should use fileSystemMapping to determine url.
- return uiSourceCode.networkURL();
+ if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSystem) {
+ var fileSystemPath = this._fileSystemWorkspaceBinding.fileSystemPath(uiSourceCode.project().id());
+ return this.urlForPath(fileSystemPath, uiSourceCode.path());
+ }
+ return uiSourceCode.originURL();
},
/**
@@ -104,13 +109,12 @@ WebInspector.NetworkMapping.prototype = {
/**
* @param {!WebInspector.UISourceCode} networkUISourceCode
* @param {!WebInspector.UISourceCode} uiSourceCode
- * @param {!WebInspector.FileSystemWorkspaceBinding} fileSystemWorkspaceBinding
*/
- addMapping: function(networkUISourceCode, uiSourceCode, fileSystemWorkspaceBinding)
+ addMapping: function(networkUISourceCode, uiSourceCode)
{
var url = this.networkURL(networkUISourceCode);
var path = uiSourceCode.path();
- var fileSystemPath = fileSystemWorkspaceBinding.fileSystemPath(uiSourceCode.project().id());
+ var fileSystemPath = this._fileSystemWorkspaceBinding.fileSystemPath(uiSourceCode.project().id());
this._fileSystemMapping.addMappingForResource(url, fileSystemPath, path);
},

Powered by Google App Engine
This is Rietveld 408576698