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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // FileSystem API layer via drive::FileSystemProxy. This mount point is added | 59 // FileSystem API layer via drive::FileSystemProxy. This mount point is added |
60 // by drive::DriveIntegrationService. | 60 // by drive::DriveIntegrationService. |
61 // | 61 // |
62 // These mount points are placed under the "external" namespace, and file | 62 // These mount points are placed under the "external" namespace, and file |
63 // system URLs for these mount points look like: | 63 // system URLs for these mount points look like: |
64 // | 64 // |
65 // filesystem:<origin>/external/<mount_name>/... | 65 // filesystem:<origin>/external/<mount_name>/... |
66 // | 66 // |
67 class FileSystemBackend : public fileapi::ExternalFileSystemBackend { | 67 class FileSystemBackend : public fileapi::ExternalFileSystemBackend { |
68 public: | 68 public: |
69 using fileapi::FileSystemBackend::InitializeFileSystemCallback; | 69 using fileapi::FileSystemBackend::OpenFileSystemCallback; |
70 | 70 |
71 // FileSystemBackend will take an ownership of a |mount_points| | 71 // FileSystemBackend will take an ownership of a |mount_points| |
72 // reference. On the other hand, |system_mount_points| will be kept as a raw | 72 // reference. On the other hand, |system_mount_points| will be kept as a raw |
73 // pointer and it should outlive FileSystemBackend instance. | 73 // pointer and it should outlive FileSystemBackend instance. |
74 // The ownership of |drive_delegate| is also taken. | 74 // The ownership of |drive_delegate| is also taken. |
75 FileSystemBackend( | 75 FileSystemBackend( |
76 FileSystemBackendDelegate* drive_delegate, | 76 FileSystemBackendDelegate* drive_delegate, |
77 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy, | 77 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy, |
78 scoped_refptr<fileapi::ExternalMountPoints> mount_points, | 78 scoped_refptr<fileapi::ExternalMountPoints> mount_points, |
79 fileapi::ExternalMountPoints* system_mount_points); | 79 fileapi::ExternalMountPoints* system_mount_points); |
80 virtual ~FileSystemBackend(); | 80 virtual ~FileSystemBackend(); |
81 | 81 |
82 // Adds system mount points, such as "archive", and "removable". This | 82 // Adds system mount points, such as "archive", and "removable". This |
83 // function is no-op if these mount points are already present. | 83 // function is no-op if these mount points are already present. |
84 void AddSystemMountPoints(); | 84 void AddSystemMountPoints(); |
85 | 85 |
86 // Returns true if CrosMountpointProvider can handle |url|, i.e. its | 86 // Returns true if CrosMountpointProvider can handle |url|, i.e. its |
87 // file system type matches with what this provider supports. | 87 // file system type matches with what this provider supports. |
88 // This could be called on any threads. | 88 // This could be called on any threads. |
89 static bool CanHandleURL(const fileapi::FileSystemURL& url); | 89 static bool CanHandleURL(const fileapi::FileSystemURL& url); |
90 | 90 |
91 // fileapi::FileSystemBackend overrides. | 91 // fileapi::FileSystemBackend overrides. |
92 virtual bool CanHandleType(fileapi::FileSystemType type) const OVERRIDE; | 92 virtual bool CanHandleType(fileapi::FileSystemType type) const OVERRIDE; |
93 virtual void InitializeFileSystem( | 93 virtual void Initialize(fileapi::FileSystemContext* context) OVERRIDE; |
| 94 virtual void OpenFileSystem( |
94 const GURL& origin_url, | 95 const GURL& origin_url, |
95 fileapi::FileSystemType type, | 96 fileapi::FileSystemType type, |
96 fileapi::OpenFileSystemMode mode, | 97 fileapi::OpenFileSystemMode mode, |
97 fileapi::FileSystemContext* context, | 98 const OpenFileSystemCallback& callback) OVERRIDE; |
98 const InitializeFileSystemCallback& callback) OVERRIDE; | |
99 virtual fileapi::FileSystemFileUtil* GetFileUtil( | 99 virtual fileapi::FileSystemFileUtil* GetFileUtil( |
100 fileapi::FileSystemType type) OVERRIDE; | 100 fileapi::FileSystemType type) OVERRIDE; |
101 virtual fileapi::AsyncFileUtil* GetAsyncFileUtil( | 101 virtual fileapi::AsyncFileUtil* GetAsyncFileUtil( |
102 fileapi::FileSystemType type) OVERRIDE; | 102 fileapi::FileSystemType type) OVERRIDE; |
103 virtual fileapi::CopyOrMoveFileValidatorFactory* | 103 virtual fileapi::CopyOrMoveFileValidatorFactory* |
104 GetCopyOrMoveFileValidatorFactory( | 104 GetCopyOrMoveFileValidatorFactory( |
105 fileapi::FileSystemType type, | 105 fileapi::FileSystemType type, |
106 base::PlatformFileError* error_code) OVERRIDE; | 106 base::PlatformFileError* error_code) OVERRIDE; |
107 virtual fileapi::FileSystemOperation* CreateFileSystemOperation( | 107 virtual fileapi::FileSystemOperation* CreateFileSystemOperation( |
108 const fileapi::FileSystemURL& url, | 108 const fileapi::FileSystemURL& url, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // Globally visible mount points. System MountPonts instance should outlive | 159 // Globally visible mount points. System MountPonts instance should outlive |
160 // all FileSystemBackend instances, so raw pointer is safe. | 160 // all FileSystemBackend instances, so raw pointer is safe. |
161 fileapi::ExternalMountPoints* system_mount_points_; | 161 fileapi::ExternalMountPoints* system_mount_points_; |
162 | 162 |
163 DISALLOW_COPY_AND_ASSIGN(FileSystemBackend); | 163 DISALLOW_COPY_AND_ASSIGN(FileSystemBackend); |
164 }; | 164 }; |
165 | 165 |
166 } // namespace chromeos | 166 } // namespace chromeos |
167 | 167 |
168 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_H_ | 168 #endif // CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_SYSTEM_BACKEND_H_ |
OLD | NEW |