OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 void CollectOpenFileSystemMetrics(base::PlatformFileError error_code); | 159 void CollectOpenFileSystemMetrics(base::PlatformFileError error_code); |
160 | 160 |
161 // Performs API-specific validity checks on the given path |url|. | 161 // Performs API-specific validity checks on the given path |url|. |
162 // Returns true if access to |url| is valid in this filesystem. | 162 // Returns true if access to |url| is valid in this filesystem. |
163 bool IsAccessValid(const FileSystemURL& url) const; | 163 bool IsAccessValid(const FileSystemURL& url) const; |
164 | 164 |
165 void set_enable_temporary_file_system_in_incognito(bool enable) { | 165 void set_enable_temporary_file_system_in_incognito(bool enable) { |
166 enable_temporary_file_system_in_incognito_ = enable; | 166 enable_temporary_file_system_in_incognito_ = enable; |
167 } | 167 } |
168 | 168 |
| 169 protected: |
| 170 SandboxContext* sandbox_context() { return sandbox_context_; } |
| 171 void set_sandbox_context(SandboxContext* sandbox_context) { |
| 172 sandbox_context_ = sandbox_context; |
| 173 } |
| 174 |
| 175 const UpdateObserverList* update_observers() const { |
| 176 return &update_observers_; |
| 177 } |
| 178 void set_update_observers(const UpdateObserverList& update_observers) { |
| 179 update_observers_ = update_observers; |
| 180 } |
| 181 |
| 182 const ChangeObserverList* change_observers() const { |
| 183 return &change_observers_; |
| 184 } |
| 185 |
| 186 const AccessObserverList* access_observers() const { |
| 187 return &access_observers_; |
| 188 } |
| 189 void set_access_observers(const AccessObserverList& access_observers) { |
| 190 access_observers_ = access_observers; |
| 191 } |
| 192 |
169 private: | 193 private: |
170 friend class SandboxQuotaObserver; | 194 friend class SandboxQuotaObserver; |
171 friend class SandboxFileSystemTestHelper; | 195 friend class SandboxFileSystemTestHelper; |
172 friend class SandboxFileSystemBackendMigrationTest; | 196 friend class SandboxFileSystemBackendMigrationTest; |
173 friend class SandboxFileSystemBackendOriginEnumeratorTest; | 197 friend class SandboxFileSystemBackendOriginEnumeratorTest; |
174 | 198 |
175 // Returns a path to the usage cache file. | 199 // Returns a path to the usage cache file. |
176 base::FilePath GetUsageCachePathForOriginAndType( | 200 base::FilePath GetUsageCachePathForOriginAndType( |
177 const GURL& origin_url, | 201 const GURL& origin_url, |
178 FileSystemType type); | 202 FileSystemType type); |
(...skipping 28 matching lines...) Expand all Loading... |
207 bool enable_temporary_file_system_in_incognito_; | 231 bool enable_temporary_file_system_in_incognito_; |
208 | 232 |
209 // Acccessed only on the file thread. | 233 // Acccessed only on the file thread. |
210 std::set<GURL> visited_origins_; | 234 std::set<GURL> visited_origins_; |
211 | 235 |
212 // Observers. | 236 // Observers. |
213 UpdateObserverList update_observers_; | 237 UpdateObserverList update_observers_; |
214 ChangeObserverList change_observers_; | 238 ChangeObserverList change_observers_; |
215 AccessObserverList access_observers_; | 239 AccessObserverList access_observers_; |
216 | 240 |
217 // Observers for syncable file systems. | |
218 UpdateObserverList syncable_update_observers_; | |
219 ChangeObserverList syncable_change_observers_; | |
220 | |
221 base::Time next_release_time_for_open_filesystem_stat_; | 241 base::Time next_release_time_for_open_filesystem_stat_; |
222 | 242 |
223 std::set<std::pair<GURL, FileSystemType> > sticky_dirty_origins_; | 243 std::set<std::pair<GURL, FileSystemType> > sticky_dirty_origins_; |
224 | 244 |
225 base::WeakPtrFactory<SandboxFileSystemBackend> weak_factory_; | 245 base::WeakPtrFactory<SandboxFileSystemBackend> weak_factory_; |
226 | 246 |
227 DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackend); | 247 DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackend); |
228 }; | 248 }; |
229 | 249 |
230 } // namespace fileapi | 250 } // namespace fileapi |
231 | 251 |
232 #endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_H_ | 252 #endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_H_ |
OLD | NEW |