Index: net/base/file_stream.h |
diff --git a/net/base/file_stream.h b/net/base/file_stream.h |
index 57011b77decb8103fee14803db14c5e3046df764..90df4e633644a22b7ebd412d3aaa1ffe55d6a483 100644 |
--- a/net/base/file_stream.h |
+++ b/net/base/file_stream.h |
@@ -12,7 +12,6 @@ |
#include "base/files/file.h" |
#include "net/base/completion_callback.h" |
-#include "net/base/file_stream_whence.h" |
#include "net/base/net_export.h" |
namespace base { |
@@ -69,7 +68,7 @@ class NET_EXPORT FileStream { |
// 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, |
+ virtual int Seek(base::File::Whence whence, int64 offset, |
const Int64CompletionCallback& callback); |
// Call this method to read data from the current stream position |
@@ -95,6 +94,11 @@ class NET_EXPORT FileStream { |
virtual int Read(IOBuffer* buf, int buf_len, |
const CompletionCallback& callback); |
+ // Same as Read, but delays starting the operation until it should complete |
+ // without blocking, reducing the load on the task_runner. |
+ virtual int ReadNoBlocking(IOBuffer* buf, int buf_len, |
Sergey Ulanov
2014/06/12 08:10:21
Do we really need to differentiate between blockin
rvargas (doing something else)
2014/06/13 02:49:10
Unfortunately, I think that decision should be tak
Sergey Ulanov
2014/06/13 19:31:50
Read() can be made non-blocking and such that it w
rvargas (doing something else)
2014/06/13 19:58:24
I'm not really trying to change the way FileStream
Sergey Ulanov
2014/06/14 00:58:22
FileStream owns the file descriptors and it doesn'
rvargas (doing something else)
2014/06/14 01:42:55
FileStream can receive a file on construction, and
|
+ const CompletionCallback& callback); |
+ |
// Call this method to write data at the current stream position |
// asynchronously. Up to buf_len bytes will be written from buf. (In |
// other words, partial writes are allowed.) Returns the number of |
@@ -120,6 +124,11 @@ class NET_EXPORT FileStream { |
virtual int Write(IOBuffer* buf, int buf_len, |
const CompletionCallback& callback); |
+ // Same as Write, but delays starting the operation until it should complete |
+ // without blocking, reducing the load on the task_runner. |
+ virtual int WriteNoBlocking(IOBuffer* buf, int buf_len, |
+ const CompletionCallback& callback); |
+ |
// Forces out a filesystem sync on this file to make sure that the file was |
// written out to disk and is not currently sitting in the buffer. This does |
// not have to be called, it just forces one to happen at the time of |