diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-06 23:33:24 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-06 23:33:24 +0000 |
commit | dbf036fcb743cfdcd5be421364c8b89b10ee3f55 (patch) | |
tree | 034c3028c8b523d2bb6c2703416b26a81bc31663 /net/socket/tcp_client_socket_libevent.h | |
parent | ad24b1827fe58c4a22c0cddb5791a95f2ab1b21b (diff) | |
download | chromium_src-dbf036fcb743cfdcd5be421364c8b89b10ee3f55.zip chromium_src-dbf036fcb743cfdcd5be421364c8b89b10ee3f55.tar.gz chromium_src-dbf036fcb743cfdcd5be421364c8b89b10ee3f55.tar.bz2 |
base::Bind: Convert StreamSocket::Connect.
BUG=none
TEST=none
R=csilv
Review URL: http://codereview.chromium.org/8801004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113283 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/tcp_client_socket_libevent.h')
-rw-r--r-- | net/socket/tcp_client_socket_libevent.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/socket/tcp_client_socket_libevent.h b/net/socket/tcp_client_socket_libevent.h index 2a6b041..ac73f2c 100644 --- a/net/socket/tcp_client_socket_libevent.h +++ b/net/socket/tcp_client_socket_libevent.h @@ -42,8 +42,9 @@ class NET_EXPORT_PRIVATE TCPClientSocketLibevent : public StreamSocket, // Binds the socket to a local IP address and port. int Bind(const IPEndPoint& address); - // StreamSocket methods: + // StreamSocket implementation. virtual int Connect(OldCompletionCallback* callback) OVERRIDE; + virtual int Connect(const CompletionCallback& callback) OVERRIDE; virtual void Disconnect() OVERRIDE; virtual bool IsConnected() const OVERRIDE; virtual bool IsConnectedAndIdle() const OVERRIDE; @@ -57,7 +58,7 @@ class NET_EXPORT_PRIVATE TCPClientSocketLibevent : public StreamSocket, virtual int64 NumBytesRead() const OVERRIDE; virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; - // Socket methods: + // Socket implementation. // Multiple outstanding requests are not supported. // Full duplex mode (reading and writing at the same time) is supported virtual int Read(IOBuffer* buf, @@ -100,14 +101,13 @@ class NET_EXPORT_PRIVATE TCPClientSocketLibevent : public StreamSocket, public: explicit WriteWatcher(TCPClientSocketLibevent* socket) : socket_(socket) {} - // MessageLoopForIO::Watcher methods - + // MessageLoopForIO::Watcher implementation. virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE {} - virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE { if (socket_->waiting_connect()) { socket_->DidCompleteConnect(); - } else if (socket_->write_callback_) { + } else if (socket_->old_write_callback_ || + !socket_->write_callback_.is_null()) { socket_->DidCompleteWrite(); } } @@ -179,7 +179,8 @@ class NET_EXPORT_PRIVATE TCPClientSocketLibevent : public StreamSocket, OldCompletionCallback* read_callback_; // External callback; called when write is complete. - OldCompletionCallback* write_callback_; + OldCompletionCallback* old_write_callback_; + CompletionCallback write_callback_; // The next state for the Connect() state machine. ConnectState next_connect_state_; |