| 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_FILEAPI_ISOLATED_CONTEXT_H_ | 5 #ifndef WEBKIT_FILEAPI_ISOLATED_CONTEXT_H_ |
| 6 #define WEBKIT_FILEAPI_ISOLATED_CONTEXT_H_ | 6 #define WEBKIT_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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 // Cracks the given |virtual_path| (which should look like | 119 // Cracks the given |virtual_path| (which should look like |
| 120 // "/<filesystem_id>/<registered_name>/<relative_path>") and populates | 120 // "/<filesystem_id>/<registered_name>/<relative_path>") and populates |
| 121 // the |filesystem_id| and |path| if the embedded <filesystem_id> | 121 // the |filesystem_id| and |path| if the embedded <filesystem_id> |
| 122 // is registerred to this context. |root_path| is also populated to have | 122 // is registerred to this context. |root_path| is also populated to have |
| 123 // the registered root (toplevel) file info for the |virtual_path|. | 123 // the registered root (toplevel) file info for the |virtual_path|. |
| 124 // | 124 // |
| 125 // Returns false if the given virtual_path or the cracked filesystem_id | 125 // Returns false if the given virtual_path or the cracked filesystem_id |
| 126 // is not valid. | 126 // is not valid. |
| 127 // | 127 // |
| 128 // Note that |root_info| and |path| are set to empty paths if | 128 // Note that |path| is set to empty paths if |virtual_path| has no |
| 129 // |virtual_path| has no <relative_path> part (i.e. pointing to | 129 // <relative_path> part (i.e. pointing to the virtual root). |
| 130 // the virtual root). | |
| 131 // | |
| 132 // TODO(kinuko): Return filesystem type as well. | |
| 133 bool CrackIsolatedPath(const FilePath& virtual_path, | 130 bool CrackIsolatedPath(const FilePath& virtual_path, |
| 134 std::string* filesystem_id, | 131 std::string* filesystem_id, |
| 135 FileInfo* root_info, | 132 FileSystemType* type, |
| 136 FilePath* path) const; | 133 FilePath* path) const; |
| 137 | 134 |
| 138 // Returns a set of dragged FileInfo's registered for the |filesystem_id|. | 135 // Returns a set of dragged FileInfo's registered for the |filesystem_id|. |
| 139 // The filesystem_id must be pointing to a dragged file system | 136 // The filesystem_id must be pointing to a dragged file system |
| 140 // (i.e. must be the one registered by RegisterDraggedFileSystem). | 137 // (i.e. must be the one registered by RegisterDraggedFileSystem). |
| 141 // Returns false if the |filesystem_id| is not valid. | 138 // Returns false if the |filesystem_id| is not valid. |
| 142 bool GetDraggedFileInfo(const std::string& filesystem_id, | 139 bool GetDraggedFileInfo(const std::string& filesystem_id, |
| 143 std::vector<FileInfo>* files) const; | 140 std::vector<FileInfo>* files) const; |
| 144 | 141 |
| 145 // Returns the file path registered for the |filesystem_id|. | 142 // Returns the file path registered for the |filesystem_id|. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 mutable base::Lock lock_; | 196 mutable base::Lock lock_; |
| 200 | 197 |
| 201 IDToInstance instance_map_; | 198 IDToInstance instance_map_; |
| 202 | 199 |
| 203 DISALLOW_COPY_AND_ASSIGN(IsolatedContext); | 200 DISALLOW_COPY_AND_ASSIGN(IsolatedContext); |
| 204 }; | 201 }; |
| 205 | 202 |
| 206 } // namespace fileapi | 203 } // namespace fileapi |
| 207 | 204 |
| 208 #endif // WEBKIT_FILEAPI_ISOLATED_CONTEXT_H_ | 205 #endif // WEBKIT_FILEAPI_ISOLATED_CONTEXT_H_ |
| OLD | NEW |