OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "webkit/fileapi/overlay_file_util.h" |
| 6 |
| 7 #include <vector> |
| 8 |
| 9 #include "webkit/fileapi/file_system_operation_context.h" |
| 10 |
| 11 namespace fileapi { |
| 12 |
| 13 OverlayFileUtil::OverlayFileUtil(FileApiFileUtil* underlying_file_util) |
| 14 : underlying_file_util_(underlying_file_util) { |
| 15 } |
| 16 |
| 17 OverlayFileUtil::~OverlayFileUtil() { |
| 18 } |
| 19 |
| 20 PlatformFileError OverlayFileUtil::CreateOrOpen( |
| 21 FileSystemOperationContext* context, |
| 22 const FilePath& file_path, int file_flags, |
| 23 PlatformFile* file_handle, bool* created) { |
| 24 return underlying_file_util_->CreateOrOpen( |
| 25 context, file_path, file_flags, file_handle, created); |
| 26 } |
| 27 |
| 28 PlatformFileError OverlayFileUtil::Close( |
| 29 FileSystemOperationContext* context, |
| 30 PlatformFile file_handle) { |
| 31 return underlying_file_util_->Close(context, file_handle); |
| 32 } |
| 33 |
| 34 PlatformFileError OverlayFileUtil::EnsureFileExists( |
| 35 FileSystemOperationContext* context, |
| 36 const FilePath& file_path, |
| 37 bool* created) { |
| 38 return underlying_file_util_->EnsureFileExists(context, file_path, created); |
| 39 } |
| 40 |
| 41 PlatformFileError OverlayFileUtil::GetLocalFilePath( |
| 42 FileSystemOperationContext* context, |
| 43 const FilePath& virtual_path, |
| 44 FilePath* local_path) { |
| 45 return underlying_file_util_->GetLocalFilePath( |
| 46 context, virtual_path, local_path); |
| 47 } |
| 48 |
| 49 PlatformFileError OverlayFileUtil::GetFileInfo( |
| 50 FileSystemOperationContext* context, |
| 51 const FilePath& file_path, |
| 52 base::PlatformFileInfo* file_info, |
| 53 FilePath* platform_file_path) { |
| 54 return underlying_file_util_->GetFileInfo( |
| 55 context, file_path, file_info, platform_file_path); |
| 56 } |
| 57 |
| 58 PlatformFileError OverlayFileUtil::ReadDirectory( |
| 59 FileSystemOperationContext* context, |
| 60 const FilePath& file_path, |
| 61 std::vector<base::FileUtilProxy::Entry>* entries) { |
| 62 return underlying_file_util_->ReadDirectory(context, file_path, entries); |
| 63 } |
| 64 |
| 65 PlatformFileError OverlayFileUtil::CreateDirectory( |
| 66 FileSystemOperationContext* context, |
| 67 const FilePath& file_path, |
| 68 bool exclusive, |
| 69 bool recursive) { |
| 70 return underlying_file_util_->CreateDirectory( |
| 71 context, file_path, exclusive, recursive); |
| 72 } |
| 73 |
| 74 PlatformFileError OverlayFileUtil::Touch( |
| 75 FileSystemOperationContext* context, |
| 76 const FilePath& file_path, |
| 77 const base::Time& last_access_time, |
| 78 const base::Time& last_modified_time) { |
| 79 return underlying_file_util_->Touch( |
| 80 context, file_path, last_access_time, last_modified_time); |
| 81 } |
| 82 |
| 83 PlatformFileError OverlayFileUtil::Truncate( |
| 84 FileSystemOperationContext* context, |
| 85 const FilePath& file_path, |
| 86 int64 length) { |
| 87 return underlying_file_util_->Truncate(context, file_path, length); |
| 88 } |
| 89 |
| 90 PlatformFileError OverlayFileUtil::CopyOrMoveFile( |
| 91 FileSystemOperationContext* context, |
| 92 const FilePath& src_file_path, |
| 93 const FilePath& dest_file_path, |
| 94 bool copy) { |
| 95 return underlying_file_util_->CopyOrMoveFile( |
| 96 context, src_file_path, dest_file_path, copy); |
| 97 } |
| 98 |
| 99 PlatformFileError OverlayFileUtil::CopyInForeignFile( |
| 100 FileSystemOperationContext* context, |
| 101 const FilePath& src_file_path, |
| 102 const FilePath& dest_file_path) { |
| 103 return underlying_file_util_->CopyInForeignFile( |
| 104 context, src_file_path, dest_file_path); |
| 105 } |
| 106 |
| 107 PlatformFileError OverlayFileUtil::DeleteFile( |
| 108 FileSystemOperationContext* context, |
| 109 const FilePath& file_path) { |
| 110 return underlying_file_util_->DeleteFile(context, file_path); |
| 111 } |
| 112 |
| 113 PlatformFileError OverlayFileUtil::DeleteSingleDirectory( |
| 114 FileSystemOperationContext* context, |
| 115 const FilePath& file_path) { |
| 116 return underlying_file_util_->DeleteSingleDirectory(context, file_path); |
| 117 } |
| 118 |
| 119 bool OverlayFileUtil::PathExists( |
| 120 FileSystemOperationContext* context, |
| 121 const FilePath& file_path) { |
| 122 return underlying_file_util_->PathExists(context, file_path); |
| 123 } |
| 124 |
| 125 bool OverlayFileUtil::DirectoryExists( |
| 126 FileSystemOperationContext* context, |
| 127 const FilePath& file_path) { |
| 128 return underlying_file_util_->DirectoryExists(context, file_path); |
| 129 } |
| 130 |
| 131 bool OverlayFileUtil::IsDirectoryEmpty( |
| 132 FileSystemOperationContext* context, |
| 133 const FilePath& file_path) { |
| 134 return underlying_file_util_->IsDirectoryEmpty(context, file_path); |
| 135 } |
| 136 |
| 137 FileApiFileUtil::AbstractFileEnumerator* OverlayFileUtil::CreateFileEnumerator( |
| 138 FileSystemOperationContext* context, |
| 139 const FilePath& root_path) { |
| 140 return underlying_file_util_->CreateFileEnumerator(context, root_path); |
| 141 } |
| 142 |
| 143 } // namespace fileapi |
OLD | NEW |