| 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 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // Returns a FileSystemMountPointProvider instance for external filesystem | 101 // Returns a FileSystemMountPointProvider instance for external filesystem |
| 102 // type, which is used only by chromeos for now. This is equivalent to | 102 // type, which is used only by chromeos for now. This is equivalent to |
| 103 // calling GetMountPointProvider(kFileSystemTypeExternal). | 103 // calling GetMountPointProvider(kFileSystemTypeExternal). |
| 104 ExternalFileSystemMountPointProvider* external_provider() const; | 104 ExternalFileSystemMountPointProvider* external_provider() const; |
| 105 | 105 |
| 106 // Used for OpenFileSystem. | 106 // Used for OpenFileSystem. |
| 107 typedef base::Callback<void(base::PlatformFileError result, | 107 typedef base::Callback<void(base::PlatformFileError result, |
| 108 const std::string& name, | 108 const std::string& name, |
| 109 const GURL& root)> OpenFileSystemCallback; | 109 const GURL& root)> OpenFileSystemCallback; |
| 110 | 110 |
| 111 // Used for DeleteFileSystem. |
| 112 typedef base::Callback<void(base::PlatformFileError result)> |
| 113 DeleteFileSystemCallback; |
| 114 |
| 111 // Opens the filesystem for the given |origin_url| and |type|, and dispatches | 115 // Opens the filesystem for the given |origin_url| and |type|, and dispatches |
| 112 // the DidOpenFileSystem callback of the given |dispatcher|. | 116 // the DidOpenFileSystem callback of the given |dispatcher|. |
| 113 // If |create| is true this may actually set up a filesystem instance | 117 // If |create| is true this may actually set up a filesystem instance |
| 114 // (e.g. by creating the root directory or initializing the database | 118 // (e.g. by creating the root directory or initializing the database |
| 115 // entry etc). | 119 // entry etc). |
| 116 void OpenFileSystem( | 120 void OpenFileSystem( |
| 117 const GURL& origin_url, | 121 const GURL& origin_url, |
| 118 FileSystemType type, | 122 FileSystemType type, |
| 119 bool create, | 123 bool create, |
| 120 OpenFileSystemCallback callback); | 124 const OpenFileSystemCallback& callback); |
| 125 |
| 126 // Deletes the filesystem for the given |origin_url| and |type|. |
| 127 void DeleteFileSystem( |
| 128 const GURL& origin_url, |
| 129 FileSystemType type, |
| 130 const DeleteFileSystemCallback& callback); |
| 121 | 131 |
| 122 // Creates a new FileSystemOperation instance by cracking | 132 // Creates a new FileSystemOperation instance by cracking |
| 123 // the given filesystem URL |url| to get an appropriate MountPointProvider | 133 // the given filesystem URL |url| to get an appropriate MountPointProvider |
| 124 // and calling the provider's corresponding CreateFileSystemOperation method. | 134 // and calling the provider's corresponding CreateFileSystemOperation method. |
| 125 // The resolved MountPointProvider could perform further specialization | 135 // The resolved MountPointProvider could perform further specialization |
| 126 // depending on the filesystem type pointed by the |url|. | 136 // depending on the filesystem type pointed by the |url|. |
| 127 FileSystemOperationInterface* CreateFileSystemOperation( | 137 FileSystemOperationInterface* CreateFileSystemOperation( |
| 128 const FileSystemURL& url); | 138 const FileSystemURL& url); |
| 129 | 139 |
| 130 // Creates new FileStreamReader instance to read a file pointed by the given | 140 // Creates new FileStreamReader instance to read a file pointed by the given |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 179 |
| 170 struct DefaultContextDeleter { | 180 struct DefaultContextDeleter { |
| 171 static void Destruct(const FileSystemContext* context) { | 181 static void Destruct(const FileSystemContext* context) { |
| 172 context->DeleteOnCorrectThread(); | 182 context->DeleteOnCorrectThread(); |
| 173 } | 183 } |
| 174 }; | 184 }; |
| 175 | 185 |
| 176 } // namespace fileapi | 186 } // namespace fileapi |
| 177 | 187 |
| 178 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ | 188 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ |
| OLD | NEW |