| 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_FILEAPI_OBFUSCATED_FILE_SYSTEM_FILE_UTIL_H_ | 5 #ifndef WEBKIT_FILEAPI_OBFUSCATED_FILE_SYSTEM_FILE_UTIL_H_ |
| 6 #define WEBKIT_FILEAPI_OBFUSCATED_FILE_SYSTEM_FILE_UTIL_H_ | 6 #define WEBKIT_FILEAPI_OBFUSCATED_FILE_SYSTEM_FILE_UTIL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 const FilePath& virtual_path); | 205 const FilePath& virtual_path); |
| 206 // This converts from a relative path [as is stored in the FileInfo.data_path | 206 // This converts from a relative path [as is stored in the FileInfo.data_path |
| 207 // field] to an absolute local path that can be given to the operating system. | 207 // field] to an absolute local path that can be given to the operating system. |
| 208 // It does no checks as to whether the file actually exists; it's pure path | 208 // It does no checks as to whether the file actually exists; it's pure path |
| 209 // manipulation. | 209 // manipulation. |
| 210 FilePath DataPathToLocalPath( | 210 FilePath DataPathToLocalPath( |
| 211 const GURL& origin, FileSystemType type, const FilePath& data_path); | 211 const GURL& origin, FileSystemType type, const FilePath& data_path); |
| 212 // This does the reverse of DataPathToLocalPath. | 212 // This does the reverse of DataPathToLocalPath. |
| 213 FilePath LocalPathToDataPath( | 213 FilePath LocalPathToDataPath( |
| 214 const GURL& origin, FileSystemType type, const FilePath& local_path); | 214 const GURL& origin, FileSystemType type, const FilePath& local_path); |
| 215 // This returns NULL if |create| flag is false and a filesystem does not |
| 216 // exist for the given |origin_url| and |type|. |
| 217 // For read operations |create| should be false. |
| 215 FileSystemDirectoryDatabase* GetDirectoryDatabase( | 218 FileSystemDirectoryDatabase* GetDirectoryDatabase( |
| 216 const GURL& origin_url, FileSystemType type); | 219 const GURL& origin_url, FileSystemType type, bool create); |
| 217 void MarkUsed(); | 220 void MarkUsed(); |
| 218 void DropDatabases(); | 221 void DropDatabases(); |
| 219 bool DestroyDirectoryDatabase(const GURL& origin, FileSystemType type); | 222 bool DestroyDirectoryDatabase(const GURL& origin, FileSystemType type); |
| 220 bool InitOriginDatabase(bool create); | 223 bool InitOriginDatabase(bool create); |
| 221 | 224 |
| 222 typedef std::map<std::string, FileSystemDirectoryDatabase*> DirectoryMap; | 225 typedef std::map<std::string, FileSystemDirectoryDatabase*> DirectoryMap; |
| 223 DirectoryMap directories_; | 226 DirectoryMap directories_; |
| 224 scoped_ptr<FileSystemOriginDatabase> origin_database_; | 227 scoped_ptr<FileSystemOriginDatabase> origin_database_; |
| 225 FilePath file_system_directory_; | 228 FilePath file_system_directory_; |
| 226 base::OneShotTimer<ObfuscatedFileSystemFileUtil> timer_; | 229 base::OneShotTimer<ObfuscatedFileSystemFileUtil> timer_; |
| 227 | 230 |
| 228 DISALLOW_COPY_AND_ASSIGN(ObfuscatedFileSystemFileUtil); | 231 DISALLOW_COPY_AND_ASSIGN(ObfuscatedFileSystemFileUtil); |
| 229 }; | 232 }; |
| 230 | 233 |
| 231 } // namespace fileapi | 234 } // namespace fileapi |
| 232 | 235 |
| 233 #endif // WEBKIT_FILEAPI_OBFUSCATED_FILE_SYSTEM_FILE_UTIL_H_ | 236 #endif // WEBKIT_FILEAPI_OBFUSCATED_FILE_SYSTEM_FILE_UTIL_H_ |
| OLD | NEW |