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_BROWSER_FILEAPI_ISOLATED_CONTEXT_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_ISOLATED_CONTEXT_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_ISOLATED_CONTEXT_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_ISOLATED_CONTEXT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // it can properly return the original path '/a/b/foo' by looking up the | 86 // it can properly return the original path '/a/b/foo' by looking up the |
87 // internal mapping. Similarly if a dropped entry is a directory and its | 87 // internal mapping. Similarly if a dropped entry is a directory and its |
88 // path is like '/a/b/dir' a virtual path like '/<fsid>/dir/foo' can be | 88 // path is like '/a/b/dir' a virtual path like '/<fsid>/dir/foo' can be |
89 // cracked into '/a/b/dir/foo'. | 89 // cracked into '/a/b/dir/foo'. |
90 // | 90 // |
91 // Note that the path in |fileset| that contains '..' or is not an | 91 // Note that the path in |fileset| that contains '..' or is not an |
92 // absolute path is skipped and is not registered. | 92 // absolute path is skipped and is not registered. |
93 std::string RegisterDraggedFileSystem(const FileInfoSet& files); | 93 std::string RegisterDraggedFileSystem(const FileInfoSet& files); |
94 | 94 |
95 // Registers a new isolated filesystem for a given |path| of filesystem | 95 // Registers a new isolated filesystem for a given |path| of filesystem |
96 // |type| filesystem and returns a new filesystem ID. | 96 // |type| filesystem with |filesystem_id| and returns a new filesystem ID. |
97 // |path| must be an absolute path which has no parent references ('..'). | 97 // |path| must be an absolute path which has no parent references ('..'). |
98 // If |register_name| is non-null and has non-empty string the path is | 98 // If |register_name| is non-null and has non-empty string the path is |
99 // registered as the given |register_name|, otherwise it is populated | 99 // registered as the given |register_name|, otherwise it is populated |
100 // with the name internally assigned to the path. | 100 // with the name internally assigned to the path. |
101 std::string RegisterFileSystemForPath(FileSystemType type, | 101 std::string RegisterFileSystemForPath(FileSystemType type, |
| 102 const std::string& filesystem_id, |
102 const base::FilePath& path, | 103 const base::FilePath& path, |
103 std::string* register_name); | 104 std::string* register_name); |
104 | 105 |
105 // Registers a virtual filesystem. This is different from | 106 // Registers a virtual filesystem. This is different from |
106 // RegisterFileSystemForPath because register_name is required, and | 107 // RegisterFileSystemForPath because register_name is required, and |
107 // cracked_path_prefix is allowed to be non-absolute. | 108 // cracked_path_prefix is allowed to be non-absolute. |
108 // |register_name| is required, since we cannot infer one from the path. | 109 // |register_name| is required, since we cannot infer one from the path. |
109 // |cracked_path_prefix| has no parent references, but can be relative. | 110 // |cracked_path_prefix| has no parent references, but can be relative. |
110 std::string RegisterFileSystemForVirtualPath( | 111 std::string RegisterFileSystemForVirtualPath( |
111 FileSystemType type, | 112 FileSystemType type, |
(...skipping 29 matching lines...) Expand all Loading... |
141 | 142 |
142 // MountPoints overrides. | 143 // MountPoints overrides. |
143 virtual bool HandlesFileSystemMountType(FileSystemType type) const OVERRIDE; | 144 virtual bool HandlesFileSystemMountType(FileSystemType type) const OVERRIDE; |
144 virtual bool RevokeFileSystem(const std::string& filesystem_id) OVERRIDE; | 145 virtual bool RevokeFileSystem(const std::string& filesystem_id) OVERRIDE; |
145 virtual bool GetRegisteredPath(const std::string& filesystem_id, | 146 virtual bool GetRegisteredPath(const std::string& filesystem_id, |
146 base::FilePath* path) const OVERRIDE; | 147 base::FilePath* path) const OVERRIDE; |
147 virtual bool CrackVirtualPath( | 148 virtual bool CrackVirtualPath( |
148 const base::FilePath& virtual_path, | 149 const base::FilePath& virtual_path, |
149 std::string* filesystem_id, | 150 std::string* filesystem_id, |
150 FileSystemType* type, | 151 FileSystemType* type, |
| 152 std::string* cracked_id, |
151 base::FilePath* path, | 153 base::FilePath* path, |
152 FileSystemMountOption* mount_option) const OVERRIDE; | 154 FileSystemMountOption* mount_option) const OVERRIDE; |
153 virtual FileSystemURL CrackURL(const GURL& url) const OVERRIDE; | 155 virtual FileSystemURL CrackURL(const GURL& url) const OVERRIDE; |
154 virtual FileSystemURL CreateCrackedFileSystemURL( | 156 virtual FileSystemURL CreateCrackedFileSystemURL( |
155 const GURL& origin, | 157 const GURL& origin, |
156 FileSystemType type, | 158 FileSystemType type, |
157 const base::FilePath& path) const OVERRIDE; | 159 const base::FilePath& path) const OVERRIDE; |
158 | 160 |
159 // Returns the virtual root path that looks like /<filesystem_id>. | 161 // Returns the virtual root path that looks like /<filesystem_id>. |
160 base::FilePath CreateVirtualRootPath(const std::string& filesystem_id) const; | 162 base::FilePath CreateVirtualRootPath(const std::string& filesystem_id) const; |
(...skipping 29 matching lines...) Expand all Loading... |
190 | 192 |
191 IDToInstance instance_map_; | 193 IDToInstance instance_map_; |
192 PathToID path_to_id_map_; | 194 PathToID path_to_id_map_; |
193 | 195 |
194 DISALLOW_COPY_AND_ASSIGN(IsolatedContext); | 196 DISALLOW_COPY_AND_ASSIGN(IsolatedContext); |
195 }; | 197 }; |
196 | 198 |
197 } // namespace fileapi | 199 } // namespace fileapi |
198 | 200 |
199 #endif // WEBKIT_BROWSER_FILEAPI_ISOLATED_CONTEXT_H_ | 201 #endif // WEBKIT_BROWSER_FILEAPI_ISOLATED_CONTEXT_H_ |
OLD | NEW |