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 <string> | 11 #include <string> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
14 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
15 #include "base/macros.h" | 16 #include "base/macros.h" |
16 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
17 #include "base/memory/scoped_ptr.h" | |
18 #include "storage/browser/fileapi/file_system_backend.h" | 18 #include "storage/browser/fileapi/file_system_backend.h" |
19 #include "storage/browser/fileapi/task_runner_bound_observer_list.h" | 19 #include "storage/browser/fileapi/task_runner_bound_observer_list.h" |
20 #include "storage/common/fileapi/file_system_types.h" | 20 #include "storage/common/fileapi/file_system_types.h" |
21 | 21 |
22 namespace storage { | 22 namespace storage { |
23 class CopyOrMoveFileValidatorFactory; | 23 class CopyOrMoveFileValidatorFactory; |
24 class ExternalMountPoints; | 24 class ExternalMountPoints; |
25 class FileSystemURL; | 25 class FileSystemURL; |
26 class WatcherManager; | 26 class WatcherManager; |
27 } // namespace storage | 27 } // namespace storage |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 storage::CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory( | 102 storage::CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory( |
103 storage::FileSystemType type, | 103 storage::FileSystemType type, |
104 base::File::Error* error_code) override; | 104 base::File::Error* error_code) override; |
105 storage::FileSystemOperation* CreateFileSystemOperation( | 105 storage::FileSystemOperation* CreateFileSystemOperation( |
106 const storage::FileSystemURL& url, | 106 const storage::FileSystemURL& url, |
107 storage::FileSystemContext* context, | 107 storage::FileSystemContext* context, |
108 base::File::Error* error_code) const override; | 108 base::File::Error* error_code) const override; |
109 bool SupportsStreaming(const storage::FileSystemURL& url) const override; | 109 bool SupportsStreaming(const storage::FileSystemURL& url) const override; |
110 bool HasInplaceCopyImplementation( | 110 bool HasInplaceCopyImplementation( |
111 storage::FileSystemType type) const override; | 111 storage::FileSystemType type) const override; |
112 scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( | 112 std::unique_ptr<storage::FileStreamReader> CreateFileStreamReader( |
113 const storage::FileSystemURL& path, | 113 const storage::FileSystemURL& path, |
114 int64_t offset, | 114 int64_t offset, |
115 int64_t max_bytes_to_read, | 115 int64_t max_bytes_to_read, |
116 const base::Time& expected_modification_time, | 116 const base::Time& expected_modification_time, |
117 storage::FileSystemContext* context) const override; | 117 storage::FileSystemContext* context) const override; |
118 scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( | 118 std::unique_ptr<storage::FileStreamWriter> CreateFileStreamWriter( |
119 const storage::FileSystemURL& url, | 119 const storage::FileSystemURL& url, |
120 int64_t offset, | 120 int64_t offset, |
121 storage::FileSystemContext* context) const override; | 121 storage::FileSystemContext* context) const override; |
122 storage::FileSystemQuotaUtil* GetQuotaUtil() override; | 122 storage::FileSystemQuotaUtil* GetQuotaUtil() override; |
123 const storage::UpdateObserverList* GetUpdateObservers( | 123 const storage::UpdateObserverList* GetUpdateObservers( |
124 storage::FileSystemType type) const override; | 124 storage::FileSystemType type) const override; |
125 const storage::ChangeObserverList* GetChangeObservers( | 125 const storage::ChangeObserverList* GetChangeObservers( |
126 storage::FileSystemType type) const override; | 126 storage::FileSystemType type) const override; |
127 const storage::AccessObserverList* GetAccessObservers( | 127 const storage::AccessObserverList* GetAccessObservers( |
128 storage::FileSystemType type) const override; | 128 storage::FileSystemType type) const override; |
129 | 129 |
130 // storage::ExternalFileSystemBackend overrides. | 130 // storage::ExternalFileSystemBackend overrides. |
131 bool IsAccessAllowed(const storage::FileSystemURL& url) const override; | 131 bool IsAccessAllowed(const storage::FileSystemURL& url) const override; |
132 std::vector<base::FilePath> GetRootDirectories() const override; | 132 std::vector<base::FilePath> GetRootDirectories() const override; |
133 void GrantFileAccessToExtension(const std::string& extension_id, | 133 void GrantFileAccessToExtension(const std::string& extension_id, |
134 const base::FilePath& virtual_path) override; | 134 const base::FilePath& virtual_path) override; |
135 void RevokeAccessForExtension(const std::string& extension_id) override; | 135 void RevokeAccessForExtension(const std::string& extension_id) override; |
136 bool GetVirtualPath(const base::FilePath& filesystem_path, | 136 bool GetVirtualPath(const base::FilePath& filesystem_path, |
137 base::FilePath* virtual_path) const override; | 137 base::FilePath* virtual_path) const override; |
138 void GetRedirectURLForContents( | 138 void GetRedirectURLForContents( |
139 const storage::FileSystemURL& url, | 139 const storage::FileSystemURL& url, |
140 const storage::URLCallback& callback) const override; | 140 const storage::URLCallback& callback) const override; |
141 storage::FileSystemURL CreateInternalURL( | 141 storage::FileSystemURL CreateInternalURL( |
142 storage::FileSystemContext* context, | 142 storage::FileSystemContext* context, |
143 const base::FilePath& entry_path) const override; | 143 const base::FilePath& entry_path) const override; |
144 | 144 |
145 private: | 145 private: |
146 scoped_ptr<FileAccessPermissions> file_access_permissions_; | 146 std::unique_ptr<FileAccessPermissions> file_access_permissions_; |
147 scoped_ptr<storage::AsyncFileUtil> local_file_util_; | 147 std::unique_ptr<storage::AsyncFileUtil> local_file_util_; |
148 | 148 |
149 // The delegate instance for the drive file system related operations. | 149 // The delegate instance for the drive file system related operations. |
150 scoped_ptr<FileSystemBackendDelegate> drive_delegate_; | 150 std::unique_ptr<FileSystemBackendDelegate> drive_delegate_; |
151 | 151 |
152 // The delegate instance for the provided file system related operations. | 152 // The delegate instance for the provided file system related operations. |
153 scoped_ptr<FileSystemBackendDelegate> file_system_provider_delegate_; | 153 std::unique_ptr<FileSystemBackendDelegate> file_system_provider_delegate_; |
154 | 154 |
155 // The delegate instance for the MTP file system related operations. | 155 // The delegate instance for the MTP file system related operations. |
156 scoped_ptr<FileSystemBackendDelegate> mtp_delegate_; | 156 std::unique_ptr<FileSystemBackendDelegate> mtp_delegate_; |
157 | 157 |
158 // Mount points specific to the owning context (i.e. per-profile mount | 158 // Mount points specific to the owning context (i.e. per-profile mount |
159 // points). | 159 // points). |
160 // | 160 // |
161 // It is legal to have mount points with the same name as in | 161 // 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 | 162 // system_mount_points_. Also, mount point paths may overlap with mount point |
163 // paths in system_mount_points_. In both cases mount points in | 163 // paths in system_mount_points_. In both cases mount points in |
164 // |mount_points_| will have a priority. | 164 // |mount_points_| will have a priority. |
165 // E.g. if |mount_points_| map 'foo1' to '/foo/foo1' and | 165 // E.g. if |mount_points_| map 'foo1' to '/foo/foo1' and |
166 // |file_system_mount_points_| map 'xxx' to '/foo/foo1/xxx', |GetVirtualPaths| | 166 // |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 | 167 // will resolve '/foo/foo1/xxx/yyy' as 'foo1/xxx/yyy' (i.e. the mapping from |
168 // |mount_points_| will be used). | 168 // |mount_points_| will be used). |
169 scoped_refptr<storage::ExternalMountPoints> mount_points_; | 169 scoped_refptr<storage::ExternalMountPoints> mount_points_; |
170 | 170 |
171 // Globally visible mount points. System MountPonts instance should outlive | 171 // Globally visible mount points. System MountPonts instance should outlive |
172 // all FileSystemBackend instances, so raw pointer is safe. | 172 // all FileSystemBackend instances, so raw pointer is safe. |
173 storage::ExternalMountPoints* system_mount_points_; | 173 storage::ExternalMountPoints* system_mount_points_; |
174 | 174 |
175 DISALLOW_COPY_AND_ASSIGN(FileSystemBackend); | 175 DISALLOW_COPY_AND_ASSIGN(FileSystemBackend); |
176 }; | 176 }; |
177 | 177 |
178 } // namespace chromeos | 178 } // namespace chromeos |
179 | 179 |
180 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_H_ | 180 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_H_ |
OLD | NEW |