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" |
|
kinuko
2011/07/05 06:35:24
nit: not necessary?
Dai Mikurube (NOT FULLTIME)
2011/07/05 08:05:40
Done.
| |
| 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" |
|
kinuko
2011/07/05 06:35:24
nit: not necessary?
Dai Mikurube (NOT FULLTIME)
2011/07/05 08:05:40
Done.
| |
| 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 |
| 36 // Now, this class is created and owned only by *MountPointProvider and tests. | |
|
kinuko
2011/07/05 06:35:24
wording nit: 'Now, ' and 'only' is not needed I th
Dai Mikurube (NOT FULLTIME)
2011/07/05 08:05:40
Done.
| |
| 37 class LocalFileSystemFileUtil : public FileSystemFileUtil { | 37 class LocalFileSystemFileUtil : public FileSystemFileUtil { |
| 38 public: | 38 public: |
| 39 static LocalFileSystemFileUtil* GetInstance(); | 39 // |underlying_file_util| is not owned by the instance. It will need to be |
| 40 // a singleton or to be deleted by someone else. | |
| 41 explicit LocalFileSystemFileUtil(FileSystemFileUtil* underlying_file_util); | |
| 40 | 42 |
| 41 virtual PlatformFileError CreateOrOpen( | 43 virtual PlatformFileError CreateOrOpen( |
| 42 FileSystemOperationContext* context, | 44 FileSystemOperationContext* context, |
| 43 const FilePath& file_path, | 45 const FilePath& file_path, |
| 44 int file_flags, | 46 int file_flags, |
| 45 PlatformFile* file_handle, | 47 PlatformFile* file_handle, |
| 46 bool* created); | 48 bool* created); |
| 47 | 49 |
| 48 virtual PlatformFileError EnsureFileExists( | 50 virtual PlatformFileError EnsureFileExists( |
| 49 FileSystemOperationContext* context, | 51 FileSystemOperationContext* context, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 | 113 |
| 112 virtual bool IsDirectoryEmpty( | 114 virtual bool IsDirectoryEmpty( |
| 113 FileSystemOperationContext* context, | 115 FileSystemOperationContext* context, |
| 114 const FilePath& file_path); | 116 const FilePath& file_path); |
| 115 | 117 |
| 116 virtual AbstractFileEnumerator* CreateFileEnumerator( | 118 virtual AbstractFileEnumerator* CreateFileEnumerator( |
| 117 FileSystemOperationContext* context, | 119 FileSystemOperationContext* context, |
| 118 const FilePath& root_path); | 120 const FilePath& root_path); |
| 119 | 121 |
| 120 protected: | 122 protected: |
| 121 LocalFileSystemFileUtil() { } | |
| 122 | |
| 123 friend struct DefaultSingletonTraits<LocalFileSystemFileUtil>; | |
| 124 DISALLOW_COPY_AND_ASSIGN(LocalFileSystemFileUtil); | 123 DISALLOW_COPY_AND_ASSIGN(LocalFileSystemFileUtil); |
|
kinuko
2011/07/05 06:35:24
nit: why is this placed here? can we move this in
Dai Mikurube (NOT FULLTIME)
2011/07/05 08:05:40
Done.
| |
| 125 | 124 |
| 126 private: | 125 private: |
| 127 // Given the filesystem's root URL and a virtual path, produces a real, full | 126 // Given the filesystem's root URL and a virtual path, produces a real, full |
| 128 // local path. | 127 // local path. |
| 129 FilePath GetLocalPath( | 128 FilePath GetLocalPath( |
| 130 FileSystemOperationContext* context, | 129 FileSystemOperationContext* context, |
| 131 const GURL& origin_url, | 130 const GURL& origin_url, |
| 132 FileSystemType type, | 131 FileSystemType type, |
| 133 const FilePath& virtual_path); | 132 const FilePath& virtual_path); |
| 133 | |
| 134 FileSystemFileUtil* underlying_file_util_; | |
| 134 }; | 135 }; |
| 135 | 136 |
| 136 } // namespace fileapi | 137 } // namespace fileapi |
| 137 | 138 |
| 138 #endif // WEBKIT_FILEAPI_LOCAL_FILE_SYSTEM_FILE_UTIL_H_ | 139 #endif // WEBKIT_FILEAPI_LOCAL_FILE_SYSTEM_FILE_UTIL_H_ |
| OLD | NEW |