| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 class FileSystemBackend : public storage::ExternalFileSystemBackend { | 66 class FileSystemBackend : public storage::ExternalFileSystemBackend { |
| 67 public: | 67 public: |
| 68 using storage::FileSystemBackend::OpenFileSystemCallback; | 68 using storage::FileSystemBackend::OpenFileSystemCallback; |
| 69 | 69 |
| 70 // |system_mount_points| should outlive FileSystemBackend instance. | 70 // |system_mount_points| should outlive FileSystemBackend instance. |
| 71 FileSystemBackend( | 71 FileSystemBackend( |
| 72 std::unique_ptr<FileSystemBackendDelegate> drive_delegate, | 72 std::unique_ptr<FileSystemBackendDelegate> drive_delegate, |
| 73 std::unique_ptr<FileSystemBackendDelegate> file_system_provider_delegate, | 73 std::unique_ptr<FileSystemBackendDelegate> file_system_provider_delegate, |
| 74 std::unique_ptr<FileSystemBackendDelegate> mtp_delegate, | 74 std::unique_ptr<FileSystemBackendDelegate> mtp_delegate, |
| 75 std::unique_ptr<FileSystemBackendDelegate> arc_content_delegate, | 75 std::unique_ptr<FileSystemBackendDelegate> arc_content_delegate, |
| 76 std::unique_ptr<FileSystemBackendDelegate> |
| 77 arc_documents_provider_delegate, |
| 76 scoped_refptr<storage::ExternalMountPoints> mount_points, | 78 scoped_refptr<storage::ExternalMountPoints> mount_points, |
| 77 storage::ExternalMountPoints* system_mount_points); | 79 storage::ExternalMountPoints* system_mount_points); |
| 78 ~FileSystemBackend() override; | 80 ~FileSystemBackend() override; |
| 79 | 81 |
| 80 // Adds system mount points, such as "archive", and "removable". This | 82 // Adds system mount points, such as "archive", and "removable". This |
| 81 // function is no-op if these mount points are already present. | 83 // function is no-op if these mount points are already present. |
| 82 void AddSystemMountPoints(); | 84 void AddSystemMountPoints(); |
| 83 | 85 |
| 84 // Returns true if CrosMountpointProvider can handle |url|, i.e. its | 86 // Returns true if CrosMountpointProvider can handle |url|, i.e. its |
| 85 // file system type matches with what this provider supports. | 87 // file system type matches with what this provider supports. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 150 |
| 149 // The delegate instance for the provided file system related operations. | 151 // The delegate instance for the provided file system related operations. |
| 150 std::unique_ptr<FileSystemBackendDelegate> file_system_provider_delegate_; | 152 std::unique_ptr<FileSystemBackendDelegate> file_system_provider_delegate_; |
| 151 | 153 |
| 152 // The delegate instance for the MTP file system related operations. | 154 // The delegate instance for the MTP file system related operations. |
| 153 std::unique_ptr<FileSystemBackendDelegate> mtp_delegate_; | 155 std::unique_ptr<FileSystemBackendDelegate> mtp_delegate_; |
| 154 | 156 |
| 155 // The delegate instance for the ARC content file system related operations. | 157 // The delegate instance for the ARC content file system related operations. |
| 156 std::unique_ptr<FileSystemBackendDelegate> arc_content_delegate_; | 158 std::unique_ptr<FileSystemBackendDelegate> arc_content_delegate_; |
| 157 | 159 |
| 160 // The delegate instance for the ARC documents provider related operations. |
| 161 std::unique_ptr<FileSystemBackendDelegate> arc_documents_provider_delegate_; |
| 162 |
| 158 // Mount points specific to the owning context (i.e. per-profile mount | 163 // Mount points specific to the owning context (i.e. per-profile mount |
| 159 // points). | 164 // points). |
| 160 // | 165 // |
| 161 // It is legal to have mount points with the same name as in | 166 // It is legal to have mount points with the same name as in |
| 162 // system_mount_points_. Also, mount point paths may overlap with mount point | 167 // system_mount_points_. Also, mount point paths may overlap with mount point |
| 163 // paths in system_mount_points_. In both cases mount points in | 168 // paths in system_mount_points_. In both cases mount points in |
| 164 // |mount_points_| will have a priority. | 169 // |mount_points_| will have a priority. |
| 165 // E.g. if |mount_points_| map 'foo1' to '/foo/foo1' and | 170 // E.g. if |mount_points_| map 'foo1' to '/foo/foo1' and |
| 166 // |file_system_mount_points_| map 'xxx' to '/foo/foo1/xxx', |GetVirtualPaths| | 171 // |file_system_mount_points_| map 'xxx' to '/foo/foo1/xxx', |GetVirtualPaths| |
| 167 // will resolve '/foo/foo1/xxx/yyy' as 'foo1/xxx/yyy' (i.e. the mapping from | 172 // will resolve '/foo/foo1/xxx/yyy' as 'foo1/xxx/yyy' (i.e. the mapping from |
| 168 // |mount_points_| will be used). | 173 // |mount_points_| will be used). |
| 169 scoped_refptr<storage::ExternalMountPoints> mount_points_; | 174 scoped_refptr<storage::ExternalMountPoints> mount_points_; |
| 170 | 175 |
| 171 // Globally visible mount points. System MountPonts instance should outlive | 176 // Globally visible mount points. System MountPonts instance should outlive |
| 172 // all FileSystemBackend instances, so raw pointer is safe. | 177 // all FileSystemBackend instances, so raw pointer is safe. |
| 173 storage::ExternalMountPoints* system_mount_points_; | 178 storage::ExternalMountPoints* system_mount_points_; |
| 174 | 179 |
| 175 DISALLOW_COPY_AND_ASSIGN(FileSystemBackend); | 180 DISALLOW_COPY_AND_ASSIGN(FileSystemBackend); |
| 176 }; | 181 }; |
| 177 | 182 |
| 178 } // namespace chromeos | 183 } // namespace chromeos |
| 179 | 184 |
| 180 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_H_ | 185 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_H_ |
| OLD | NEW |