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 |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/platform_file.h" | 13 #include "base/platform_file.h" |
| 14 #include "webkit/fileapi/file_permission_policy.h" |
14 #include "webkit/fileapi/file_system_types.h" | 15 #include "webkit/fileapi/file_system_types.h" |
15 #include "webkit/storage/webkit_storage_export.h" | 16 #include "webkit/storage/webkit_storage_export.h" |
16 | 17 |
17 namespace webkit_blob { | 18 namespace webkit_blob { |
18 class FileStreamReader; | 19 class FileStreamReader; |
19 } | 20 } |
20 | 21 |
21 namespace fileapi { | 22 namespace fileapi { |
22 | 23 |
23 class FileSystemURL; | 24 class FileSystemURL; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // Checks if access to |virtual_path| is allowed from |origin_url|. | 62 // Checks if access to |virtual_path| is allowed from |origin_url|. |
62 virtual bool IsAccessAllowed(const FileSystemURL& url) = 0; | 63 virtual bool IsAccessAllowed(const FileSystemURL& url) = 0; |
63 | 64 |
64 // Checks if a given |name| contains any restricted names/chars in it. | 65 // Checks if a given |name| contains any restricted names/chars in it. |
65 // Callable on any thread. | 66 // Callable on any thread. |
66 virtual bool IsRestrictedFileName(const FilePath& filename) const = 0; | 67 virtual bool IsRestrictedFileName(const FilePath& filename) const = 0; |
67 | 68 |
68 // Returns the specialized FileSystemFileUtil for this mount point. | 69 // Returns the specialized FileSystemFileUtil for this mount point. |
69 virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) = 0; | 70 virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) = 0; |
70 | 71 |
71 // Returns file path we should use to check access permissions for | 72 // Returns file permission policy we should apply for the given |url|. |
72 // |virtual_path|. | 73 virtual FilePermissionPolicy GetPermissionPolicy( |
73 virtual FilePath GetPathForPermissionsCheck(const FilePath& virtual_path) | 74 const FileSystemURL& url, |
74 const = 0; | 75 int permissions) const = 0; |
75 | 76 |
76 // Returns a new instance of the specialized FileSystemOperation for this | 77 // Returns a new instance of the specialized FileSystemOperation for this |
77 // mount point based on the given triplet of |origin_url|, |file_system_type| | 78 // mount point based on the given triplet of |origin_url|, |file_system_type| |
78 // and |virtual_path|. On failure to create a file system operation, set | 79 // and |virtual_path|. On failure to create a file system operation, set |
79 // |error_code| correspondingly. | 80 // |error_code| correspondingly. |
80 // This method is usually dispatched by | 81 // This method is usually dispatched by |
81 // FileSystemContext::CreateFileSystemOperation. | 82 // FileSystemContext::CreateFileSystemOperation. |
82 virtual FileSystemOperation* CreateFileSystemOperation( | 83 virtual FileSystemOperation* CreateFileSystemOperation( |
83 const FileSystemURL& url, | 84 const FileSystemURL& url, |
84 FileSystemContext* context, | 85 FileSystemContext* context, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 virtual void RemoveMountPoint(const FilePath& mount_point) = 0; | 155 virtual void RemoveMountPoint(const FilePath& mount_point) = 0; |
155 // Gets virtual path by known filesystem path. Returns false when filesystem | 156 // Gets virtual path by known filesystem path. Returns false when filesystem |
156 // path is not exposed by this provider. | 157 // path is not exposed by this provider. |
157 virtual bool GetVirtualPath(const FilePath& file_system_path, | 158 virtual bool GetVirtualPath(const FilePath& file_system_path, |
158 FilePath* virtual_path) = 0; | 159 FilePath* virtual_path) = 0; |
159 }; | 160 }; |
160 | 161 |
161 } // namespace fileapi | 162 } // namespace fileapi |
162 | 163 |
163 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ | 164 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ |
OLD | NEW |