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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 this._excludedFoldersSetting = WebInspector.settings.createLocalSetting("wor
kspaceExcludedFolders", {}); | 44 this._excludedFoldersSetting = WebInspector.settings.createLocalSetting("wor
kspaceExcludedFolders", {}); |
45 /** @type {!Set<string>} */ | 45 /** @type {!Set<string>} */ |
46 this._excludedFolders = new Set(this._excludedFoldersSetting.get()[path] ||
[]); | 46 this._excludedFolders = new Set(this._excludedFoldersSetting.get()[path] ||
[]); |
47 /** @type {!Set<string>} */ | 47 /** @type {!Set<string>} */ |
48 this._nonConfigurableExcludedFolders = new Set(); | 48 this._nonConfigurableExcludedFolders = new Set(); |
49 | 49 |
50 /** @type {!Set<string>} */ | 50 /** @type {!Set<string>} */ |
51 this._filePaths = new Set(); | 51 this._filePaths = new Set(); |
52 /** @type {!Set<string>} */ | 52 /** @type {!Set<string>} */ |
53 this._gitFolders = new Set(); | 53 this._gitFolders = new Set(); |
54 } | 54 }; |
55 | 55 |
56 WebInspector.IsolatedFileSystem.ImageExtensions = new Set(["jpeg", "jpg", "svg",
"gif", "webp", "png", "ico", "tiff", "tif", "bmp"]); | 56 WebInspector.IsolatedFileSystem.ImageExtensions = new Set(["jpeg", "jpg", "svg",
"gif", "webp", "png", "ico", "tiff", "tif", "bmp"]); |
57 | 57 |
58 /** | 58 /** |
59 * @constructor | 59 * @constructor |
60 * @param {!WebInspector.IsolatedFileSystemManager} manager | 60 * @param {!WebInspector.IsolatedFileSystemManager} manager |
61 * @param {string} path | 61 * @param {string} path |
62 * @param {string} embedderPath | 62 * @param {string} embedderPath |
63 * @param {string} name | 63 * @param {string} name |
64 * @param {string} rootURL | 64 * @param {string} rootURL |
(...skipping 20 matching lines...) Expand all Loading... |
85 if (projectText) { | 85 if (projectText) { |
86 try { | 86 try { |
87 var projectObject = JSON.parse(projectText); | 87 var projectObject = JSON.parse(projectText); |
88 fileSystem._initializeProject(typeof projectObject === "object"
? /** @type {!Object} */ (projectObject) : null); | 88 fileSystem._initializeProject(typeof projectObject === "object"
? /** @type {!Object} */ (projectObject) : null); |
89 } catch (e) { | 89 } catch (e) { |
90 WebInspector.console.error("Invalid project file: " + projectTex
t); | 90 WebInspector.console.error("Invalid project file: " + projectTex
t); |
91 } | 91 } |
92 } | 92 } |
93 return fileSystem._initializeFilePaths(); | 93 return fileSystem._initializeFilePaths(); |
94 } | 94 } |
95 } | 95 }; |
96 | 96 |
97 /** | 97 /** |
98 * @param {!DOMError} error | 98 * @param {!DOMError} error |
99 * @return {string} | 99 * @return {string} |
100 */ | 100 */ |
101 WebInspector.IsolatedFileSystem.errorMessage = function(error) | 101 WebInspector.IsolatedFileSystem.errorMessage = function(error) |
102 { | 102 { |
103 return WebInspector.UIString("File system error: %s", error.message); | 103 return WebInspector.UIString("File system error: %s", error.message); |
104 } | 104 }; |
105 | 105 |
106 WebInspector.IsolatedFileSystem.prototype = { | 106 WebInspector.IsolatedFileSystem.prototype = { |
107 /** | 107 /** |
108 * @param {string} path | 108 * @param {string} path |
109 * @return {!Promise<?{modificationTime: !Date, size: number}>} | 109 * @return {!Promise<?{modificationTime: !Date, size: number}>} |
110 */ | 110 */ |
111 getMetadata: function(path) | 111 getMetadata: function(path) |
112 { | 112 { |
113 var fulfill; | 113 var fulfill; |
114 var promise = new Promise(f => fulfill = f); | 114 var promise = new Promise(f => fulfill = f); |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 | 672 |
673 /** | 673 /** |
674 * @param {!WebInspector.Progress} progress | 674 * @param {!WebInspector.Progress} progress |
675 */ | 675 */ |
676 indexContent: function(progress) | 676 indexContent: function(progress) |
677 { | 677 { |
678 progress.setTotalWork(1); | 678 progress.setTotalWork(1); |
679 var requestId = this._manager.registerProgress(progress); | 679 var requestId = this._manager.registerProgress(progress); |
680 InspectorFrontendHost.indexPath(requestId, this._embedderPath); | 680 InspectorFrontendHost.indexPath(requestId, this._embedderPath); |
681 } | 681 } |
682 } | 682 }; |
OLD | NEW |