| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 /** @type {!Map<number, function(!Array.<string>)>} */ | 40 /** @type {!Map<number, function(!Array.<string>)>} */ |
| 41 this._callbacks = new Map(); | 41 this._callbacks = new Map(); |
| 42 /** @type {!Map<number, !Common.Progress>} */ | 42 /** @type {!Map<number, !Common.Progress>} */ |
| 43 this._progresses = new Map(); | 43 this._progresses = new Map(); |
| 44 | 44 |
| 45 InspectorFrontendHost.events.addEventListener( | 45 InspectorFrontendHost.events.addEventListener( |
| 46 InspectorFrontendHostAPI.Events.FileSystemRemoved, this._onFileSystemRem
oved, this); | 46 InspectorFrontendHostAPI.Events.FileSystemRemoved, this._onFileSystemRem
oved, this); |
| 47 InspectorFrontendHost.events.addEventListener( | 47 InspectorFrontendHost.events.addEventListener( |
| 48 InspectorFrontendHostAPI.Events.FileSystemAdded, this._onFileSystemAdded
, this); | 48 InspectorFrontendHostAPI.Events.FileSystemAdded, this._onFileSystemAdded
, this); |
| 49 InspectorFrontendHost.events.addEventListener( | 49 InspectorFrontendHost.events.addEventListener( |
| 50 InspectorFrontendHostAPI.Events.FileSystemFilesChanged, this._onFileSyst
emFilesChanged, this); | 50 InspectorFrontendHostAPI.Events.FileSystemFilesChangedAddedRemoved, this
._onFileSystemFilesChanged, this); |
| 51 InspectorFrontendHost.events.addEventListener( | 51 InspectorFrontendHost.events.addEventListener( |
| 52 InspectorFrontendHostAPI.Events.IndexingTotalWorkCalculated, this._onInd
exingTotalWorkCalculated, this); | 52 InspectorFrontendHostAPI.Events.IndexingTotalWorkCalculated, this._onInd
exingTotalWorkCalculated, this); |
| 53 InspectorFrontendHost.events.addEventListener( | 53 InspectorFrontendHost.events.addEventListener( |
| 54 InspectorFrontendHostAPI.Events.IndexingWorked, this._onIndexingWorked,
this); | 54 InspectorFrontendHostAPI.Events.IndexingWorked, this._onIndexingWorked,
this); |
| 55 InspectorFrontendHost.events.addEventListener( | 55 InspectorFrontendHost.events.addEventListener( |
| 56 InspectorFrontendHostAPI.Events.IndexingDone, this._onIndexingDone, this
); | 56 InspectorFrontendHostAPI.Events.IndexingDone, this._onIndexingDone, this
); |
| 57 InspectorFrontendHost.events.addEventListener( | 57 InspectorFrontendHost.events.addEventListener( |
| 58 InspectorFrontendHostAPI.Events.SearchCompleted, this._onSearchCompleted
, this); | 58 InspectorFrontendHostAPI.Events.SearchCompleted, this._onSearchCompleted
, this); |
| 59 | 59 |
| 60 this._initExcludePatterSetting(); | 60 this._initExcludePatterSetting(); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 return; | 160 return; |
| 161 this._fileSystems.delete(fileSystemPath); | 161 this._fileSystems.delete(fileSystemPath); |
| 162 isolatedFileSystem.fileSystemRemoved(); | 162 isolatedFileSystem.fileSystemRemoved(); |
| 163 this.dispatchEventToListeners(Workspace.IsolatedFileSystemManager.Events.Fil
eSystemRemoved, isolatedFileSystem); | 163 this.dispatchEventToListeners(Workspace.IsolatedFileSystemManager.Events.Fil
eSystemRemoved, isolatedFileSystem); |
| 164 } | 164 } |
| 165 | 165 |
| 166 /** | 166 /** |
| 167 * @param {!Common.Event} event | 167 * @param {!Common.Event} event |
| 168 */ | 168 */ |
| 169 _onFileSystemFilesChanged(event) { | 169 _onFileSystemFilesChanged(event) { |
| 170 var embedderPaths = /** @type {!Array<string>} */ (event.data); | 170 var paths = /** @type {!Workspace.IsolatedFileSystemManager.FilesChangedData
} */ (event.data); |
| 171 var paths = embedderPaths.map(embedderPath => Common.ParsedURL.platformPathT
oURL(embedderPath)); | 171 var urlPaths = {}; |
| 172 this.dispatchEventToListeners(Workspace.IsolatedFileSystemManager.Events.Fil
eSystemFilesChanged, paths); | 172 urlPaths.changed = paths.changed.map(embedderPath => Common.ParsedURL.platfo
rmPathToURL(embedderPath)); |
| 173 urlPaths.added = paths.added.map(embedderPath => Common.ParsedURL.platformPa
thToURL(embedderPath)); |
| 174 urlPaths.removed = paths.removed.map(embedderPath => Common.ParsedURL.platfo
rmPathToURL(embedderPath)); |
| 175 this.dispatchEventToListeners(Workspace.IsolatedFileSystemManager.Events.Fil
eSystemFilesChanged, urlPaths); |
| 173 } | 176 } |
| 174 | 177 |
| 175 /** | 178 /** |
| 176 * @return {!Array<!Workspace.IsolatedFileSystem>} | 179 * @return {!Array<!Workspace.IsolatedFileSystem>} |
| 177 */ | 180 */ |
| 178 fileSystems() { | 181 fileSystems() { |
| 179 return this._fileSystems.valuesArray(); | 182 return this._fileSystems.valuesArray(); |
| 180 } | 183 } |
| 181 | 184 |
| 182 /** | 185 /** |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 if (!callback) | 294 if (!callback) |
| 292 return; | 295 return; |
| 293 callback.call(null, files); | 296 callback.call(null, files); |
| 294 this._callbacks.delete(requestId); | 297 this._callbacks.delete(requestId); |
| 295 } | 298 } |
| 296 }; | 299 }; |
| 297 | 300 |
| 298 /** @typedef {!{fileSystemName: string, rootURL: string, fileSystemPath: string}
} */ | 301 /** @typedef {!{fileSystemName: string, rootURL: string, fileSystemPath: string}
} */ |
| 299 Workspace.IsolatedFileSystemManager.FileSystem; | 302 Workspace.IsolatedFileSystemManager.FileSystem; |
| 300 | 303 |
| 304 /** @typedef {!{changed:!Array<string>, added:!Array<string>, removed:!Array<str
ing>}} */ |
| 305 Workspace.IsolatedFileSystemManager.FilesChangedData; |
| 306 |
| 301 /** @enum {symbol} */ | 307 /** @enum {symbol} */ |
| 302 Workspace.IsolatedFileSystemManager.Events = { | 308 Workspace.IsolatedFileSystemManager.Events = { |
| 303 FileSystemAdded: Symbol('FileSystemAdded'), | 309 FileSystemAdded: Symbol('FileSystemAdded'), |
| 304 FileSystemRemoved: Symbol('FileSystemRemoved'), | 310 FileSystemRemoved: Symbol('FileSystemRemoved'), |
| 305 FileSystemFilesChanged: Symbol('FileSystemFilesChanged'), | 311 FileSystemFilesChanged: Symbol('FileSystemFilesChanged'), |
| 306 ExcludedFolderAdded: Symbol('ExcludedFolderAdded'), | 312 ExcludedFolderAdded: Symbol('ExcludedFolderAdded'), |
| 307 ExcludedFolderRemoved: Symbol('ExcludedFolderRemoved') | 313 ExcludedFolderRemoved: Symbol('ExcludedFolderRemoved') |
| 308 }; | 314 }; |
| 309 | 315 |
| 310 Workspace.IsolatedFileSystemManager._lastRequestId = 0; | 316 Workspace.IsolatedFileSystemManager._lastRequestId = 0; |
| 311 | 317 |
| 312 /** | 318 /** |
| 313 * @type {!Workspace.IsolatedFileSystemManager} | 319 * @type {!Workspace.IsolatedFileSystemManager} |
| 314 */ | 320 */ |
| 315 Workspace.isolatedFileSystemManager; | 321 Workspace.isolatedFileSystemManager; |
| OLD | NEW |