Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef WEBKIT_BLOB_FILE_READER_H_ | |
| 6 #define WEBKIT_BLOB_FILE_READER_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/compiler_specific.h" | |
| 11 #include "net/base/completion_callback.h" | |
| 12 #include "webkit/blob/blob_export.h" | |
| 13 | |
| 14 namespace net { | |
| 15 class FileStream; | |
| 16 class IOBuffer; | |
| 17 } | |
| 18 | |
| 19 namespace webkit_blob { | |
| 20 | |
| 21 // A generic interface for reading a file-like object. | |
| 22 class BLOB_EXPORT FileReader { | |
| 23 public: | |
| 24 virtual ~FileReader() {} | |
| 25 | |
| 26 // Reads from the current cursor position asynchronously. | |
| 27 // This works mostly same as how net::FileStream::Read() works except that | |
| 28 // it internally opens (and seeks) the file if it is not opened yet. | |
|
michaeln
2012/04/13 20:24:51
The middle two lines in this doc comment seem out
kinuko
2012/04/16 10:24:21
Done.
| |
| 29 // It is invalid to call Read while there is an in-flight Read operation. | |
| 30 virtual int Read(net::IOBuffer* buf, int buf_len, | |
| 31 const net::CompletionCallback& callback) = 0; | |
| 32 }; | |
| 33 | |
| 34 } // namespace webkit_blob | |
| 35 | |
| 36 #endif // WEBKIT_BLOB_FILE_READER_H_ | |
| OLD | NEW |