| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 typedef std::map<std::string, Instance*> IDToInstance; | 156 typedef std::map<std::string, Instance*> IDToInstance; |
| 157 | 157 |
| 158 // Reverse map from registered path to IDs. | 158 // Reverse map from registered path to IDs. |
| 159 typedef std::map<base::FilePath, std::set<std::string> > PathToID; | 159 typedef std::map<base::FilePath, std::set<std::string> > PathToID; |
| 160 | 160 |
| 161 // Obtain an instance of this class via GetInstance(). | 161 // Obtain an instance of this class via GetInstance(). |
| 162 IsolatedContext(); | 162 IsolatedContext(); |
| 163 virtual ~IsolatedContext(); | 163 virtual ~IsolatedContext(); |
| 164 | 164 |
| 165 // MountPoints overrides. |
| 166 virtual FileSystemURL CrackFileSystemURL( |
| 167 const FileSystemURL& url) const OVERRIDE; |
| 168 |
| 165 // Unregisters a file system of given |filesystem_id|. Must be called with | 169 // Unregisters a file system of given |filesystem_id|. Must be called with |
| 166 // lock_ held. Returns true if the file system is unregistered. | 170 // lock_ held. Returns true if the file system is unregistered. |
| 167 bool UnregisterFileSystem(const std::string& filesystem_id); | 171 bool UnregisterFileSystem(const std::string& filesystem_id); |
| 168 | 172 |
| 169 // Returns a new filesystem_id. Called with lock. | 173 // Returns a new filesystem_id. Called with lock. |
| 170 std::string GetNewFileSystemId() const; | 174 std::string GetNewFileSystemId() const; |
| 171 | 175 |
| 172 // This lock needs to be obtained when accessing the instance_map_. | 176 // This lock needs to be obtained when accessing the instance_map_. |
| 173 mutable base::Lock lock_; | 177 mutable base::Lock lock_; |
| 174 | 178 |
| 175 IDToInstance instance_map_; | 179 IDToInstance instance_map_; |
| 176 PathToID path_to_id_map_; | 180 PathToID path_to_id_map_; |
| 177 | 181 |
| 178 DISALLOW_COPY_AND_ASSIGN(IsolatedContext); | 182 DISALLOW_COPY_AND_ASSIGN(IsolatedContext); |
| 179 }; | 183 }; |
| 180 | 184 |
| 181 } // namespace fileapi | 185 } // namespace fileapi |
| 182 | 186 |
| 183 #endif // WEBKIT_FILEAPI_ISOLATED_CONTEXT_H_ | 187 #endif // WEBKIT_FILEAPI_ISOLATED_CONTEXT_H_ |
| OLD | NEW |