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_BACKEND_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 class FileSystemQuotaUtil; | 35 class FileSystemQuotaUtil; |
36 class RemoteFileSystemProxyInterface; | 36 class RemoteFileSystemProxyInterface; |
37 | 37 |
38 // An interface for defining a file system backend. | 38 // An interface for defining a file system backend. |
39 // | 39 // |
40 // NOTE: when you implement a new FileSystemBackend for your own | 40 // NOTE: when you implement a new FileSystemBackend for your own |
41 // FileSystem module, please contact to kinuko@chromium.org. | 41 // FileSystem module, please contact to kinuko@chromium.org. |
42 // | 42 // |
43 class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemBackend { | 43 class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemBackend { |
44 public: | 44 public: |
45 // Callback for OpenFileSystem. | 45 // Callback for InitializeFileSystem. |
46 typedef base::Callback<void(const GURL& root_url, | 46 typedef base::Callback<void(const GURL& root_url, |
47 const std::string& name, | 47 const std::string& name, |
48 base::PlatformFileError error)> | 48 base::PlatformFileError error)> |
49 OpenFileSystemCallback; | 49 InitializeFileSystemCallback; |
50 virtual ~FileSystemBackend() {} | 50 virtual ~FileSystemBackend() {} |
51 | 51 |
52 // Returns true if this mount point provider can handle |type|. | 52 // Returns true if this mount point provider can handle |type|. |
53 // One mount point provider may be able to handle multiple filesystem types. | 53 // One mount point provider may be able to handle multiple filesystem types. |
54 virtual bool CanHandleType(FileSystemType type) const = 0; | 54 virtual bool CanHandleType(FileSystemType type) const = 0; |
55 | 55 |
56 // Initializes the filesystem for the given |origin_url| and |type|. | 56 // Initializes the filesystem for the given |origin_url| and |type|. |
57 // This verifies if it is allowed to request (or create) the filesystem | 57 // This verifies if it is allowed to request (or create) the filesystem |
58 // and if it can access (or create) the root directory of the mount point. | 58 // and if it can access (or create) the root directory of the mount point. |
59 // If |mode| is CREATE_IF_NONEXISTENT calling this may also create | 59 // If |mode| is CREATE_IF_NONEXISTENT calling this may also create |
60 // the root directory (and/or related database entries etc) for | 60 // the root directory (and/or related database entries etc) for |
61 // the filesystem if it doesn't exist. | 61 // the filesystem if it doesn't exist. |
62 virtual void OpenFileSystem( | 62 virtual void InitializeFileSystem( |
63 const GURL& origin_url, | 63 const GURL& origin_url, |
64 FileSystemType type, | 64 FileSystemType type, |
65 OpenFileSystemMode mode, | 65 OpenFileSystemMode mode, |
66 const OpenFileSystemCallback& callback) = 0; | 66 FileSystemContext* context, |
| 67 const InitializeFileSystemCallback& callback) = 0; |
67 | 68 |
68 // Returns the specialized FileSystemFileUtil for this mount point. | 69 // Returns the specialized FileSystemFileUtil for this mount point. |
69 // It is ok to return NULL if the filesystem doesn't support synchronous | 70 // It is ok to return NULL if the filesystem doesn't support synchronous |
70 // version of FileUtil. | 71 // version of FileUtil. |
71 virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) = 0; | 72 virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) = 0; |
72 | 73 |
73 // Returns the specialized AsyncFileUtil for this mount point. | 74 // Returns the specialized AsyncFileUtil for this mount point. |
74 virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) = 0; | 75 virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) = 0; |
75 | 76 |
76 // Returns the specialized CopyOrMoveFileValidatorFactory for this mount | 77 // Returns the specialized CopyOrMoveFileValidatorFactory for this mount |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 const std::string& extension_id) = 0; | 143 const std::string& extension_id) = 0; |
143 // Gets virtual path by known filesystem path. Returns false when filesystem | 144 // Gets virtual path by known filesystem path. Returns false when filesystem |
144 // path is not exposed by this provider. | 145 // path is not exposed by this provider. |
145 virtual bool GetVirtualPath(const base::FilePath& file_system_path, | 146 virtual bool GetVirtualPath(const base::FilePath& file_system_path, |
146 base::FilePath* virtual_path) = 0; | 147 base::FilePath* virtual_path) = 0; |
147 }; | 148 }; |
148 | 149 |
149 } // namespace fileapi | 150 } // namespace fileapi |
150 | 151 |
151 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ | 152 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ |
OLD | NEW |