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

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

Issue 2296983003: DevTools: kill WI.IsolatedFileSystemManager FileSystemsLoaded event (Closed)
Patch Set: remove nested arrow Created 4 years, 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/bindings/FileSystemWorkspaceBinding.js
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/FileSystemWorkspaceBinding.js b/third_party/WebKit/Source/devtools/front_end/bindings/FileSystemWorkspaceBinding.js
index 352a45300b7f4fdc57623a4ab629a738959f6f0b..6ff92a378dc27ca3680d93725434b60c6ddfbc9c 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/FileSystemWorkspaceBinding.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/FileSystemWorkspaceBinding.js
@@ -38,12 +38,14 @@ WebInspector.FileSystemWorkspaceBinding = function(isolatedFileSystemManager, wo
this._isolatedFileSystemManager = isolatedFileSystemManager;
this._workspace = workspace;
this._eventListeners = [
- this._isolatedFileSystemManager.addEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemAdded, this._fileSystemAdded, this),
- this._isolatedFileSystemManager.addEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemRemoved, this._fileSystemRemoved, this),
+ this._isolatedFileSystemManager.addEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemAdded, this._onFileSystemAdded, this),
+ this._isolatedFileSystemManager.addEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemRemoved, this._onFileSystemRemoved, this),
this._isolatedFileSystemManager.addEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemFilesChanged, this._fileSystemFilesChanged, this)
];
/** @type {!Map.<string, !WebInspector.FileSystemWorkspaceBinding.FileSystem>} */
this._boundFileSystems = new Map();
+ this._isolatedFileSystemManager.waitForFileSystems()
+ .then(this._onFileSystemsLoaded.bind(this));
}
WebInspector.FileSystemWorkspaceBinding._styleSheetExtensions = new Set(["css", "scss", "sass", "less"]);
@@ -109,11 +111,28 @@ WebInspector.FileSystemWorkspaceBinding.prototype = {
},
/**
+ * @param {!Array<!WebInspector.IsolatedFileSystem>} fileSystems
+ */
+ _onFileSystemsLoaded: function(fileSystems)
+ {
+ for (var fileSystem of fileSystems)
+ this._addFileSystem(fileSystem);
+ },
+
+ /**
* @param {!WebInspector.Event} event
*/
- _fileSystemAdded: function(event)
+ _onFileSystemAdded: function(event)
{
var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event.data);
+ this._addFileSystem(fileSystem);
+ },
+
+ /**
+ * @param {!WebInspector.IsolatedFileSystem} fileSystem
+ */
+ _addFileSystem: function(fileSystem)
+ {
var boundFileSystem = new WebInspector.FileSystemWorkspaceBinding.FileSystem(this, fileSystem, this._workspace);
this._boundFileSystems.set(fileSystem.path(), boundFileSystem);
},
@@ -121,7 +140,7 @@ WebInspector.FileSystemWorkspaceBinding.prototype = {
/**
* @param {!WebInspector.Event} event
*/
- _fileSystemRemoved: function(event)
+ _onFileSystemRemoved: function(event)
{
var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event.data);
var boundFileSystem = this._boundFileSystems.get(fileSystem.path());
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698