#include "net/base/file_stream_context.h"
#include <utility>
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/task/task_runner.h"
#include "base/threading/thread_restrictions.h"
#include "base/values.h"
#include "build/build_config.h"
#include "net/base/net_errors.h"
#if BUILDFLAG(IS_ANDROID)
#include "base/android/content_uri_utils.h"
#endif
#if BUILDFLAG(IS_MAC)
#include "net/base/apple/guarded_fd.h"
#endif
namespace net {
namespace {
void CallInt64ToInt(CompletionOnceCallback callback, int64_t result) { … }
}
FileStream::Context::IOResult::IOResult()
: … { … }
FileStream::Context::IOResult::IOResult(int64_t result,
logging::SystemErrorCode os_error)
: … { … }
FileStream::Context::IOResult FileStream::Context::IOResult::FromOSError(
logging::SystemErrorCode os_error) { … }
FileStream::Context::OpenResult::OpenResult() = default;
FileStream::Context::OpenResult::OpenResult(base::File file,
IOResult error_code)
: … { … }
FileStream::Context::OpenResult::OpenResult(OpenResult&& other)
: … { … }
FileStream::Context::OpenResult& FileStream::Context::OpenResult::operator=(
OpenResult&& other) { … }
void FileStream::Context::Orphan() { … }
void FileStream::Context::Open(const base::FilePath& path,
int open_flags,
CompletionOnceCallback callback) { … }
void FileStream::Context::Close(CompletionOnceCallback callback) { … }
void FileStream::Context::Seek(int64_t offset,
Int64CompletionOnceCallback callback) { … }
void FileStream::Context::GetFileInfo(base::File::Info* file_info,
CompletionOnceCallback callback) { … }
void FileStream::Context::Flush(CompletionOnceCallback callback) { … }
bool FileStream::Context::IsOpen() const { … }
FileStream::Context::OpenResult FileStream::Context::OpenFileImpl(
const base::FilePath& path, int open_flags) { … }
FileStream::Context::IOResult FileStream::Context::GetFileInfoImpl(
base::File::Info* file_info) { … }
FileStream::Context::IOResult FileStream::Context::CloseFileImpl() { … }
FileStream::Context::IOResult FileStream::Context::FlushFileImpl() { … }
void FileStream::Context::OnOpenCompleted(CompletionOnceCallback callback,
OpenResult open_result) { … }
void FileStream::Context::CloseAndDelete() { … }
Int64CompletionOnceCallback FileStream::Context::IntToInt64(
CompletionOnceCallback callback) { … }
void FileStream::Context::OnAsyncCompleted(Int64CompletionOnceCallback callback,
const IOResult& result) { … }
}