| 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_FILEAPI_FILE_SYSTEM_CONTEXT_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
| 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/platform_file.h" | 14 #include "base/platform_file.h" |
| 15 #include "base/sequenced_task_runner_helpers.h" | 15 #include "base/sequenced_task_runner_helpers.h" |
| 16 #include "webkit/fileapi/file_system_types.h" | 16 #include "webkit/fileapi/file_system_types.h" |
| 17 #include "webkit/fileapi/fileapi_export.h" | |
| 18 #include "webkit/fileapi/task_runner_bound_observer_list.h" | 17 #include "webkit/fileapi/task_runner_bound_observer_list.h" |
| 18 #include "webkit/storage/storage_export.h" |
| 19 | 19 |
| 20 class FilePath; | 20 class FilePath; |
| 21 | 21 |
| 22 namespace quota { | 22 namespace quota { |
| 23 class QuotaManagerProxy; | 23 class QuotaManagerProxy; |
| 24 class SpecialStoragePolicy; | 24 class SpecialStoragePolicy; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace webkit_blob { | 27 namespace webkit_blob { |
| 28 class FileStreamReader; | 28 class FileStreamReader; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 39 class FileSystemTaskRunners; | 39 class FileSystemTaskRunners; |
| 40 class FileSystemURL; | 40 class FileSystemURL; |
| 41 class IsolatedMountPointProvider; | 41 class IsolatedMountPointProvider; |
| 42 class LocalFileChangeTracker; | 42 class LocalFileChangeTracker; |
| 43 class SandboxMountPointProvider; | 43 class SandboxMountPointProvider; |
| 44 | 44 |
| 45 struct DefaultContextDeleter; | 45 struct DefaultContextDeleter; |
| 46 | 46 |
| 47 // This class keeps and provides a file system context for FileSystem API. | 47 // This class keeps and provides a file system context for FileSystem API. |
| 48 // An instance of this class is created and owned by profile. | 48 // An instance of this class is created and owned by profile. |
| 49 class FILEAPI_EXPORT FileSystemContext | 49 class STORAGE_EXPORT FileSystemContext |
| 50 : public base::RefCountedThreadSafe<FileSystemContext, | 50 : public base::RefCountedThreadSafe<FileSystemContext, |
| 51 DefaultContextDeleter> { | 51 DefaultContextDeleter> { |
| 52 public: | 52 public: |
| 53 // task_runners->file_task_runner() is used as default TaskRunner. | 53 // task_runners->file_task_runner() is used as default TaskRunner. |
| 54 // Unless a MountPointProvider is overridden in CreateFileSystemOperation, | 54 // Unless a MountPointProvider is overridden in CreateFileSystemOperation, |
| 55 // it is used for all file operations and file related meta operations. | 55 // it is used for all file operations and file related meta operations. |
| 56 // The code assumes that | 56 // The code assumes that |
| 57 // task_runners->file_task_runner()->RunsTasksOnCurrentThread() | 57 // task_runners->file_task_runner()->RunsTasksOnCurrentThread() |
| 58 // returns false if the current task is not running on the thread that allows | 58 // returns false if the current task is not running on the thread that allows |
| 59 // blocking file operations (like SequencedWorkerPool implementation does). | 59 // blocking file operations (like SequencedWorkerPool implementation does). |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 199 |
| 200 struct DefaultContextDeleter { | 200 struct DefaultContextDeleter { |
| 201 static void Destruct(const FileSystemContext* context) { | 201 static void Destruct(const FileSystemContext* context) { |
| 202 context->DeleteOnCorrectThread(); | 202 context->DeleteOnCorrectThread(); |
| 203 } | 203 } |
| 204 }; | 204 }; |
| 205 | 205 |
| 206 } // namespace fileapi | 206 } // namespace fileapi |
| 207 | 207 |
| 208 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ | 208 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
| OLD | NEW |