Chromium Code Reviews| 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_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" | |
| 17 #include "base/platform_file.h" | 16 #include "base/platform_file.h" |
| 18 #include "base/tracked_objects.h" | 17 #include "base/tracked_objects.h" |
| 19 #include "webkit/fileapi/file_system_file_util.h" | 18 #include "webkit/fileapi/file_system_file_util.h" |
| 20 #include "webkit/fileapi/file_system_types.h" | 19 #include "webkit/fileapi/file_system_types.h" |
| 21 | 20 |
| 22 namespace base { | 21 namespace base { |
| 23 struct PlatformFileInfo; | 22 struct PlatformFileInfo; |
| 24 class MessageLoopProxy; | 23 class MessageLoopProxy; |
| 25 class Time; | 24 class Time; |
| 26 } | 25 } |
| 27 | 26 |
| 28 class GURL; | 27 class GURL; |
| 29 | 28 |
| 30 namespace fileapi { | 29 namespace fileapi { |
| 31 | 30 |
| 32 using base::PlatformFile; | 31 using base::PlatformFile; |
| 33 using base::PlatformFileError; | 32 using base::PlatformFileError; |
| 34 | 33 |
| 35 class FileSystemOperationContext; | 34 class FileSystemOperationContext; |
| 36 | 35 |
| 37 class LocalFileSystemFileUtil : public FileSystemFileUtil { | 36 class LocalFileSystemFileUtil : public FileSystemFileUtil { |
| 38 public: | 37 public: |
| 39 static LocalFileSystemFileUtil* GetInstance(); | 38 explicit LocalFileSystemFileUtil(FileSystemFileUtil* underlying_file_util); |
|
kinuko
2011/07/01 07:48:02
I'm a bit concerned about this asymmetry-- if I re
Dai Mikurube (NOT FULLTIME)
2011/07/04 06:14:53
Yeah, I have the same concern. ObfuscatedFSFU, ho
kinuko
2011/07/05 03:13:02
Ok. Let me make sure, after this change only the
Dai Mikurube (NOT FULLTIME)
2011/07/05 05:30:11
Ok, added comments on {Local|Obfuscated}FileSystem
| |
| 40 | 39 |
| 41 virtual PlatformFileError CreateOrOpen( | 40 virtual PlatformFileError CreateOrOpen( |
| 42 FileSystemOperationContext* context, | 41 FileSystemOperationContext* context, |
| 43 const FilePath& file_path, | 42 const FilePath& file_path, |
| 44 int file_flags, | 43 int file_flags, |
| 45 PlatformFile* file_handle, | 44 PlatformFile* file_handle, |
| 46 bool* created); | 45 bool* created); |
| 47 | 46 |
| 48 virtual PlatformFileError EnsureFileExists( | 47 virtual PlatformFileError EnsureFileExists( |
| 49 FileSystemOperationContext* context, | 48 FileSystemOperationContext* context, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 | 110 |
| 112 virtual bool IsDirectoryEmpty( | 111 virtual bool IsDirectoryEmpty( |
| 113 FileSystemOperationContext* context, | 112 FileSystemOperationContext* context, |
| 114 const FilePath& file_path); | 113 const FilePath& file_path); |
| 115 | 114 |
| 116 virtual AbstractFileEnumerator* CreateFileEnumerator( | 115 virtual AbstractFileEnumerator* CreateFileEnumerator( |
| 117 FileSystemOperationContext* context, | 116 FileSystemOperationContext* context, |
| 118 const FilePath& root_path); | 117 const FilePath& root_path); |
| 119 | 118 |
| 120 protected: | 119 protected: |
| 121 LocalFileSystemFileUtil() { } | |
| 122 | |
| 123 friend struct DefaultSingletonTraits<LocalFileSystemFileUtil>; | |
| 124 DISALLOW_COPY_AND_ASSIGN(LocalFileSystemFileUtil); | 120 DISALLOW_COPY_AND_ASSIGN(LocalFileSystemFileUtil); |
| 125 | 121 |
| 126 private: | 122 private: |
| 127 // Given the filesystem's root URL and a virtual path, produces a real, full | 123 // Given the filesystem's root URL and a virtual path, produces a real, full |
| 128 // local path. | 124 // local path. |
| 129 FilePath GetLocalPath( | 125 FilePath GetLocalPath( |
| 130 FileSystemOperationContext* context, | 126 FileSystemOperationContext* context, |
| 131 const GURL& origin_url, | 127 const GURL& origin_url, |
| 132 FileSystemType type, | 128 FileSystemType type, |
| 133 const FilePath& virtual_path); | 129 const FilePath& virtual_path); |
| 130 | |
| 131 FileSystemFileUtil* underlying_file_util_; | |
| 134 }; | 132 }; |
| 135 | 133 |
| 136 } // namespace fileapi | 134 } // namespace fileapi |
| 137 | 135 |
| 138 #endif // WEBKIT_FILEAPI_LOCAL_FILE_SYSTEM_FILE_UTIL_H_ | 136 #endif // WEBKIT_FILEAPI_LOCAL_FILE_SYSTEM_FILE_UTIL_H_ |
| OLD | NEW |