| Index: net/base/file_stream_posix.h
|
| ===================================================================
|
| --- net/base/file_stream_posix.h (revision 147715)
|
| +++ net/base/file_stream_posix.h (working copy)
|
| @@ -7,8 +7,6 @@
|
| #ifndef NET_BASE_FILE_STREAM_POSIX_H_
|
| #define NET_BASE_FILE_STREAM_POSIX_H_
|
|
|
| -#include "base/memory/scoped_ptr.h"
|
| -#include "base/memory/weak_ptr.h"
|
| #include "base/platform_file.h"
|
| #include "net/base/completion_callback.h"
|
| #include "net/base/file_stream_whence.h"
|
| @@ -54,25 +52,18 @@
|
| const net::BoundNetLog& owner_bound_net_log);
|
| base::PlatformFile GetPlatformFileForTesting();
|
|
|
| - // Resets on_io_complete_ and WeakPtr's.
|
| - // Called when Read() or Write() is completed.
|
| - void ResetOnIOComplete();
|
| -
|
| private:
|
| - // Called when the file_ is closed asynchronously.
|
| - void OnClosed(const CompletionCallback& callback);
|
| + class AsyncContext;
|
|
|
| - // Waits until the in-flight async open/close/read/write operation is
|
| - // complete.
|
| - void WaitForIOCompletion();
|
| + bool is_async() { return !!(open_flags_ & base::PLATFORM_FILE_ASYNC); }
|
|
|
| - base::PlatformFile file_;
|
| + // Context performing I/O operations. Despite its name the context is used
|
| + // for synchronous operations too, but it was extracted into separate class
|
| + // to perform asynchronous operations correctly.
|
| + AsyncContext* context_;
|
| +
|
| int open_flags_;
|
| - bool auto_closed_;
|
| - bool record_uma_;
|
| net::BoundNetLog bound_net_log_;
|
| - base::WeakPtrFactory<FileStreamPosix> weak_ptr_factory_;
|
| - scoped_ptr<base::WaitableEvent> on_io_complete_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(FileStreamPosix);
|
| };
|
|
|