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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 const OVERRIDE; | 91 const OVERRIDE; |
92 virtual std::vector<base::FilePath> GetRootDirectories() const OVERRIDE; | 92 virtual std::vector<base::FilePath> GetRootDirectories() const OVERRIDE; |
93 virtual void GrantFullAccessToExtension( | 93 virtual void GrantFullAccessToExtension( |
94 const std::string& extension_id) OVERRIDE; | 94 const std::string& extension_id) OVERRIDE; |
95 virtual void GrantFileAccessToExtension( | 95 virtual void GrantFileAccessToExtension( |
96 const std::string& extension_id, | 96 const std::string& extension_id, |
97 const base::FilePath& virtual_path) OVERRIDE; | 97 const base::FilePath& virtual_path) OVERRIDE; |
98 virtual void RevokeAccessForExtension( | 98 virtual void RevokeAccessForExtension( |
99 const std::string& extension_id) OVERRIDE; | 99 const std::string& extension_id) OVERRIDE; |
100 virtual bool GetVirtualPath(const base::FilePath& filesystem_path, | 100 virtual bool GetVirtualPath(const base::FilePath& filesystem_path, |
101 base::FilePath* virtual_path) OVERRIDE; | 101 base::FilePath* virtual_path) const OVERRIDE; |
102 | 102 |
103 private: | 103 private: |
104 fileapi::RemoteFileSystemProxyInterface* GetRemoteProxy( | 104 fileapi::RemoteFileSystemProxyInterface* GetRemoteProxy( |
105 const std::string& mount_name) const; | 105 const fileapi::FileSystemURL& url) const; |
106 | 106 |
107 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; | 107 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
108 scoped_ptr<FileAccessPermissions> file_access_permissions_; | 108 scoped_ptr<FileAccessPermissions> file_access_permissions_; |
109 scoped_ptr<fileapi::AsyncFileUtilAdapter> local_file_util_; | 109 scoped_ptr<fileapi::AsyncFileUtilAdapter> local_file_util_; |
110 | 110 |
111 // Mount points specific to the owning context. | 111 // Mount points specific to the owning context. |
112 // | 112 // |
113 // Add/Remove MountPoints will affect only these mount points. | 113 // Add/Remove MountPoints will affect only these mount points. |
114 // | 114 // |
115 // It is legal to have mount points with the same name as in | 115 // It is legal to have mount points with the same name as in |
116 // system_mount_points_. Also, mount point paths may overlap with mount point | 116 // system_mount_points_. Also, mount point paths may overlap with mount point |
117 // paths in system_mount_points_. In both cases mount points in | 117 // paths in system_mount_points_. In both cases mount points in |
118 // |mount_points_| will have a priority. | 118 // |mount_points_| will have a priority. |
119 // E.g. if |mount_points_| map 'foo1' to '/foo/foo1' and | 119 // E.g. if |mount_points_| map 'foo1' to '/foo/foo1' and |
120 // |file_system_mount_points_| map 'xxx' to '/foo/foo1/xxx', |GetVirtualPaths| | 120 // |file_system_mount_points_| map 'xxx' to '/foo/foo1/xxx', |GetVirtualPaths| |
121 // will resolve '/foo/foo1/xxx/yyy' as 'foo1/xxx/yyy' (i.e. the mapping from | 121 // will resolve '/foo/foo1/xxx/yyy' as 'foo1/xxx/yyy' (i.e. the mapping from |
122 // |mount_points_| will be used). | 122 // |mount_points_| will be used). |
123 scoped_refptr<fileapi::ExternalMountPoints> mount_points_; | 123 scoped_refptr<fileapi::ExternalMountPoints> mount_points_; |
124 | 124 |
125 // Globally visible mount points. System MountPonts instance should outlive | 125 // Globally visible mount points. System MountPonts instance should outlive |
126 // all CrosMountPointProvider instances, so raw pointer is safe. | 126 // all CrosMountPointProvider instances, so raw pointer is safe. |
127 fileapi::ExternalMountPoints* system_mount_points_; | 127 fileapi::ExternalMountPoints* system_mount_points_; |
128 | 128 |
129 DISALLOW_COPY_AND_ASSIGN(CrosMountPointProvider); | 129 DISALLOW_COPY_AND_ASSIGN(CrosMountPointProvider); |
130 }; | 130 }; |
131 | 131 |
132 } // namespace chromeos | 132 } // namespace chromeos |
133 | 133 |
134 #endif // WEBKIT_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ | 134 #endif // WEBKIT_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ |
OLD | NEW |