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

Unified Diff: net/base/file_stream.h

Issue 9949011: Make FileStream::Seek async and add FileStream::SeekSync for sync operation (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/completion_callback.h ('k') | net/base/file_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/file_stream.h
diff --git a/net/base/file_stream.h b/net/base/file_stream.h
index c0db903b5ca90bb5fd4d6de3d25818a6dfa7ebd2..4b84ec06989a6c4a6fff8b6d280b61d0d0c414c8 100644
--- a/net/base/file_stream.h
+++ b/net/base/file_stream.h
@@ -94,11 +94,20 @@ class NET_EXPORT FileStream {
// Returns true if Open succeeded and Close has not been called.
virtual bool IsOpen() const;
- // Adjust the position from where data is read. Upon success, the stream
- // position relative to the start of the file is returned. Otherwise, an
- // error code is returned. It is not valid to call Seek while a Read call
- // has a pending completion.
- virtual int64 Seek(Whence whence, int64 offset);
+ // Adjust the position from where data is read asynchronously.
+ // Upon success, ERR_IO_PENDING is returned and |callback| will be run
+ // on the thread where Seek() was called with the the stream position
+ // relative to the start of the file. Otherwise, an error code is returned.
+ // It is invalid to request any asynchronous operations while there is an
+ // in-flight asynchronous operation.
+ virtual int Seek(Whence whence, int64 offset,
+ const Int64CompletionCallback& callback);
+
+ // Adjust the position from where data is read synchronously.
+ // Upon success, the stream position relative to the start of the file is
+ // returned. Otherwise, an error code is returned. It is not valid to
+ // call SeekSync while a Read call has a pending completion.
+ virtual int64 SeekSync(Whence whence, int64 offset);
// Returns the number of bytes available to read from the current stream
// position until the end of the file. Otherwise, an error code is returned.
« no previous file with comments | « net/base/completion_callback.h ('k') | net/base/file_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698