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_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ | 5 #ifndef WEBKIT_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ |
6 #define WEBKIT_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ | 6 #define WEBKIT_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 10 matching lines...) Expand all Loading... |
21 } | 21 } |
22 | 22 |
23 namespace chromeos { | 23 namespace chromeos { |
24 | 24 |
25 class FileAccessPermissions; | 25 class FileAccessPermissions; |
26 | 26 |
27 // An interface to provide local filesystem paths. | 27 // An interface to provide local filesystem paths. |
28 class CrosMountPointProvider | 28 class CrosMountPointProvider |
29 : public fileapi::ExternalFileSystemMountPointProvider { | 29 : public fileapi::ExternalFileSystemMountPointProvider { |
30 public: | 30 public: |
| 31 using fileapi::FileSystemMountPointProvider::ValidateFileSystemCallback; |
| 32 using fileapi::FileSystemMountPointProvider::DeleteFileSystemCallback; |
| 33 |
31 // Mount point file system location enum. | 34 // Mount point file system location enum. |
32 enum FileSystemLocation { | 35 enum FileSystemLocation { |
33 // File system that is locally mounted by the underlying OS. | 36 // File system that is locally mounted by the underlying OS. |
34 LOCAL, | 37 LOCAL, |
35 // File system that is remotely hosted on the net. | 38 // File system that is remotely hosted on the net. |
36 REMOTE, | 39 REMOTE, |
37 }; | 40 }; |
38 | 41 |
39 typedef fileapi::FileSystemMountPointProvider::ValidateFileSystemCallback | |
40 ValidateFileSystemCallback; | |
41 | |
42 CrosMountPointProvider( | 42 CrosMountPointProvider( |
43 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy); | 43 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy); |
44 virtual ~CrosMountPointProvider(); | 44 virtual ~CrosMountPointProvider(); |
45 | 45 |
46 // fileapi::FileSystemMountPointProvider overrides. | 46 // fileapi::FileSystemMountPointProvider overrides. |
47 virtual void ValidateFileSystemRoot( | 47 virtual void ValidateFileSystemRoot( |
48 const GURL& origin_url, | 48 const GURL& origin_url, |
49 fileapi::FileSystemType type, | 49 fileapi::FileSystemType type, |
50 bool create, | 50 bool create, |
51 const ValidateFileSystemCallback& callback) OVERRIDE; | 51 const ValidateFileSystemCallback& callback) OVERRIDE; |
52 virtual FilePath GetFileSystemRootPathOnFileThread( | 52 virtual FilePath GetFileSystemRootPathOnFileThread( |
53 const GURL& origin_url, | 53 const GURL& origin_url, |
54 fileapi::FileSystemType type, | 54 fileapi::FileSystemType type, |
55 const FilePath& virtual_path, | 55 const FilePath& virtual_path, |
56 bool create) OVERRIDE; | 56 bool create) OVERRIDE; |
57 virtual bool IsAccessAllowed( | 57 virtual bool IsAccessAllowed( |
58 const GURL& origin_url, | 58 const GURL& origin_url, |
59 fileapi::FileSystemType type, | 59 fileapi::FileSystemType type, |
60 const FilePath& virtual_path) OVERRIDE; | 60 const FilePath& virtual_path) OVERRIDE; |
61 virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE; | 61 virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE; |
62 virtual fileapi::FileSystemFileUtil* GetFileUtil( | 62 virtual fileapi::FileSystemFileUtil* GetFileUtil( |
63 fileapi::FileSystemType type) OVERRIDE; | 63 fileapi::FileSystemType type) OVERRIDE; |
64 virtual FilePath GetPathForPermissionsCheck(const FilePath& virtual_path) | 64 virtual FilePath GetPathForPermissionsCheck(const FilePath& virtual_path) |
65 const OVERRIDE; | 65 const OVERRIDE; |
66 virtual fileapi::FileSystemOperationInterface* CreateFileSystemOperation( | 66 virtual fileapi::FileSystemOperationInterface* CreateFileSystemOperation( |
67 const fileapi::FileSystemURL& url, | 67 const fileapi::FileSystemURL& url, |
68 fileapi::FileSystemContext* context) const OVERRIDE; | 68 fileapi::FileSystemContext* context) const OVERRIDE; |
69 virtual webkit_blob::FileStreamReader* CreateFileStreamReader( | 69 virtual webkit_blob::FileStreamReader* CreateFileStreamReader( |
70 const fileapi::FileSystemURL& path, | 70 const fileapi::FileSystemURL& path, |
71 int64 offset, | 71 int64 offset, |
72 fileapi::FileSystemContext* context) const OVERRIDE; | 72 fileapi::FileSystemContext* context) const OVERRIDE; |
73 virtual fileapi::FileStreamWriter* CreateFileStreamWriter( | 73 virtual fileapi::FileStreamWriter* CreateFileStreamWriter( |
74 const fileapi::FileSystemURL& url, | 74 const fileapi::FileSystemURL& url, |
75 int64 offset, | 75 int64 offset, |
76 fileapi::FileSystemContext* context) const OVERRIDE; | 76 fileapi::FileSystemContext* context) const OVERRIDE; |
77 virtual fileapi::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; | 77 virtual fileapi::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; |
| 78 virtual void DeleteFileSystem( |
| 79 const GURL& origin_url, |
| 80 fileapi::FileSystemType type, |
| 81 fileapi::FileSystemContext* context, |
| 82 const DeleteFileSystemCallback& callback) OVERRIDE; |
78 | 83 |
79 // fileapi::ExternalFileSystemMountPointProvider overrides. | 84 // fileapi::ExternalFileSystemMountPointProvider overrides. |
80 virtual std::vector<FilePath> GetRootDirectories() const OVERRIDE; | 85 virtual std::vector<FilePath> GetRootDirectories() const OVERRIDE; |
81 virtual void GrantFullAccessToExtension( | 86 virtual void GrantFullAccessToExtension( |
82 const std::string& extension_id) OVERRIDE; | 87 const std::string& extension_id) OVERRIDE; |
83 virtual void GrantFileAccessToExtension( | 88 virtual void GrantFileAccessToExtension( |
84 const std::string& extension_id, const FilePath& virtual_path) OVERRIDE; | 89 const std::string& extension_id, const FilePath& virtual_path) OVERRIDE; |
85 virtual void RevokeAccessForExtension( | 90 virtual void RevokeAccessForExtension( |
86 const std::string& extension_id) OVERRIDE; | 91 const std::string& extension_id) OVERRIDE; |
87 virtual bool HasMountPoint(const FilePath& mount_point) OVERRIDE; | 92 virtual bool HasMountPoint(const FilePath& mount_point) OVERRIDE; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 MountPointMap mount_point_map_; | 134 MountPointMap mount_point_map_; |
130 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; | 135 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
131 scoped_ptr<FileAccessPermissions> file_access_permissions_; | 136 scoped_ptr<FileAccessPermissions> file_access_permissions_; |
132 scoped_ptr<fileapi::LocalFileUtil> local_file_util_; | 137 scoped_ptr<fileapi::LocalFileUtil> local_file_util_; |
133 DISALLOW_COPY_AND_ASSIGN(CrosMountPointProvider); | 138 DISALLOW_COPY_AND_ASSIGN(CrosMountPointProvider); |
134 }; | 139 }; |
135 | 140 |
136 } // namespace chromeos | 141 } // namespace chromeos |
137 | 142 |
138 #endif // WEBKIT_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ | 143 #endif // WEBKIT_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ |
OLD | NEW |