diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-08-14 11:38:45 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-08-14 17:16:47 +0000 |
commit | 3a97ca8dd9b96b599ae2d33e40df0dd2f7ea5859 (patch) | |
tree | 43cc572ba067417c7341db81f71ae7cc6e0fcc3e /chromium/net/base/file_stream_context.h | |
parent | f61ab1ac7f855cd281809255c0aedbb1895e1823 (diff) | |
download | qtwebengine-chromium-3a97ca8dd9b96b599ae2d33e40df0dd2f7ea5859.tar.gz |
BASELINE: Update chromium to 45.0.2454.40
Change-Id: Id2121d9f11a8fc633677236c65a3e41feef589e4
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'chromium/net/base/file_stream_context.h')
-rw-r--r-- | chromium/net/base/file_stream_context.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/chromium/net/base/file_stream_context.h b/chromium/net/base/file_stream_context.h index 74677fe8fb9..c1846c460d3 100644 --- a/chromium/net/base/file_stream_context.h +++ b/chromium/net/base/file_stream_context.h @@ -31,6 +31,7 @@ #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" #include "base/move.h" +#include "base/single_thread_task_runner.h" #include "base/task_runner.h" #include "net/base/completion_callback.h" #include "net/base/file_stream.h" @@ -74,7 +75,6 @@ class FileStream::Context { int buf_len, const CompletionCallback& callback); - const base::File& file() const { return file_; } bool async_in_progress() const { return async_in_progress_; } //////////////////////////////////////////////////////////////////////////// @@ -92,19 +92,20 @@ class FileStream::Context { void Close(const CompletionCallback& callback); - void Seek(base::File::Whence whence, - int64 offset, - const Int64CompletionCallback& callback); + // Seeks |offset| bytes from the start of the file. + void Seek(int64_t offset, const Int64CompletionCallback& callback); void Flush(const CompletionCallback& callback); + bool IsOpen() const; + private: struct IOResult { IOResult(); - IOResult(int64 result, logging::SystemErrorCode os_error); + IOResult(int64_t result, logging::SystemErrorCode os_error); static IOResult FromOSError(logging::SystemErrorCode os_error); - int64 result; + int64_t result; logging::SystemErrorCode os_error; // Set only when result < 0. }; @@ -149,7 +150,7 @@ class FileStream::Context { //////////////////////////////////////////////////////////////////////////// // Adjusts the position from where the data is read. - IOResult SeekFileImpl(base::File::Whence whence, int64 offset); + IOResult SeekFileImpl(int64_t offset); void OnFileOpened(); @@ -180,15 +181,15 @@ class FileStream::Context { // The |buf_len| parameter contains the number of bytes to be read. // The |overlapped| parameter is a pointer to the OVERLAPPED structure being // used. - // The |origin_thread_loop| is a MessageLoopProxy instance used to post tasks - // back to the originating thread. + // The |origin_thread_task_runner| is a task runner instance used to post + // tasks back to the originating thread. static void ReadAsync( FileStream::Context* context, HANDLE file, scoped_refptr<IOBuffer> buf, int buf_len, OVERLAPPED* overlapped, - scoped_refptr<base::MessageLoopProxy> origin_thread_loop); + scoped_refptr<base::SingleThreadTaskRunner> origin_thread_task_runner); // This callback executes on the main calling thread. It informs the caller // about the result of the ReadFile call. |