summaryrefslogtreecommitdiffstats
path: root/net/socket/tcp_client_socket_libevent.h
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-09 18:43:55 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-09 18:43:55 +0000
commit83039bbf2f2ec0e918f7000b5212d104f60f2bb7 (patch)
treeb22dbd0051b57a437a588772a874271f0d02ffdb /net/socket/tcp_client_socket_libevent.h
parente7456a206fe5b50aeb322ebabd6c26adc869a5fd (diff)
downloadchromium_src-83039bbf2f2ec0e918f7000b5212d104f60f2bb7.zip
chromium_src-83039bbf2f2ec0e918f7000b5212d104f60f2bb7.tar.gz
chromium_src-83039bbf2f2ec0e918f7000b5212d104f60f2bb7.tar.bz2
Migrate net/socket/socket.h, net/socket/stream_socket.h to base::Bind().
This changes Socket::Read(), Socket::Write, and StreamSocket::Connect() to use CompletionCallback and fixes all users. BUG=none TEST=existing. Review URL: http://codereview.chromium.org/8824006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113825 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/tcp_client_socket_libevent.h')
-rw-r--r--net/socket/tcp_client_socket_libevent.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/net/socket/tcp_client_socket_libevent.h b/net/socket/tcp_client_socket_libevent.h
index 47f19a0..a6aa241 100644
--- a/net/socket/tcp_client_socket_libevent.h
+++ b/net/socket/tcp_client_socket_libevent.h
@@ -43,7 +43,6 @@ class NET_EXPORT_PRIVATE TCPClientSocketLibevent : public StreamSocket,
int Bind(const IPEndPoint& address);
// StreamSocket implementation.
- virtual int Connect(OldCompletionCallback* callback) OVERRIDE;
virtual int Connect(const CompletionCallback& callback) OVERRIDE;
virtual void Disconnect() OVERRIDE;
virtual bool IsConnected() const OVERRIDE;
@@ -63,13 +62,10 @@ class NET_EXPORT_PRIVATE TCPClientSocketLibevent : public StreamSocket,
// Full duplex mode (reading and writing at the same time) is supported
virtual int Read(IOBuffer* buf,
int buf_len,
- OldCompletionCallback* callback) OVERRIDE;
- virtual int Read(IOBuffer* buf,
- int buf_len,
const CompletionCallback& callback) OVERRIDE;
virtual int Write(IOBuffer* buf,
int buf_len,
- OldCompletionCallback* callback) OVERRIDE;
+ const CompletionCallback& callback) OVERRIDE;
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
virtual bool SetSendBufferSize(int32 size) OVERRIDE;
@@ -88,7 +84,7 @@ class NET_EXPORT_PRIVATE TCPClientSocketLibevent : public StreamSocket,
// MessageLoopForIO::Watcher methods
virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE {
- if (socket_->old_read_callback_)
+ if (!socket_->read_callback_.is_null())
socket_->DidCompleteRead();
}
@@ -109,8 +105,7 @@ class NET_EXPORT_PRIVATE TCPClientSocketLibevent : public StreamSocket,
virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE {
if (socket_->waiting_connect()) {
socket_->DidCompleteConnect();
- } else if (socket_->old_write_callback_ ||
- !socket_->write_callback_.is_null()) {
+ } else if (!socket_->write_callback_.is_null()) {
socket_->DidCompleteWrite();
}
}
@@ -179,11 +174,9 @@ class NET_EXPORT_PRIVATE TCPClientSocketLibevent : public StreamSocket,
int write_buf_len_;
// External callback; called when read is complete.
- OldCompletionCallback* old_read_callback_;
CompletionCallback read_callback_;
// External callback; called when write is complete.
- OldCompletionCallback* old_write_callback_;
CompletionCallback write_callback_;
// The next state for the Connect() state machine.