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

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: fix test 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..fec928ab97abeb60429ceea063a348dcfe7358be 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));
+ }
}
}
}
@@ -228,8 +239,8 @@ Persistence.FileSystemWorkspaceBinding.FileSystem = class extends Workspace.Proj
/**
* @return {!Array<string>}
*/
- gitFolders() {
- return this._fileSystem.gitFolders().map(folder => this._fileSystemPath + '/' + folder);
+ initialGitFolders() {
+ return this._fileSystem.initialGitFolders().map(folder => this._fileSystemPath + '/' + folder);
}
/**
@@ -457,7 +468,7 @@ Persistence.FileSystemWorkspaceBinding.FileSystem = class extends Workspace.Proj
populate() {
var chunkSize = 1000;
- var filePaths = this._fileSystem.filePaths();
+ var filePaths = this._fileSystem.initialFilePaths();
reportFileChunk.call(this, 0);
/**

Powered by Google App Engine
This is Rietveld 408576698