OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_H_ |
6 #define CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 using fileapi::FileSystemBackend::OpenFileSystemCallback; | 63 using fileapi::FileSystemBackend::OpenFileSystemCallback; |
64 | 64 |
65 // FileSystemBackend will take an ownership of a |mount_points| | 65 // FileSystemBackend will take an ownership of a |mount_points| |
66 // reference. On the other hand, |system_mount_points| will be kept as a raw | 66 // reference. On the other hand, |system_mount_points| will be kept as a raw |
67 // pointer and it should outlive FileSystemBackend instance. | 67 // pointer and it should outlive FileSystemBackend instance. |
68 // The ownerships of |drive_delegate| and |file_system_provider_delegate| are | 68 // The ownerships of |drive_delegate| and |file_system_provider_delegate| are |
69 // also taken. | 69 // also taken. |
70 FileSystemBackend( | 70 FileSystemBackend( |
71 FileSystemBackendDelegate* drive_delegate, | 71 FileSystemBackendDelegate* drive_delegate, |
72 FileSystemBackendDelegate* file_system_provider_delegate, | 72 FileSystemBackendDelegate* file_system_provider_delegate, |
| 73 FileSystemBackendDelegate* mtp_delegate, |
73 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy, | 74 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy, |
74 scoped_refptr<fileapi::ExternalMountPoints> mount_points, | 75 scoped_refptr<fileapi::ExternalMountPoints> mount_points, |
75 fileapi::ExternalMountPoints* system_mount_points); | 76 fileapi::ExternalMountPoints* system_mount_points); |
76 virtual ~FileSystemBackend(); | 77 virtual ~FileSystemBackend(); |
77 | 78 |
78 // Adds system mount points, such as "archive", and "removable". This | 79 // Adds system mount points, such as "archive", and "removable". This |
79 // function is no-op if these mount points are already present. | 80 // function is no-op if these mount points are already present. |
80 void AddSystemMountPoints(); | 81 void AddSystemMountPoints(); |
81 | 82 |
82 // Returns true if CrosMountpointProvider can handle |url|, i.e. its | 83 // Returns true if CrosMountpointProvider can handle |url|, i.e. its |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; | 132 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
132 scoped_ptr<FileAccessPermissions> file_access_permissions_; | 133 scoped_ptr<FileAccessPermissions> file_access_permissions_; |
133 scoped_ptr<fileapi::AsyncFileUtil> local_file_util_; | 134 scoped_ptr<fileapi::AsyncFileUtil> local_file_util_; |
134 | 135 |
135 // The delegate instance for the drive file system related operations. | 136 // The delegate instance for the drive file system related operations. |
136 scoped_ptr<FileSystemBackendDelegate> drive_delegate_; | 137 scoped_ptr<FileSystemBackendDelegate> drive_delegate_; |
137 | 138 |
138 // The delegate instance for the provided file system related operations. | 139 // The delegate instance for the provided file system related operations. |
139 scoped_ptr<FileSystemBackendDelegate> file_system_provider_delegate_; | 140 scoped_ptr<FileSystemBackendDelegate> file_system_provider_delegate_; |
140 | 141 |
| 142 // The delegate instance for the MTP file system related operations. |
| 143 scoped_ptr<FileSystemBackendDelegate> mtp_delegate_; |
| 144 |
141 // Mount points specific to the owning context (i.e. per-profile mount | 145 // Mount points specific to the owning context (i.e. per-profile mount |
142 // points). | 146 // points). |
143 // | 147 // |
144 // It is legal to have mount points with the same name as in | 148 // It is legal to have mount points with the same name as in |
145 // system_mount_points_. Also, mount point paths may overlap with mount point | 149 // system_mount_points_. Also, mount point paths may overlap with mount point |
146 // paths in system_mount_points_. In both cases mount points in | 150 // paths in system_mount_points_. In both cases mount points in |
147 // |mount_points_| will have a priority. | 151 // |mount_points_| will have a priority. |
148 // E.g. if |mount_points_| map 'foo1' to '/foo/foo1' and | 152 // E.g. if |mount_points_| map 'foo1' to '/foo/foo1' and |
149 // |file_system_mount_points_| map 'xxx' to '/foo/foo1/xxx', |GetVirtualPaths| | 153 // |file_system_mount_points_| map 'xxx' to '/foo/foo1/xxx', |GetVirtualPaths| |
150 // will resolve '/foo/foo1/xxx/yyy' as 'foo1/xxx/yyy' (i.e. the mapping from | 154 // will resolve '/foo/foo1/xxx/yyy' as 'foo1/xxx/yyy' (i.e. the mapping from |
151 // |mount_points_| will be used). | 155 // |mount_points_| will be used). |
152 scoped_refptr<fileapi::ExternalMountPoints> mount_points_; | 156 scoped_refptr<fileapi::ExternalMountPoints> mount_points_; |
153 | 157 |
154 // Globally visible mount points. System MountPonts instance should outlive | 158 // Globally visible mount points. System MountPonts instance should outlive |
155 // all FileSystemBackend instances, so raw pointer is safe. | 159 // all FileSystemBackend instances, so raw pointer is safe. |
156 fileapi::ExternalMountPoints* system_mount_points_; | 160 fileapi::ExternalMountPoints* system_mount_points_; |
157 | 161 |
158 DISALLOW_COPY_AND_ASSIGN(FileSystemBackend); | 162 DISALLOW_COPY_AND_ASSIGN(FileSystemBackend); |
159 }; | 163 }; |
160 | 164 |
161 } // namespace chromeos | 165 } // namespace chromeos |
162 | 166 |
163 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_H_ | 167 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_H_ |
OLD | NEW |