OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 WEBKIT_FILEAPI_MOUNT_POINTS_H_ | 5 #ifndef WEBKIT_FILEAPI_MOUNT_POINTS_H_ |
6 #define WEBKIT_FILEAPI_MOUNT_POINTS_H_ | 6 #define WEBKIT_FILEAPI_MOUNT_POINTS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // Returns false if the given virtual_path cannot be cracked. | 81 // Returns false if the given virtual_path cannot be cracked. |
82 // | 82 // |
83 // Note that |path| is set to empty paths if the filesystem type is isolated | 83 // Note that |path| is set to empty paths if the filesystem type is isolated |
84 // and |virtual_path| has no <relative_path> part (i.e. pointing to the | 84 // and |virtual_path| has no <relative_path> part (i.e. pointing to the |
85 // virtual root). | 85 // virtual root). |
86 virtual bool CrackVirtualPath(const base::FilePath& virtual_path, | 86 virtual bool CrackVirtualPath(const base::FilePath& virtual_path, |
87 std::string* mount_name, | 87 std::string* mount_name, |
88 FileSystemType* type, | 88 FileSystemType* type, |
89 base::FilePath* path) const = 0; | 89 base::FilePath* path) const = 0; |
90 | 90 |
| 91 // Converts a path on a registered file system to virtual path relative to the |
| 92 // file system root. E.g. if 'Downloads' file system is mapped to |
| 93 // '/usr/local/home/Downloads', and |absolute| path is set to |
| 94 // '/usr/local/home/Downloads/foo', the method will set |virtual_path| to |
| 95 // 'Downloads/foo'. |
| 96 // Returns false if the path cannot be resolved (e.g. if the path is not |
| 97 // part of any registered filesystem or MountPoints implementation does not |
| 98 // support conversion from full to virtual path). |
| 99 // |
| 100 // Returned virtual_path will have normalized path separators. |
| 101 virtual bool GetVirtualPath(const base::FilePath& full_path, |
| 102 base::FilePath* virtual_path) const = 0; |
| 103 |
91 private: | 104 private: |
92 DISALLOW_COPY_AND_ASSIGN(MountPoints); | 105 DISALLOW_COPY_AND_ASSIGN(MountPoints); |
93 }; | 106 }; |
94 | 107 |
95 } // namespace fileapi | 108 } // namespace fileapi |
96 | 109 |
97 #endif // WEBKIT_FILEAPI_MOUNT_POINTS_H_ | 110 #endif // WEBKIT_FILEAPI_MOUNT_POINTS_H_ |
98 | 111 |
OLD | NEW |