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

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

Issue 2651043006: DevTools: Remove files in the navigator when they are deleted externally (Closed)
Patch Set: Created 3 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/persistence/FileSystemWorkspaceBinding.js
diff --git a/third_party/WebKit/Source/devtools/front_end/persistence/FileSystemWorkspaceBinding.js b/third_party/WebKit/Source/devtools/front_end/persistence/FileSystemWorkspaceBinding.js
index e843dddd08fa9d2a995f0b7603a746224b48ab13..7669a22994163af879496d01bcf7b7f68c78830f 100644
--- a/third_party/WebKit/Source/devtools/front_end/persistence/FileSystemWorkspaceBinding.js
+++ b/third_party/WebKit/Source/devtools/front_end/persistence/FileSystemWorkspaceBinding.js
@@ -150,12 +150,24 @@ Persistence.FileSystemWorkspaceBinding = class {
* @param {!Common.Event} event
*/
_fileSystemFilesChanged(event) {
- var paths = /** @type {!Array<string>} */ (event.data);
- for (var path of paths) {
- for (var key of this._boundFileSystems.keys()) {
- if (!path.startsWith(key))
- continue;
- this._boundFileSystems.get(key)._fileChanged(path);
+ var paths = /** @type {!Workspace.IsolatedFileSystemManager.FilesChangedData} */ (event.data);
+
+ forEachFile.call(this, paths.changed, (path, file) => file._fileChanged(path));
lushnikov 2017/01/25 02:23:10 file => fileSystem?
einbinder 2017/01/25 19:53:12 Done.
+ forEachFile.call(this, paths.added, (path, file) => file._fileChanged(path));
+ forEachFile.call(this, paths.removed, (path, file) => file.removeUISourceCode(path));
+
+ /**
+ * @param {!Array<string>} filePaths
+ * @param {function(string, !Persistence.FileSystemWorkspaceBinding.FileSystem)} fn
+ * @this {Persistence.FileSystemWorkspaceBinding}
+ */
+ function forEachFile(filePaths, fn) {
lushnikov 2017/01/25 02:23:10 fn => callback
einbinder 2017/01/25 19:53:12 Done.
+ for (var path of filePaths) {
lushnikov 2017/01/25 02:23:10 path => filePath
einbinder 2017/01/25 19:53:12 Done.
+ for (var key of this._boundFileSystems.keys()) {
lushnikov 2017/01/25 02:23:10 key => fileSystemPath
einbinder 2017/01/25 19:53:12 Done.
+ if (!path.startsWith(key))
+ continue;
+ fn(path, this._boundFileSystems.get(key));
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698