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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 AbstractOriginEnumerator* CreateOriginEnumerator(); | 178 AbstractOriginEnumerator* CreateOriginEnumerator(); |
179 | 179 |
180 virtual AbstractFileEnumerator* CreateFileEnumerator( | 180 virtual AbstractFileEnumerator* CreateFileEnumerator( |
181 FileSystemOperationContext* context, | 181 FileSystemOperationContext* context, |
182 const FilePath& root_path) OVERRIDE; | 182 const FilePath& root_path) OVERRIDE; |
183 | 183 |
184 // Deletes a directory database from the database list in the ObfuscatedFSFU | 184 // Deletes a directory database from the database list in the ObfuscatedFSFU |
185 // and destroys the database on the disk. | 185 // and destroys the database on the disk. |
186 bool DestroyDirectoryDatabase(const GURL& origin, FileSystemType type); | 186 bool DestroyDirectoryDatabase(const GURL& origin, FileSystemType type); |
187 | 187 |
| 188 // Computes a cost for storing a given file in the obfuscated FSFU. |
| 189 // As the cost of a file is independent of the cost of its parent directories, |
| 190 // this ignores all but the BaseName of the supplied path. In order to |
| 191 // compute the cost of adding a multi-segment directory recursively, call this |
| 192 // on each path segment and add the results. |
| 193 static int64 ComputeFilePathCost(const FilePath& path); |
| 194 |
188 private: | 195 private: |
189 typedef FileSystemDirectoryDatabase::FileId FileId; | 196 typedef FileSystemDirectoryDatabase::FileId FileId; |
190 typedef FileSystemDirectoryDatabase::FileInfo FileInfo; | 197 typedef FileSystemDirectoryDatabase::FileInfo FileInfo; |
191 | 198 |
192 base::PlatformFileError GetFileInfoInternal( | 199 base::PlatformFileError GetFileInfoInternal( |
193 FileSystemDirectoryDatabase* db, | 200 FileSystemDirectoryDatabase* db, |
194 FileSystemOperationContext* context, | 201 FileSystemOperationContext* context, |
195 FileId file_id, | 202 FileId file_id, |
196 FileInfo* local_info, | 203 FileInfo* local_info, |
197 base::PlatformFileInfo* file_info, | 204 base::PlatformFileInfo* file_info, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 FilePath file_system_directory_; | 254 FilePath file_system_directory_; |
248 base::OneShotTimer<ObfuscatedFileSystemFileUtil> timer_; | 255 base::OneShotTimer<ObfuscatedFileSystemFileUtil> timer_; |
249 scoped_ptr<FileSystemFileUtil> underlying_file_util_; | 256 scoped_ptr<FileSystemFileUtil> underlying_file_util_; |
250 | 257 |
251 DISALLOW_COPY_AND_ASSIGN(ObfuscatedFileSystemFileUtil); | 258 DISALLOW_COPY_AND_ASSIGN(ObfuscatedFileSystemFileUtil); |
252 }; | 259 }; |
253 | 260 |
254 } // namespace fileapi | 261 } // namespace fileapi |
255 | 262 |
256 #endif // WEBKIT_FILEAPI_OBFUSCATED_FILE_SYSTEM_FILE_UTIL_H_ | 263 #endif // WEBKIT_FILEAPI_OBFUSCATED_FILE_SYSTEM_FILE_UTIL_H_ |
OLD | NEW |