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

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

Issue 1564113003: DevTools: merge uisourcecode's url-alike members. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 4 years, 11 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 a9a3bb9670885e75dc50ef79c2d7a883d8c8a927..123ed37e3ed3d3eb747a7600bd8ce3c3294e3085 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js
@@ -77,18 +77,18 @@ WebInspector.NetworkMapping.prototype = {
{
if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSystem) {
var fileSystemPath = this._fileSystemWorkspaceBinding.fileSystemPath(uiSourceCode.project().id());
- return this._urlForPath(fileSystemPath, uiSourceCode.path());
+ return this._networkURLForFileSystemURL(fileSystemPath, uiSourceCode.url());
}
- return uiSourceCode.originURL();
+ return uiSourceCode.url();
},
/**
* @param {string} url
* @return {boolean}
*/
- hasMappingForURL: function(url)
+ hasMappingForNetworkURL: function(url)
{
- return this._fileSystemMapping.hasMappingForURL(url);
+ return this._fileSystemMapping.hasMappingForNetworkURL(url);
},
/**
@@ -99,8 +99,7 @@ WebInspector.NetworkMapping.prototype = {
*/
_networkUISourceCodeForURL: function(target, frame, url)
{
- var project = this._workspace.project(WebInspector.NetworkProject.projectId(target, frame, false));
- return project ? project.uiSourceCode(url) : null;
+ return this._workspace.uiSourceCode(WebInspector.NetworkProject.projectId(target, frame, false), url);
},
/**
@@ -111,8 +110,7 @@ WebInspector.NetworkMapping.prototype = {
*/
_contentScriptUISourceCodeForURL: function(target, frame, url)
{
- var project = this._workspace.project(WebInspector.NetworkProject.projectId(target, frame, true));
- return project ? project.uiSourceCode(url) : null;
+ return this._workspace.uiSourceCode(WebInspector.NetworkProject.projectId(target, frame, true), url);
},
/**
@@ -124,8 +122,7 @@ WebInspector.NetworkMapping.prototype = {
var file = this._fileSystemMapping.fileForURL(url);
if (file) {
var projectId = WebInspector.FileSystemWorkspaceBinding.projectId(file.fileSystemPath);
- var project = this._workspace.project(projectId);
- return project ? project.uiSourceCode(file.fileURL) : null;
+ return this._workspace.uiSourceCode(projectId, file.fileURL);
}
return null;
},
@@ -169,7 +166,7 @@ WebInspector.NetworkMapping.prototype = {
*/
uiSourceCodeForURLForAnyTarget: function(url)
{
- return this._fileSystemUISourceCodeForURL(url) || WebInspector.workspace.uiSourceCodeForOriginURL(url);
+ return this._fileSystemUISourceCodeForURL(url) || WebInspector.workspace.uiSourceCodeForURL(url);
},
/**
@@ -177,9 +174,9 @@ WebInspector.NetworkMapping.prototype = {
* @param {string} filePath
* @return {string}
*/
- _urlForPath: function(fileSystemPath, filePath)
+ _networkURLForFileSystemURL: function(fileSystemPath, filePath)
{
- return this._fileSystemMapping.urlForPath(fileSystemPath, filePath);
+ return this._fileSystemMapping.networkURLForFileSystemURL(fileSystemPath, filePath);
},
/**
@@ -189,7 +186,7 @@ WebInspector.NetworkMapping.prototype = {
addMapping: function(networkUISourceCode, uiSourceCode)
{
var url = this.networkURL(networkUISourceCode);
- var path = uiSourceCode.path();
+ var path = uiSourceCode.url();
var fileSystemPath = this._fileSystemWorkspaceBinding.fileSystemPath(uiSourceCode.project().id());
this._fileSystemMapping.addMappingForResource(url, fileSystemPath, path);
},

Powered by Google App Engine
This is Rietveld 408576698