Chromium Code Reviews| Index: net/base/file_stream.cc |
| diff --git a/net/base/file_stream.cc b/net/base/file_stream.cc |
| index bf56a49e8c011ea7907d68c4268cd6d5e0e2838b..0c58eb8e4de3564b3c064729f748bc252c60bc66 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,7 @@ 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::Write(IOBuffer* buf, |
| @@ -71,17 +71,14 @@ int FileStream::Write(IOBuffer* buf, |
| if (!IsOpen()) |
| return ERR_UNEXPECTED; |
| - // 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); |
|
hashimoto
2014/06/19 01:51:56
nit: Why did you remove DCHECK here while keeping
rvargas (doing something else)
2014/06/19 17:11:43
It was suggested by wtc, given that there is no EO
|
| } |
| int FileStream::Flush(const CompletionCallback& callback) { |
| if (!IsOpen()) |
| return ERR_UNEXPECTED; |
| - context_->FlushAsync(callback); |
| + context_->Flush(callback); |
| return ERR_IO_PENDING; |
| } |