Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Side by Side Diff: webkit/fileapi/obfuscated_file_system_file_util.h

Issue 7608011: Simplify directory path accounting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rolled in CR feedback. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « webkit/fileapi/file_writer_delegate_unittest.cc ('k') | webkit/fileapi/obfuscated_file_system_file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698