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

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: rename 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..395a32fc0ab5db78811816f57a16536e9e01cee4 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,23 @@ 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, fileSystem) => fileSystem._fileChanged(path));
+ forEachFile.call(this, paths.added, (path, fileSystem) => fileSystem._fileChanged(path));
+ forEachFile.call(this, paths.removed, (path, fileSystem) => fileSystem.removeUISourceCode(path));
+
+ /**
+ * @param {!Array<string>} filePaths
+ * @param {function(string, !Persistence.FileSystemWorkspaceBinding.FileSystem)} callback
+ * @this {Persistence.FileSystemWorkspaceBinding}
+ */
+ function forEachFile(filePaths, callback) {
+ for (var filePath of filePaths) {
+ for (var fileSystemPath of this._boundFileSystems.keys()) {
+ if (!filePath.startsWith(fileSystemPath))
+ continue;
+ callback(filePath, this._boundFileSystems.get(fileSystemPath));
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698