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

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

Issue 7174002: Change {Obfuscated|Local}FileSystemFileUtil non-Singleton to take an underlying *FileUtil. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebased. Created 9 years, 5 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 29 matching lines...) Expand all
40 // DropDatabases needs to be called. References will be held by the 40 // DropDatabases needs to be called. References will be held by the
41 // SandboxMountPointProvider [and the task it uses to drop the reference] and 41 // SandboxMountPointProvider [and the task it uses to drop the reference] and
42 // SandboxMountPointProvider::GetFileSystemRootPathTask. Without that last one, 42 // SandboxMountPointProvider::GetFileSystemRootPathTask. Without that last one,
43 // we wouldn't need ref counting. 43 // we wouldn't need ref counting.
44 // 44 //
45 // TODO(ericu): We don't ever update directory mtimes; which operations should 45 // TODO(ericu): We don't ever update directory mtimes; which operations should
46 // do that? 46 // do that?
47 class ObfuscatedFileSystemFileUtil : public FileSystemFileUtil, 47 class ObfuscatedFileSystemFileUtil : public FileSystemFileUtil,
48 public base::RefCountedThreadSafe<ObfuscatedFileSystemFileUtil> { 48 public base::RefCountedThreadSafe<ObfuscatedFileSystemFileUtil> {
49 public: 49 public:
50 50 // |underlying_file_util| is not owned by the instance. It will need to be
51 ObfuscatedFileSystemFileUtil(const FilePath& file_system_directory); 51 // a singleton or to be deleted by someone else.
52 ObfuscatedFileSystemFileUtil(
53 const FilePath& file_system_directory,
54 FileSystemFileUtil* underlying_file_util);
52 virtual ~ObfuscatedFileSystemFileUtil(); 55 virtual ~ObfuscatedFileSystemFileUtil();
53 56
54 virtual base::PlatformFileError CreateOrOpen( 57 virtual base::PlatformFileError CreateOrOpen(
55 FileSystemOperationContext* context, 58 FileSystemOperationContext* context,
56 const FilePath& file_path, 59 const FilePath& file_path,
57 int file_flags, 60 int file_flags,
58 base::PlatformFile* file_handle, 61 base::PlatformFile* file_handle,
59 bool* created) OVERRIDE; 62 bool* created) OVERRIDE;
60 63
61 virtual base::PlatformFileError EnsureFileExists( 64 virtual base::PlatformFileError EnsureFileExists(
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_;
230 FileSystemFileUtil* underlying_file_util_;
227 231
228 DISALLOW_COPY_AND_ASSIGN(ObfuscatedFileSystemFileUtil); 232 DISALLOW_COPY_AND_ASSIGN(ObfuscatedFileSystemFileUtil);
229 }; 233 };
230 234
231 } // namespace fileapi 235 } // namespace fileapi
232 236
233 #endif // WEBKIT_FILEAPI_OBFUSCATED_FILE_SYSTEM_FILE_UTIL_H_ 237 #endif // WEBKIT_FILEAPI_OBFUSCATED_FILE_SYSTEM_FILE_UTIL_H_
OLDNEW
« no previous file with comments | « webkit/fileapi/local_file_system_file_util_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