Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: webkit/blob/file_reader.h

Issue 10038019: Add FileReader interface and implement FileSystemFileReader (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/blob/blob_url_request_job.cc ('k') | webkit/blob/local_file_reader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 //
28 // Up to buf_len bytes will be copied into buf. (In other words, partial
29 // reads are allowed.) Returns the number of bytes copied, 0 if at
30 // end-of-file, or an error code if the operation could not be performed.
31 // If the read could not complete synchronously, then ERR_IO_PENDING is
32 // returned, and the callback will be run on the thread where Read()
33 // was called, when the read has completed.
34 //
35 // It is invalid to call Read while there is an in-flight Read operation.
36 virtual int Read(net::IOBuffer* buf, int buf_len,
37 const net::CompletionCallback& callback) = 0;
38 };
39
40 } // namespace webkit_blob
41
42 #endif // WEBKIT_BLOB_FILE_READER_H_
OLDNEW
« no previous file with comments | « webkit/blob/blob_url_request_job.cc ('k') | webkit/blob/local_file_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698