| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef WEBKIT_FILEAPI_LOCAL_FILE_UTIL_H_ | |
| 6 #define WEBKIT_FILEAPI_LOCAL_FILE_UTIL_H_ | |
| 7 | |
| 8 #include "base/compiler_specific.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/platform_file.h" | |
| 11 #include "webkit/fileapi/file_system_file_util.h" | |
| 12 #include "webkit/storage/webkit_storage_export.h" | |
| 13 | |
| 14 namespace base { | |
| 15 class FilePath; | |
| 16 class Time; | |
| 17 } | |
| 18 | |
| 19 class GURL; | |
| 20 | |
| 21 namespace fileapi { | |
| 22 | |
| 23 class FileSystemOperationContext; | |
| 24 class FileSystemURL; | |
| 25 | |
| 26 // An instance of this class is created and owned by *MountPointProvider. | |
| 27 class WEBKIT_STORAGE_EXPORT_PRIVATE LocalFileUtil : public FileSystemFileUtil { | |
| 28 public: | |
| 29 LocalFileUtil(); | |
| 30 virtual ~LocalFileUtil(); | |
| 31 | |
| 32 virtual base::PlatformFileError CreateOrOpen( | |
| 33 FileSystemOperationContext* context, | |
| 34 const FileSystemURL& url, | |
| 35 int file_flags, | |
| 36 base::PlatformFile* file_handle, | |
| 37 bool* created) OVERRIDE; | |
| 38 virtual base::PlatformFileError Close( | |
| 39 FileSystemOperationContext* context, | |
| 40 base::PlatformFile file) OVERRIDE; | |
| 41 virtual base::PlatformFileError EnsureFileExists( | |
| 42 FileSystemOperationContext* context, | |
| 43 const FileSystemURL& url, bool* created) OVERRIDE; | |
| 44 virtual base::PlatformFileError CreateDirectory( | |
| 45 FileSystemOperationContext* context, | |
| 46 const FileSystemURL& url, | |
| 47 bool exclusive, | |
| 48 bool recursive) OVERRIDE; | |
| 49 virtual base::PlatformFileError GetFileInfo( | |
| 50 FileSystemOperationContext* context, | |
| 51 const FileSystemURL& url, | |
| 52 base::PlatformFileInfo* file_info, | |
| 53 base::FilePath* platform_file) OVERRIDE; | |
| 54 virtual scoped_ptr<AbstractFileEnumerator> CreateFileEnumerator( | |
| 55 FileSystemOperationContext* context, | |
| 56 const FileSystemURL& root_url) OVERRIDE; | |
| 57 virtual base::PlatformFileError GetLocalFilePath( | |
| 58 FileSystemOperationContext* context, | |
| 59 const FileSystemURL& file_system_url, | |
| 60 base::FilePath* local_file_path) OVERRIDE; | |
| 61 virtual base::PlatformFileError Touch( | |
| 62 FileSystemOperationContext* context, | |
| 63 const FileSystemURL& url, | |
| 64 const base::Time& last_access_time, | |
| 65 const base::Time& last_modified_time) OVERRIDE; | |
| 66 virtual base::PlatformFileError Truncate( | |
| 67 FileSystemOperationContext* context, | |
| 68 const FileSystemURL& url, | |
| 69 int64 length) OVERRIDE; | |
| 70 virtual base::PlatformFileError CopyOrMoveFile( | |
| 71 FileSystemOperationContext* context, | |
| 72 const FileSystemURL& src_url, | |
| 73 const FileSystemURL& dest_url, | |
| 74 bool copy) OVERRIDE; | |
| 75 virtual base::PlatformFileError CopyInForeignFile( | |
| 76 FileSystemOperationContext* context, | |
| 77 const base::FilePath& src_file_path, | |
| 78 const FileSystemURL& dest_url) OVERRIDE; | |
| 79 virtual base::PlatformFileError DeleteFile( | |
| 80 FileSystemOperationContext* context, | |
| 81 const FileSystemURL& url) OVERRIDE; | |
| 82 virtual base::PlatformFileError DeleteDirectory( | |
| 83 FileSystemOperationContext* context, | |
| 84 const FileSystemURL& url) OVERRIDE; | |
| 85 virtual webkit_blob::ScopedFile CreateSnapshotFile( | |
| 86 FileSystemOperationContext* context, | |
| 87 const FileSystemURL& url, | |
| 88 base::PlatformFileError* error, | |
| 89 base::PlatformFileInfo* file_info, | |
| 90 base::FilePath* platform_path) OVERRIDE; | |
| 91 | |
| 92 private: | |
| 93 // Given the filesystem url, produces a real, full local path for the | |
| 94 // underlying filesystem (which is usually the native filesystem). | |
| 95 FileSystemURL GetLocalPath( | |
| 96 FileSystemOperationContext* context, | |
| 97 const FileSystemURL& url); | |
| 98 | |
| 99 DISALLOW_COPY_AND_ASSIGN(LocalFileUtil); | |
| 100 }; | |
| 101 | |
| 102 } // namespace fileapi | |
| 103 | |
| 104 #endif // WEBKIT_FILEAPI_LOCAL_FILE_UTIL_H_ | |
| OLD | NEW |