| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 this._path = path; | 43 this._path = path; |
| 44 this._embedderPath = embedderPath; | 44 this._embedderPath = embedderPath; |
| 45 this._domFileSystem = domFileSystem; | 45 this._domFileSystem = domFileSystem; |
| 46 this._excludedFoldersSetting = Common.settings.createLocalSetting('workspace
ExcludedFolders', {}); | 46 this._excludedFoldersSetting = Common.settings.createLocalSetting('workspace
ExcludedFolders', {}); |
| 47 /** @type {!Set<string>} */ | 47 /** @type {!Set<string>} */ |
| 48 this._excludedFolders = new Set(this._excludedFoldersSetting.get()[path] ||
[]); | 48 this._excludedFolders = new Set(this._excludedFoldersSetting.get()[path] ||
[]); |
| 49 /** @type {!Set<string>} */ | 49 /** @type {!Set<string>} */ |
| 50 this._nonConfigurableExcludedFolders = new Set(); | 50 this._nonConfigurableExcludedFolders = new Set(); |
| 51 | 51 |
| 52 /** @type {!Set<string>} */ | 52 /** @type {!Set<string>} */ |
| 53 this._filePaths = new Set(); | 53 this._initialFilePaths = new Set(); |
| 54 /** @type {!Set<string>} */ | 54 /** @type {!Set<string>} */ |
| 55 this._gitFolders = new Set(); | 55 this._initialGitFolders = new Set(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 /** | 58 /** |
| 59 * @param {!Workspace.IsolatedFileSystemManager} manager | 59 * @param {!Workspace.IsolatedFileSystemManager} manager |
| 60 * @param {string} path | 60 * @param {string} path |
| 61 * @param {string} embedderPath | 61 * @param {string} embedderPath |
| 62 * @param {string} name | 62 * @param {string} name |
| 63 * @param {string} rootURL | 63 * @param {string} rootURL |
| 64 * @return {!Promise<?Workspace.IsolatedFileSystem>} | 64 * @return {!Promise<?Workspace.IsolatedFileSystem>} |
| 65 */ | 65 */ |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 function errorHandler(error) { | 123 function errorHandler(error) { |
| 124 var errorMessage = Workspace.IsolatedFileSystem.errorMessage(error); | 124 var errorMessage = Workspace.IsolatedFileSystem.errorMessage(error); |
| 125 console.error(errorMessage + ' when getting file metadata \'' + path); | 125 console.error(errorMessage + ' when getting file metadata \'' + path); |
| 126 fulfill(null); | 126 fulfill(null); |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 | 129 |
| 130 /** | 130 /** |
| 131 * @return {!Array<string>} | 131 * @return {!Array<string>} |
| 132 */ | 132 */ |
| 133 filePaths() { | 133 initialFilePaths() { |
| 134 return this._filePaths.valuesArray(); | 134 return this._initialFilePaths.valuesArray(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 /** | 137 /** |
| 138 * @return {!Array<string>} | 138 * @return {!Array<string>} |
| 139 */ | 139 */ |
| 140 gitFolders() { | 140 initialGitFolders() { |
| 141 return this._gitFolders.valuesArray(); | 141 return this._initialGitFolders.valuesArray(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 /** | 144 /** |
| 145 * @return {string} | 145 * @return {string} |
| 146 */ | 146 */ |
| 147 path() { | 147 path() { |
| 148 return this._path; | 148 return this._path; |
| 149 } | 149 } |
| 150 | 150 |
| 151 /** | 151 /** |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 /** | 192 /** |
| 193 * @param {!Array.<!FileEntry>} entries | 193 * @param {!Array.<!FileEntry>} entries |
| 194 * @this {Workspace.IsolatedFileSystem} | 194 * @this {Workspace.IsolatedFileSystem} |
| 195 */ | 195 */ |
| 196 function innerCallback(entries) { | 196 function innerCallback(entries) { |
| 197 for (var i = 0; i < entries.length; ++i) { | 197 for (var i = 0; i < entries.length; ++i) { |
| 198 var entry = entries[i]; | 198 var entry = entries[i]; |
| 199 if (!entry.isDirectory) { | 199 if (!entry.isDirectory) { |
| 200 if (this._isFileExcluded(entry.fullPath)) | 200 if (this._isFileExcluded(entry.fullPath)) |
| 201 continue; | 201 continue; |
| 202 this._filePaths.add(entry.fullPath.substr(1)); | 202 this._initialFilePaths.add(entry.fullPath.substr(1)); |
| 203 } else { | 203 } else { |
| 204 if (entry.fullPath.endsWith('/.git')) { | 204 if (entry.fullPath.endsWith('/.git')) { |
| 205 var lastSlash = entry.fullPath.lastIndexOf('/'); | 205 var lastSlash = entry.fullPath.lastIndexOf('/'); |
| 206 var parentFolder = entry.fullPath.substring(1, lastSlash); | 206 var parentFolder = entry.fullPath.substring(1, lastSlash); |
| 207 this._gitFolders.add(parentFolder); | 207 this._initialGitFolders.add(parentFolder); |
| 208 } | 208 } |
| 209 if (this._isFileExcluded(entry.fullPath + '/')) | 209 if (this._isFileExcluded(entry.fullPath + '/')) |
| 210 continue; | 210 continue; |
| 211 ++pendingRequests; | 211 ++pendingRequests; |
| 212 this._requestEntries(entry.fullPath, boundInnerCallback); | 212 this._requestEntries(entry.fullPath, boundInnerCallback); |
| 213 } | 213 } |
| 214 } | 214 } |
| 215 if ((--pendingRequests === 0)) | 215 if ((--pendingRequests === 0)) |
| 216 fulfill(); | 216 fulfill(); |
| 217 } | 217 } |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 */ | 618 */ |
| 619 indexContent(progress) { | 619 indexContent(progress) { |
| 620 progress.setTotalWork(1); | 620 progress.setTotalWork(1); |
| 621 var requestId = this._manager.registerProgress(progress); | 621 var requestId = this._manager.registerProgress(progress); |
| 622 InspectorFrontendHost.indexPath(requestId, this._embedderPath); | 622 InspectorFrontendHost.indexPath(requestId, this._embedderPath); |
| 623 } | 623 } |
| 624 }; | 624 }; |
| 625 | 625 |
| 626 Workspace.IsolatedFileSystem.ImageExtensions = | 626 Workspace.IsolatedFileSystem.ImageExtensions = |
| 627 new Set(['jpeg', 'jpg', 'svg', 'gif', 'webp', 'png', 'ico', 'tiff', 'tif', '
bmp']); | 627 new Set(['jpeg', 'jpg', 'svg', 'gif', 'webp', 'png', 'ico', 'tiff', 'tif', '
bmp']); |
| OLD | NEW |