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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.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: rebaselined 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/sources/ScriptFormatterEditorAction.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js b/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js
index 0127e4c4355bbda5632eee65677abb82d52f36f5..311aa715aa7bbb9cfe2eaa62d8de1d65ea6a1b62 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js
@@ -103,7 +103,7 @@ WebInspector.FormatterScriptMapping.FormatData = function(projectId, path, mappi
WebInspector.ScriptFormatterEditorAction = function()
{
this._projectId = "formatter:";
- this._project = new WebInspector.ContentProviderBasedProject(WebInspector.workspace, this._projectId, WebInspector.projectTypes.Formatter, "", "formatter");
+ this._project = new WebInspector.ContentProviderBasedProject(WebInspector.workspace, this._projectId, WebInspector.projectTypes.Formatter, "formatter");
/** @type {!Map.<!WebInspector.Script, !WebInspector.UISourceCode>} */
this._uiSourceCodes = new Map();
@@ -370,16 +370,8 @@ WebInspector.ScriptFormatterEditorAction.prototype = {
function innerCallback(formattedContent, formatterMapping)
{
var scripts = this._scriptsForUISourceCode(uiSourceCode);
- var name;
- if (uiSourceCode.contentType() === WebInspector.resourceTypes.Document)
- name = uiSourceCode.displayName();
- else
- name = uiSourceCode.name() || (scripts.length ? scripts[0].scriptId : "");
-
- var networkURL = WebInspector.networkMapping.networkURL(uiSourceCode);
-
var contentProvider = new WebInspector.StaticContentProvider(uiSourceCode.contentType(), formattedContent);
- var formattedUISourceCode = this._project.addContentProvider(networkURL, name + ":formatted", networkURL, contentProvider);
+ var formattedUISourceCode = this._project.addContentProvider(uiSourceCode.path() + ":formatted", contentProvider);
var formattedPath = formattedUISourceCode.path();
var formatData = new WebInspector.FormatterScriptMapping.FormatData(uiSourceCode.project().id(), uiSourceCode.path(), formatterMapping, scripts);
this._formatData.set(formattedUISourceCode, formatData);

Powered by Google App Engine
This is Rietveld 408576698