| Index: net/base/file_stream.cc
|
| diff --git a/net/base/file_stream.cc b/net/base/file_stream.cc
|
| index bf56a49e8c011ea7907d68c4268cd6d5e0e2838b..61212d44be4bcf5ae3d1e812278d77cc453a261a 100644
|
| --- a/net/base/file_stream.cc
|
| +++ b/net/base/file_stream.cc
|
| @@ -30,12 +30,12 @@ int FileStream::Open(const base::FilePath& path, int open_flags,
|
| }
|
|
|
| DCHECK(open_flags & base::File::FLAG_ASYNC);
|
| - context_->OpenAsync(path, open_flags, callback);
|
| + context_->Open(path, open_flags, callback);
|
| return ERR_IO_PENDING;
|
| }
|
|
|
| int FileStream::Close(const CompletionCallback& callback) {
|
| - context_->CloseAsync(callback);
|
| + context_->Close(callback);
|
| return ERR_IO_PENDING;
|
| }
|
|
|
| @@ -43,13 +43,13 @@ bool FileStream::IsOpen() const {
|
| return context_->file().IsValid();
|
| }
|
|
|
| -int FileStream::Seek(Whence whence,
|
| +int FileStream::Seek(base::File::Whence whence,
|
| int64 offset,
|
| const Int64CompletionCallback& callback) {
|
| if (!IsOpen())
|
| return ERR_UNEXPECTED;
|
|
|
| - context_->SeekAsync(whence, offset, callback);
|
| + context_->Seek(whence, offset, callback);
|
| return ERR_IO_PENDING;
|
| }
|
|
|
| @@ -62,7 +62,19 @@ int FileStream::Read(IOBuffer* buf,
|
| // read(..., 0) will return 0, which indicates end-of-file.
|
| DCHECK_GT(buf_len, 0);
|
|
|
| - return context_->ReadAsync(buf, buf_len, callback);
|
| + return context_->Read(buf, buf_len, callback);
|
| +}
|
| +
|
| +int FileStream::ReadNoBlocking(IOBuffer* buf,
|
| + int buf_len,
|
| + const CompletionCallback& callback) {
|
| + if (!IsOpen())
|
| + return ERR_UNEXPECTED;
|
| +
|
| + // read(..., 0) will return 0, which indicates end-of-file.
|
| + DCHECK_GT(buf_len, 0);
|
| +
|
| + return context_->ReadNoBlocking(buf, buf_len, callback);
|
| }
|
|
|
| int FileStream::Write(IOBuffer* buf,
|
| @@ -74,14 +86,26 @@ int FileStream::Write(IOBuffer* buf,
|
| // write(..., 0) will return 0, which indicates end-of-file.
|
| DCHECK_GT(buf_len, 0);
|
|
|
| - return context_->WriteAsync(buf, buf_len, callback);
|
| + return context_->Write(buf, buf_len, callback);
|
| +}
|
| +
|
| +int FileStream::WriteNoBlocking(IOBuffer* buf,
|
| + int buf_len,
|
| + const CompletionCallback& callback) {
|
| + if (!IsOpen())
|
| + return ERR_UNEXPECTED;
|
| +
|
| + // write(..., 0) will return 0, which indicates end-of-file.
|
| + DCHECK_GT(buf_len, 0);
|
| +
|
| + return context_->WriteNoBlocking(buf, buf_len, callback);
|
| }
|
|
|
| int FileStream::Flush(const CompletionCallback& callback) {
|
| if (!IsOpen())
|
| return ERR_UNEXPECTED;
|
|
|
| - context_->FlushAsync(callback);
|
| + context_->Flush(callback);
|
| return ERR_IO_PENDING;
|
| }
|
|
|
|
|