| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BROWSER_FILEAPI_NATIVE_FILE_UTIL_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_NATIVE_FILE_UTIL_H_ |
| 6 #define WEBKIT_BROWSER_FILEAPI_NATIVE_FILE_UTIL_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_NATIVE_FILE_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/files/file.h" |
| 8 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util_proxy.h" | 10 #include "base/files/file_util_proxy.h" |
| 10 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/platform_file.h" | 12 #include "base/platform_file.h" |
| 12 #include "webkit/browser/fileapi/file_system_file_util.h" | 13 #include "webkit/browser/fileapi/file_system_file_util.h" |
| 13 #include "webkit/browser/webkit_storage_browser_export.h" | 14 #include "webkit/browser/webkit_storage_browser_export.h" |
| 14 | 15 |
| 15 namespace base { | 16 namespace base { |
| 16 class Time; | 17 class Time; |
| 17 } | 18 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 31 class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE NativeFileUtil { | 32 class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE NativeFileUtil { |
| 32 public: | 33 public: |
| 33 enum CopyOrMoveMode { | 34 enum CopyOrMoveMode { |
| 34 COPY_NOSYNC, | 35 COPY_NOSYNC, |
| 35 COPY_SYNC, | 36 COPY_SYNC, |
| 36 MOVE | 37 MOVE |
| 37 }; | 38 }; |
| 38 static CopyOrMoveMode CopyOrMoveModeForDestination( | 39 static CopyOrMoveMode CopyOrMoveModeForDestination( |
| 39 const FileSystemURL& dest_url, bool copy); | 40 const FileSystemURL& dest_url, bool copy); |
| 40 | 41 |
| 41 static base::PlatformFileError CreateOrOpen( | 42 static base::File::Error CreateOrOpen( |
| 42 const base::FilePath& path, | 43 const base::FilePath& path, |
| 43 int file_flags, | 44 int file_flags, |
| 44 base::PlatformFile* file_handle, | 45 base::PlatformFile* file_handle, |
| 45 bool* created); | 46 bool* created); |
| 46 static base::PlatformFileError Close(base::PlatformFile file); | 47 static base::File::Error Close(base::PlatformFile file); |
| 47 static base::PlatformFileError EnsureFileExists(const base::FilePath& path, | 48 static base::File::Error EnsureFileExists(const base::FilePath& path, |
| 48 bool* created); | 49 bool* created); |
| 49 static base::PlatformFileError CreateDirectory(const base::FilePath& path, | 50 static base::File::Error CreateDirectory(const base::FilePath& path, |
| 50 bool exclusive, | 51 bool exclusive, |
| 51 bool recursive); | 52 bool recursive); |
| 52 static base::PlatformFileError GetFileInfo(const base::FilePath& path, | 53 static base::File::Error GetFileInfo(const base::FilePath& path, |
| 53 base::PlatformFileInfo* file_info); | 54 base::File::Info* file_info); |
| 54 static scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> | 55 static scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> |
| 55 CreateFileEnumerator(const base::FilePath& root_path, | 56 CreateFileEnumerator(const base::FilePath& root_path, |
| 56 bool recursive); | 57 bool recursive); |
| 57 static base::PlatformFileError Touch(const base::FilePath& path, | 58 static base::File::Error Touch(const base::FilePath& path, |
| 58 const base::Time& last_access_time, | 59 const base::Time& last_access_time, |
| 59 const base::Time& last_modified_time); | 60 const base::Time& last_modified_time); |
| 60 static base::PlatformFileError Truncate(const base::FilePath& path, | 61 static base::File::Error Truncate(const base::FilePath& path, |
| 61 int64 length); | 62 int64 length); |
| 62 static bool PathExists(const base::FilePath& path); | 63 static bool PathExists(const base::FilePath& path); |
| 63 static bool DirectoryExists(const base::FilePath& path); | 64 static bool DirectoryExists(const base::FilePath& path); |
| 64 static base::PlatformFileError CopyOrMoveFile( | 65 static base::File::Error CopyOrMoveFile( |
| 65 const base::FilePath& src_path, | 66 const base::FilePath& src_path, |
| 66 const base::FilePath& dest_path, | 67 const base::FilePath& dest_path, |
| 67 FileSystemOperation::CopyOrMoveOption option, | 68 FileSystemOperation::CopyOrMoveOption option, |
| 68 CopyOrMoveMode mode); | 69 CopyOrMoveMode mode); |
| 69 static base::PlatformFileError DeleteFile(const base::FilePath& path); | 70 static base::File::Error DeleteFile(const base::FilePath& path); |
| 70 static base::PlatformFileError DeleteDirectory(const base::FilePath& path); | 71 static base::File::Error DeleteDirectory(const base::FilePath& path); |
| 71 | 72 |
| 72 private: | 73 private: |
| 73 DISALLOW_IMPLICIT_CONSTRUCTORS(NativeFileUtil); | 74 DISALLOW_IMPLICIT_CONSTRUCTORS(NativeFileUtil); |
| 74 }; | 75 }; |
| 75 | 76 |
| 76 } // namespace fileapi | 77 } // namespace fileapi |
| 77 | 78 |
| 78 #endif // WEBKIT_BROWSER_FILEAPI_NATIVE_FILE_UTIL_H_ | 79 #endif // WEBKIT_BROWSER_FILEAPI_NATIVE_FILE_UTIL_H_ |
| OLD | NEW |