Chromium Code Reviews| Index: webkit/blob/file_reader.h |
| diff --git a/webkit/blob/file_reader.h b/webkit/blob/file_reader.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3232c8759c83de884503ac594cd2cb9719b39e3e |
| --- /dev/null |
| +++ b/webkit/blob/file_reader.h |
| @@ -0,0 +1,36 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef WEBKIT_BLOB_FILE_READER_H_ |
| +#define WEBKIT_BLOB_FILE_READER_H_ |
| +#pragma once |
| + |
| +#include "base/basictypes.h" |
| +#include "base/compiler_specific.h" |
| +#include "net/base/completion_callback.h" |
| +#include "webkit/blob/blob_export.h" |
| + |
| +namespace net { |
| +class FileStream; |
| +class IOBuffer; |
| +} |
| + |
| +namespace webkit_blob { |
| + |
| +// A generic interface for reading a file-like object. |
| +class BLOB_EXPORT FileReader { |
| + public: |
| + virtual ~FileReader() {} |
| + |
| + // Reads from the current cursor position asynchronously. |
| + // This works mostly same as how net::FileStream::Read() works except that |
| + // 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.
|
| + // It is invalid to call Read while there is an in-flight Read operation. |
| + virtual int Read(net::IOBuffer* buf, int buf_len, |
| + const net::CompletionCallback& callback) = 0; |
| +}; |
| + |
| +} // namespace webkit_blob |
| + |
| +#endif // WEBKIT_BLOB_FILE_READER_H_ |