OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/base/file_stream.h" | 5 #include "net/base/file_stream.h" |
6 | 6 |
7 #include "base/profiler/scoped_tracker.h" | 7 #include "base/profiler/scoped_tracker.h" |
8 #include "net/base/file_stream_context.h" | 8 #include "net/base/file_stream_context.h" |
9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 int FileStream::Close(const CompletionCallback& callback) { | 38 int FileStream::Close(const CompletionCallback& callback) { |
39 context_->Close(callback); | 39 context_->Close(callback); |
40 return ERR_IO_PENDING; | 40 return ERR_IO_PENDING; |
41 } | 41 } |
42 | 42 |
43 bool FileStream::IsOpen() const { | 43 bool FileStream::IsOpen() const { |
44 return context_->file().IsValid(); | 44 return context_->file().IsValid(); |
45 } | 45 } |
46 | 46 |
47 int FileStream::Seek(base::File::Whence whence, | 47 int FileStream::Seek(base::File::Whence whence, |
48 int64 offset, | 48 int64_t offset, |
49 const Int64CompletionCallback& callback) { | 49 const Int64CompletionCallback& callback) { |
50 if (!IsOpen()) | 50 if (!IsOpen()) |
51 return ERR_UNEXPECTED; | 51 return ERR_UNEXPECTED; |
52 | 52 |
53 context_->Seek(whence, offset, callback); | 53 context_->Seek(whence, offset, callback); |
54 return ERR_IO_PENDING; | 54 return ERR_IO_PENDING; |
55 } | 55 } |
56 | 56 |
57 int FileStream::Read(IOBuffer* buf, | 57 int FileStream::Read(IOBuffer* buf, |
58 int buf_len, | 58 int buf_len, |
(...skipping 27 matching lines...) Expand all Loading... |
86 | 86 |
87 context_->Flush(callback); | 87 context_->Flush(callback); |
88 return ERR_IO_PENDING; | 88 return ERR_IO_PENDING; |
89 } | 89 } |
90 | 90 |
91 const base::File& FileStream::GetFileForTesting() const { | 91 const base::File& FileStream::GetFileForTesting() const { |
92 return context_->file(); | 92 return context_->file(); |
93 } | 93 } |
94 | 94 |
95 } // namespace net | 95 } // namespace net |
OLD | NEW |