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

Side by Side Diff: webkit/fileapi/local_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: Fixed memery leak at LocalFSFUTest, and rebased. Created 9 years, 6 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_LOCAL_FILE_SYSTEM_FILE_UTIL_H_ 5 #ifndef WEBKIT_FILEAPI_LOCAL_FILE_SYSTEM_FILE_UTIL_H_
6 #define WEBKIT_FILEAPI_LOCAL_FILE_SYSTEM_FILE_UTIL_H_ 6 #define WEBKIT_FILEAPI_LOCAL_FILE_SYSTEM_FILE_UTIL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/file_path.h" 11 #include "base/file_path.h"
12 #include "base/file_util.h" 12 #include "base/file_util.h"
13 #include "base/file_util_proxy.h" 13 #include "base/file_util_proxy.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/memory/singleton.h" 16 #include "base/memory/singleton.h"
ericu 2011/06/17 20:32:07 Singleton include is no longer needed.
Dai Mikurube (NOT FULLTIME) 2011/06/23 08:13:32 Done.
17 #include "base/platform_file.h" 17 #include "base/platform_file.h"
18 #include "base/tracked_objects.h" 18 #include "base/tracked_objects.h"
19 #include "webkit/fileapi/file_system_file_util.h" 19 #include "webkit/fileapi/file_system_file_util.h"
20 #include "webkit/fileapi/file_system_types.h" 20 #include "webkit/fileapi/file_system_types.h"
21 21
22 namespace base { 22 namespace base {
23 struct PlatformFileInfo; 23 struct PlatformFileInfo;
24 class MessageLoopProxy; 24 class MessageLoopProxy;
25 class Time; 25 class Time;
26 } 26 }
27 27
28 class GURL; 28 class GURL;
29 29
30 namespace fileapi { 30 namespace fileapi {
31 31
32 using base::PlatformFile; 32 using base::PlatformFile;
33 using base::PlatformFileError; 33 using base::PlatformFileError;
34 34
35 class FileSystemOperationContext; 35 class FileSystemOperationContext;
36 36
37 class LocalFileSystemFileUtil : public FileSystemFileUtil { 37 class LocalFileSystemFileUtil : public FileSystemFileUtil {
38 public: 38 public:
39 static LocalFileSystemFileUtil* GetInstance(); 39 explicit LocalFileSystemFileUtil(FileSystemFileUtil* underlying_file_util);
40 40
41 virtual PlatformFileError CreateOrOpen( 41 virtual PlatformFileError CreateOrOpen(
42 FileSystemOperationContext* context, 42 FileSystemOperationContext* context,
43 const FilePath& file_path, 43 const FilePath& file_path,
44 int file_flags, 44 int file_flags,
45 PlatformFile* file_handle, 45 PlatformFile* file_handle,
46 bool* created); 46 bool* created);
47 47
48 virtual PlatformFileError EnsureFileExists( 48 virtual PlatformFileError EnsureFileExists(
49 FileSystemOperationContext* context, 49 FileSystemOperationContext* context,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 virtual bool IsDirectoryEmpty( 112 virtual bool IsDirectoryEmpty(
113 FileSystemOperationContext* context, 113 FileSystemOperationContext* context,
114 const FilePath& file_path); 114 const FilePath& file_path);
115 115
116 virtual AbstractFileEnumerator* CreateFileEnumerator( 116 virtual AbstractFileEnumerator* CreateFileEnumerator(
117 FileSystemOperationContext* context, 117 FileSystemOperationContext* context,
118 const FilePath& root_path); 118 const FilePath& root_path);
119 119
120 protected: 120 protected:
121 LocalFileSystemFileUtil() { }
122
123 friend struct DefaultSingletonTraits<LocalFileSystemFileUtil>; 121 friend struct DefaultSingletonTraits<LocalFileSystemFileUtil>;
ericu 2011/06/17 20:32:07 friend declaration is no longer needed.
Dai Mikurube (NOT FULLTIME) 2011/06/23 08:13:32 Done.
124 DISALLOW_COPY_AND_ASSIGN(LocalFileSystemFileUtil); 122 DISALLOW_COPY_AND_ASSIGN(LocalFileSystemFileUtil);
125 123
126 private: 124 private:
127 // Given the filesystem's root URL and a virtual path, produces a real, full 125 // Given the filesystem's root URL and a virtual path, produces a real, full
128 // local path. 126 // local path.
129 FilePath GetLocalPath( 127 FilePath GetLocalPath(
130 FileSystemOperationContext* context, 128 FileSystemOperationContext* context,
131 const GURL& origin_url, 129 const GURL& origin_url,
132 FileSystemType type, 130 FileSystemType type,
133 const FilePath& virtual_path); 131 const FilePath& virtual_path);
132
133 FileSystemFileUtil* underlying_file_util_;
134
135 static LocalFileSystemFileUtil* GetInstance();
134 }; 136 };
135 137
136 } // namespace fileapi 138 } // namespace fileapi
137 139
138 #endif // WEBKIT_FILEAPI_LOCAL_FILE_SYSTEM_FILE_UTIL_H_ 140 #endif // WEBKIT_FILEAPI_LOCAL_FILE_SYSTEM_FILE_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698