Chromium Code Reviews| Index: net/base/file_stream.cc |
| diff --git a/net/base/file_stream.cc b/net/base/file_stream.cc |
| index 85adaece3cd404aaf703330c1be77863e503e749..8e4558cbfebd84fefa002c29105888d9a7649201 100644 |
| --- a/net/base/file_stream.cc |
| +++ b/net/base/file_stream.cc |
| @@ -93,6 +93,16 @@ int FileStream::OpenSync(const base::FilePath& path, int open_flags) { |
| return context_->OpenSync(path, open_flags_); |
| } |
| +int FileStream::Close(const CompletionCallback& callback) { |
| + if (!is_async()) { |
|
mmenke
2013/09/09 15:03:09
All the other sync calls are preceded by a:
base:
waffles
2013/09/09 22:50:56
Done.
|
| + context_->CloseSync(); |
| + context_.reset(); |
|
mmenke
2013/09/09 15:03:09
Erm....Doesn't this result in a crash on destructi
waffles
2013/09/09 22:50:56
Hm, yes, I agree.
|
| + return OK; |
| + } |
| + context_->CloseAsync(callback); |
| + return ERR_IO_PENDING; |
| +} |
| + |
| bool FileStream::IsOpen() const { |
| return context_->file() != base::kInvalidPlatformFileValue; |
| } |