| 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/webkit_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 11 matching lines...) Expand all Loading... |
| 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 class LocalFileSyncContext; | 44 class LocalFileSyncContext; |
| 45 | 45 |
| 46 struct DefaultContextDeleter; | 46 struct DefaultContextDeleter; |
| 47 | 47 |
| 48 // This class keeps and provides a file system context for FileSystem API. | 48 // This class keeps and provides a file system context for FileSystem API. |
| 49 // An instance of this class is created and owned by profile. | 49 // An instance of this class is created and owned by profile. |
| 50 class FILEAPI_EXPORT FileSystemContext | 50 class WEBKIT_STORAGE_EXPORT FileSystemContext |
| 51 : public base::RefCountedThreadSafe<FileSystemContext, | 51 : public base::RefCountedThreadSafe<FileSystemContext, |
| 52 DefaultContextDeleter> { | 52 DefaultContextDeleter> { |
| 53 public: | 53 public: |
| 54 // task_runners->file_task_runner() is used as default TaskRunner. | 54 // task_runners->file_task_runner() is used as default TaskRunner. |
| 55 // Unless a MountPointProvider is overridden in CreateFileSystemOperation, | 55 // Unless a MountPointProvider is overridden in CreateFileSystemOperation, |
| 56 // it is used for all file operations and file related meta operations. | 56 // it is used for all file operations and file related meta operations. |
| 57 // The code assumes that | 57 // The code assumes that |
| 58 // task_runners->file_task_runner()->RunsTasksOnCurrentThread() | 58 // task_runners->file_task_runner()->RunsTasksOnCurrentThread() |
| 59 // returns false if the current task is not running on the thread that allows | 59 // returns false if the current task is not running on the thread that allows |
| 60 // blocking file operations (like SequencedWorkerPool implementation does). | 60 // blocking file operations (like SequencedWorkerPool implementation does). |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 209 |
| 210 struct DefaultContextDeleter { | 210 struct DefaultContextDeleter { |
| 211 static void Destruct(const FileSystemContext* context) { | 211 static void Destruct(const FileSystemContext* context) { |
| 212 context->DeleteOnCorrectThread(); | 212 context->DeleteOnCorrectThread(); |
| 213 } | 213 } |
| 214 }; | 214 }; |
| 215 | 215 |
| 216 } // namespace fileapi | 216 } // namespace fileapi |
| 217 | 217 |
| 218 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ | 218 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
| OLD | NEW |