OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 // fileapi::ExternalFileSystemMountPointProvider overrides. | 46 // fileapi::ExternalFileSystemMountPointProvider overrides. |
47 virtual void GrantFullAccessToExtension( | 47 virtual void GrantFullAccessToExtension( |
48 const std::string& extension_id) OVERRIDE; | 48 const std::string& extension_id) OVERRIDE; |
49 virtual void GrantFileAccessToExtension( | 49 virtual void GrantFileAccessToExtension( |
50 const std::string& extension_id, const FilePath& virtual_path) OVERRIDE; | 50 const std::string& extension_id, const FilePath& virtual_path) OVERRIDE; |
51 virtual void RevokeAccessForExtension( | 51 virtual void RevokeAccessForExtension( |
52 const std::string& extension_id) OVERRIDE; | 52 const std::string& extension_id) OVERRIDE; |
53 virtual void AddMountPoint(FilePath mount_point) OVERRIDE; | 53 virtual void AddMountPoint(FilePath mount_point) OVERRIDE; |
54 virtual void RemoveMountPoint(FilePath mount_point) OVERRIDE; | 54 virtual void RemoveMountPoint(FilePath mount_point) OVERRIDE; |
| 55 virtual bool GetVirtualPath(const FilePath& filesystem_path, |
| 56 FilePath* virtual_path) OVERRIDE; |
55 | 57 |
56 private: | 58 private: |
57 class GetFileSystemRootPathTask; | 59 class GetFileSystemRootPathTask; |
58 typedef std::map<std::string, FilePath> MountPointMap; | 60 typedef std::map<std::string, FilePath> MountPointMap; |
59 | 61 |
60 // Gives the real file system's |root_path| for given |virtual_path|. Returns | 62 // Gives the real file system's |root_path| for given |virtual_path|. Returns |
61 // false when |virtual_path| cannot be mapped to the real file system. | 63 // false when |virtual_path| cannot be mapped to the real file system. |
62 bool GetRootForVirtualPath(const FilePath& virtual_path, FilePath* root_path); | 64 bool GetRootForVirtualPath(const FilePath& virtual_path, FilePath* root_path); |
63 | 65 |
64 base::Lock lock_; // Synchronize all access to path_map_. | 66 base::Lock lock_; // Synchronize all access to path_map_. |
65 MountPointMap mount_point_map_; | 67 MountPointMap mount_point_map_; |
66 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; | 68 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
67 scoped_ptr<FileAccessPermissions> file_access_permissions_; | 69 scoped_ptr<FileAccessPermissions> file_access_permissions_; |
68 DISALLOW_COPY_AND_ASSIGN(CrosMountPointProvider); | 70 DISALLOW_COPY_AND_ASSIGN(CrosMountPointProvider); |
69 }; | 71 }; |
70 | 72 |
71 } // namespace chromeos | 73 } // namespace chromeos |
72 | 74 |
73 #endif // WEBKIT_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ | 75 #endif // WEBKIT_CHROMEOS_FILEAPI_CROS_MOUNT_POINT_PROVIDER_H_ |
OLD | NEW |