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_MOUNT_POINT_PROVIDER_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ |
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 // and specialized FileSystemFileUtil instance. | 36 // and specialized FileSystemFileUtil instance. |
37 class WEBKIT_STORAGE_EXPORT FileSystemMountPointProvider { | 37 class WEBKIT_STORAGE_EXPORT FileSystemMountPointProvider { |
38 public: | 38 public: |
39 // Callback for ValidateFileSystemRoot. | 39 // Callback for ValidateFileSystemRoot. |
40 typedef base::Callback<void(base::PlatformFileError error)> | 40 typedef base::Callback<void(base::PlatformFileError error)> |
41 ValidateFileSystemCallback; | 41 ValidateFileSystemCallback; |
42 typedef base::Callback<void(base::PlatformFileError error)> | 42 typedef base::Callback<void(base::PlatformFileError error)> |
43 DeleteFileSystemCallback; | 43 DeleteFileSystemCallback; |
44 virtual ~FileSystemMountPointProvider() {} | 44 virtual ~FileSystemMountPointProvider() {} |
45 | 45 |
| 46 // Returns true if this mount point provider can handle |type|. |
| 47 // One mount point provider may be able to handle multiple filesystem types. |
| 48 virtual bool CanHandleType(FileSystemType type) const = 0; |
| 49 |
46 // Validates the filesystem for the given |origin_url| and |type|. | 50 // Validates the filesystem for the given |origin_url| and |type|. |
47 // This verifies if it is allowed to request (or create) the filesystem | 51 // This verifies if it is allowed to request (or create) the filesystem |
48 // and if it can access (or create) the root directory of the mount point. | 52 // and if it can access (or create) the root directory of the mount point. |
49 // If |create| is true this may also create the root directory for | 53 // If |create| is true this may also create the root directory for |
50 // the filesystem if it doesn't exist. | 54 // the filesystem if it doesn't exist. |
51 virtual void ValidateFileSystemRoot( | 55 virtual void ValidateFileSystemRoot( |
52 const GURL& origin_url, | 56 const GURL& origin_url, |
53 FileSystemType type, | 57 FileSystemType type, |
54 bool create, | 58 bool create, |
55 const ValidateFileSystemCallback& callback) = 0; | 59 const ValidateFileSystemCallback& callback) = 0; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 const std::string& extension_id) = 0; | 164 const std::string& extension_id) = 0; |
161 // Gets virtual path by known filesystem path. Returns false when filesystem | 165 // Gets virtual path by known filesystem path. Returns false when filesystem |
162 // path is not exposed by this provider. | 166 // path is not exposed by this provider. |
163 virtual bool GetVirtualPath(const base::FilePath& file_system_path, | 167 virtual bool GetVirtualPath(const base::FilePath& file_system_path, |
164 base::FilePath* virtual_path) = 0; | 168 base::FilePath* virtual_path) = 0; |
165 }; | 169 }; |
166 | 170 |
167 } // namespace fileapi | 171 } // namespace fileapi |
168 | 172 |
169 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ | 173 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ |
OLD | NEW |