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