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

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

Issue 1564113003: DevTools: merge uisourcecode's url-alike members. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/workspace/Workspace.js
diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/Workspace.js b/third_party/WebKit/Source/devtools/front_end/workspace/Workspace.js
index a5f0c67000bc85d08d2f6e4d05460c27c9e740b2..538a69af4b1b2f932bb762c1d6f0bd4915370cc6 100644
--- a/third_party/WebKit/Source/devtools/front_end/workspace/Workspace.js
+++ b/third_party/WebKit/Source/devtools/front_end/workspace/Workspace.js
@@ -181,10 +181,10 @@ WebInspector.Project.prototype = {
uiSourceCode: function(path) { },
/**
- * @param {string} originURL
+ * @param {string} url
* @return {?WebInspector.UISourceCode}
*/
- uiSourceCodeForOriginURL: function(originURL) { },
+ uiSourceCodeForURL: function(url) { },
/**
* @return {!Array.<!WebInspector.UISourceCode>}
@@ -277,7 +277,7 @@ WebInspector.ProjectStore.prototype = {
*/
addUISourceCode: function(uiSourceCode, replace)
{
- var path = uiSourceCode.path();
+ var path = uiSourceCode.url();
dgozman 2016/01/08 20:22:07 path -> url
if (this.uiSourceCode(path)) {
if (replace)
this.removeUISourceCode(path);
@@ -302,7 +302,7 @@ WebInspector.ProjectStore.prototype = {
var entry = this._uiSourceCodesMap.get(path);
var movedUISourceCode = this._uiSourceCodesList[this._uiSourceCodesList.length - 1];
this._uiSourceCodesList[entry.index] = movedUISourceCode;
- var movedEntry = this._uiSourceCodesMap.get(movedUISourceCode.path());
+ var movedEntry = this._uiSourceCodesMap.get(movedUISourceCode.url());
movedEntry.index = entry.index;
this._uiSourceCodesList.splice(this._uiSourceCodesList.length - 1, 1);
this._uiSourceCodesMap.delete(path);
@@ -327,14 +327,14 @@ WebInspector.ProjectStore.prototype = {
},
/**
- * @param {string} originURL
+ * @param {string} url
* @return {?WebInspector.UISourceCode}
*/
- uiSourceCodeForOriginURL: function(originURL)
+ uiSourceCodeForURL: function(url)
{
for (var i = 0; i < this._uiSourceCodesList.length; ++i) {
var uiSourceCode = this._uiSourceCodesList[i];
- if (uiSourceCode.originURL() === originURL)
+ if (uiSourceCode.url() === url)
return uiSourceCode;
}
return null;
@@ -354,8 +354,8 @@ WebInspector.ProjectStore.prototype = {
*/
renameUISourceCode: function(uiSourceCode, newName)
{
- var oldPath = uiSourceCode.path();
- var newPath = uiSourceCode.parentPath() ? uiSourceCode.parentPath() + "/" + newName : newName;
+ var oldPath = uiSourceCode.url();
+ var newPath = uiSourceCode.parentURL() ? uiSourceCode.parentURL() + "/" + newName : newName;
var value = /** @type {!{uiSourceCode: !WebInspector.UISourceCode, index: number}} */ (this._uiSourceCodesMap.get(oldPath));
this._uiSourceCodesMap.set(newPath, value);
this._uiSourceCodesMap.delete(oldPath);
@@ -418,15 +418,15 @@ WebInspector.Workspace.prototype = {
},
/**
- * @param {string} originURL
+ * @param {string} url
* @return {?WebInspector.UISourceCode}
*/
- uiSourceCodeForOriginURL: function(originURL)
+ uiSourceCodeForURL: function(url)
{
var projects = this.projectsForType(WebInspector.projectTypes.Network);
dgozman 2016/01/08 20:22:07 Search in all projects.
projects = projects.concat(this.projectsForType(WebInspector.projectTypes.ContentScripts));
for (var project of projects) {
- var uiSourceCode = project.uiSourceCodeForOriginURL(originURL);
+ var uiSourceCode = project.uiSourceCodeForURL(url);
if (uiSourceCode)
return uiSourceCode;
}
@@ -434,13 +434,13 @@ WebInspector.Workspace.prototype = {
},
/**
- * @param {string} originURL
+ * @param {string} url
* @return {?WebInspector.UISourceCode}
*/
- filesystemUISourceCode: function(originURL)
+ filesystemUISourceCode: function(url)
dgozman 2016/01/08 20:22:07 Let's remove this one
{
for (var project of this.projectsForType(WebInspector.projectTypes.FileSystem)) {
- var uiSourceCode = project.uiSourceCodeForOriginURL(originURL);
+ var uiSourceCode = project.uiSourceCodeForURL(url);
if (uiSourceCode)
return uiSourceCode;
}

Powered by Google App Engine
This is Rietveld 408576698