Chromium Code Reviews| 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)); |
| + } |
| } |
| } |
| } |