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_FILE_SYSTEM_CONTEXT_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 namespace chrome { | 29 namespace chrome { |
30 class NativeMediaFileUtilTest; | 30 class NativeMediaFileUtilTest; |
31 } | 31 } |
32 | 32 |
33 namespace quota { | 33 namespace quota { |
34 class QuotaManagerProxy; | 34 class QuotaManagerProxy; |
35 class SpecialStoragePolicy; | 35 class SpecialStoragePolicy; |
36 } | 36 } |
37 | 37 |
38 namespace sync_file_system { | |
39 class LocalFileChangeTracker; | |
40 class LocalFileSyncContext; | |
41 } | |
42 | |
43 namespace webkit_blob { | 38 namespace webkit_blob { |
44 class BlobURLRequestJobTest; | 39 class BlobURLRequestJobTest; |
45 class FileStreamReader; | 40 class FileStreamReader; |
46 } | 41 } |
47 | 42 |
48 namespace fileapi { | 43 namespace fileapi { |
49 | 44 |
50 class AsyncFileUtil; | 45 class AsyncFileUtil; |
51 class CopyOrMoveFileValidatorFactory; | 46 class CopyOrMoveFileValidatorFactory; |
52 class ExternalFileSystemBackend; | 47 class ExternalFileSystemBackend; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 scoped_ptr<FileStreamWriter> CreateFileStreamWriter( | 197 scoped_ptr<FileStreamWriter> CreateFileStreamWriter( |
203 const FileSystemURL& url, | 198 const FileSystemURL& url, |
204 int64 offset); | 199 int64 offset); |
205 | 200 |
206 FileSystemTaskRunners* task_runners() { return task_runners_.get(); } | 201 FileSystemTaskRunners* task_runners() { return task_runners_.get(); } |
207 | 202 |
208 FileSystemOperationRunner* operation_runner() { | 203 FileSystemOperationRunner* operation_runner() { |
209 return operation_runner_.get(); | 204 return operation_runner_.get(); |
210 } | 205 } |
211 | 206 |
212 sync_file_system::LocalFileChangeTracker* change_tracker() { | |
213 return change_tracker_.get(); | |
214 } | |
215 void SetLocalFileChangeTracker( | |
216 scoped_ptr<sync_file_system::LocalFileChangeTracker> tracker); | |
217 | |
218 sync_file_system::LocalFileSyncContext* sync_context() { | |
219 return sync_context_.get(); | |
220 } | |
221 void set_sync_context(sync_file_system::LocalFileSyncContext* sync_context); | |
222 | |
223 const base::FilePath& partition_path() const { return partition_path_; } | 207 const base::FilePath& partition_path() const { return partition_path_; } |
224 | 208 |
225 // Same as |CrackFileSystemURL|, but cracks FileSystemURL created from |url|. | 209 // Same as |CrackFileSystemURL|, but cracks FileSystemURL created from |url|. |
226 FileSystemURL CrackURL(const GURL& url) const; | 210 FileSystemURL CrackURL(const GURL& url) const; |
227 // Same as |CrackFileSystemURL|, but cracks FileSystemURL created from method | 211 // Same as |CrackFileSystemURL|, but cracks FileSystemURL created from method |
228 // arguments. | 212 // arguments. |
229 FileSystemURL CreateCrackedFileSystemURL(const GURL& origin, | 213 FileSystemURL CreateCrackedFileSystemURL(const GURL& origin, |
230 FileSystemType type, | 214 FileSystemType type, |
231 const base::FilePath& path) const; | 215 const base::FilePath& path) const; |
232 | 216 |
233 #if defined(OS_CHROMEOS) && defined(GOOGLE_CHROME_BUILD) | 217 #if defined(OS_CHROMEOS) && defined(GOOGLE_CHROME_BUILD) |
234 // Used only on ChromeOS for now. | 218 // Used only on ChromeOS for now. |
235 void EnableTemporaryFileSystemInIncognito(); | 219 void EnableTemporaryFileSystemInIncognito(); |
236 #endif | 220 #endif |
237 | 221 |
| 222 SandboxContext* sandbox_context() const { return sandbox_context_.get(); } |
| 223 |
238 private: | 224 private: |
239 typedef std::map<FileSystemType, FileSystemBackend*> | 225 typedef std::map<FileSystemType, FileSystemBackend*> |
240 FileSystemBackendMap; | 226 FileSystemBackendMap; |
241 | 227 |
242 // For CreateFileSystemOperation. | 228 // For CreateFileSystemOperation. |
243 friend class FileSystemOperationRunner; | 229 friend class FileSystemOperationRunner; |
244 | 230 |
245 // For sandbox_backend(). | 231 // For sandbox_backend(). |
246 friend class SandboxFileSystemTestHelper; | 232 friend class SandboxFileSystemTestHelper; |
247 | 233 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 // external mount points). | 294 // external mount points). |
309 scoped_refptr<ExternalMountPoints> external_mount_points_; | 295 scoped_refptr<ExternalMountPoints> external_mount_points_; |
310 | 296 |
311 // MountPoints used to crack FileSystemURLs. The MountPoints are ordered | 297 // MountPoints used to crack FileSystemURLs. The MountPoints are ordered |
312 // in order they should try to crack a FileSystemURL. | 298 // in order they should try to crack a FileSystemURL. |
313 std::vector<MountPoints*> url_crackers_; | 299 std::vector<MountPoints*> url_crackers_; |
314 | 300 |
315 // The base path of the storage partition for this context. | 301 // The base path of the storage partition for this context. |
316 const base::FilePath partition_path_; | 302 const base::FilePath partition_path_; |
317 | 303 |
318 // For syncable file systems. | |
319 scoped_ptr<sync_file_system::LocalFileChangeTracker> change_tracker_; | |
320 scoped_refptr<sync_file_system::LocalFileSyncContext> sync_context_; | |
321 | |
322 scoped_ptr<FileSystemOperationRunner> operation_runner_; | 304 scoped_ptr<FileSystemOperationRunner> operation_runner_; |
323 | 305 |
324 DISALLOW_IMPLICIT_CONSTRUCTORS(FileSystemContext); | 306 DISALLOW_IMPLICIT_CONSTRUCTORS(FileSystemContext); |
325 }; | 307 }; |
326 | 308 |
327 struct DefaultContextDeleter { | 309 struct DefaultContextDeleter { |
328 static void Destruct(const FileSystemContext* context) { | 310 static void Destruct(const FileSystemContext* context) { |
329 context->DeleteOnCorrectThread(); | 311 context->DeleteOnCorrectThread(); |
330 } | 312 } |
331 }; | 313 }; |
332 | 314 |
333 } // namespace fileapi | 315 } // namespace fileapi |
334 | 316 |
335 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ | 317 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
OLD | NEW |