#include "net/base/file_stream.h"
#include <utility>
#include "build/build_config.h"
#include "net/base/file_stream_context.h"
#include "net/base/net_errors.h"
namespace net {
FileStream::FileStream(const scoped_refptr<base::TaskRunner>& task_runner)
: … { … }
FileStream::FileStream(base::File file,
const scoped_refptr<base::TaskRunner>& task_runner)
: … { … }
FileStream::~FileStream() { … }
int FileStream::Open(const base::FilePath& path,
int open_flags,
CompletionOnceCallback callback) { … }
int FileStream::Close(CompletionOnceCallback callback) { … }
bool FileStream::IsOpen() const { … }
int FileStream::Seek(int64_t offset, Int64CompletionOnceCallback callback) { … }
int FileStream::Read(IOBuffer* buf,
int buf_len,
CompletionOnceCallback callback) { … }
int FileStream::Write(IOBuffer* buf,
int buf_len,
CompletionOnceCallback callback) { … }
int FileStream::GetFileInfo(base::File::Info* file_info,
CompletionOnceCallback callback) { … }
int FileStream::Flush(CompletionOnceCallback callback) { … }
#if BUILDFLAG(IS_WIN)
int FileStream::ConnectNamedPipe(CompletionOnceCallback callback) {
return IsOpen() ? context_->ConnectNamedPipe(std::move(callback))
: ERR_UNEXPECTED;
}
#endif
}