#include "base/files/file_proxy.h"
#include <memory>
#include <optional>
#include <utility>
#include "base/containers/heap_array.h"
#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/numerics/safe_conversions.h"
#include "base/task/task_runner.h"
namespace {
void FileDeleter(base::File file) { … }
}
namespace base {
class FileHelper { … };
namespace {
class GenericFileHelper : public FileHelper { … };
class CreateOrOpenHelper : public FileHelper { … };
class CreateTemporaryHelper : public FileHelper { … };
class GetInfoHelper : public FileHelper { … };
class ReadHelper : public FileHelper { … };
class WriteHelper : public FileHelper { … };
}
FileProxy::FileProxy(TaskRunner* task_runner) : … { … }
FileProxy::~FileProxy() { … }
bool FileProxy::CreateOrOpen(const FilePath& file_path,
uint32_t file_flags,
StatusCallback callback) { … }
bool FileProxy::CreateTemporary(uint32_t additional_file_flags,
CreateTemporaryCallback callback) { … }
bool FileProxy::IsValid() const { … }
void FileProxy::SetFile(File file) { … }
File FileProxy::TakeFile() { … }
File FileProxy::DuplicateFile() { … }
PlatformFile FileProxy::GetPlatformFile() const { … }
bool FileProxy::Close(StatusCallback callback) { … }
bool FileProxy::GetInfo(GetFileInfoCallback callback) { … }
bool FileProxy::Read(int64_t offset, int bytes_to_read, ReadCallback callback) { … }
bool FileProxy::Write(int64_t offset,
base::span<const uint8_t> data,
WriteCallback callback) { … }
bool FileProxy::SetTimes(Time last_access_time,
Time last_modified_time,
StatusCallback callback) { … }
bool FileProxy::SetLength(int64_t length, StatusCallback callback) { … }
bool FileProxy::Flush(StatusCallback callback) { … }
}