diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-08 23:51:15 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-08 23:51:15 +0000 |
commit | 293f154b854a3507de8ed4116e8529f633060810 (patch) | |
tree | 63cc680a578707f0188e2615ebcd407906040166 /jingle/notifier/base | |
parent | 4c6df432834aa4541044a0890f774b25e15e7746 (diff) | |
download | chromium_src-293f154b854a3507de8ed4116e8529f633060810.zip chromium_src-293f154b854a3507de8ed4116e8529f633060810.tar.gz chromium_src-293f154b854a3507de8ed4116e8529f633060810.tar.bz2 |
base::Bind: Convert Socket::Write.
BUG=none
TEST=none
R=csilv
Review URL: http://codereview.chromium.org/8831001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113699 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle/notifier/base')
5 files changed, 20 insertions, 1 deletions
diff --git a/jingle/notifier/base/fake_ssl_client_socket.cc b/jingle/notifier/base/fake_ssl_client_socket.cc index bdad879..9c13f52 100644 --- a/jingle/notifier/base/fake_ssl_client_socket.cc +++ b/jingle/notifier/base/fake_ssl_client_socket.cc @@ -112,7 +112,13 @@ int FakeSSLClientSocket::Read(net::IOBuffer* buf, int buf_len, } int FakeSSLClientSocket::Write(net::IOBuffer* buf, int buf_len, - net::OldCompletionCallback* callback) { + net::OldCompletionCallback* callback) { + DCHECK_EQ(next_handshake_state_, STATE_NONE); + DCHECK(handshake_completed_); + return transport_socket_->Write(buf, buf_len, callback); +} +int FakeSSLClientSocket::Write(net::IOBuffer* buf, int buf_len, + const net::CompletionCallback& callback) { DCHECK_EQ(next_handshake_state_, STATE_NONE); DCHECK(handshake_completed_); return transport_socket_->Write(buf, buf_len, callback); diff --git a/jingle/notifier/base/fake_ssl_client_socket.h b/jingle/notifier/base/fake_ssl_client_socket.h index 623e21b..047923d 100644 --- a/jingle/notifier/base/fake_ssl_client_socket.h +++ b/jingle/notifier/base/fake_ssl_client_socket.h @@ -52,6 +52,8 @@ class FakeSSLClientSocket : public net::StreamSocket { const net::CompletionCallback& callback) OVERRIDE; virtual int Write(net::IOBuffer* buf, int buf_len, net::OldCompletionCallback* callback) OVERRIDE; + virtual int Write(net::IOBuffer* buf, int buf_len, + const net::CompletionCallback& callback) OVERRIDE; virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; virtual bool SetSendBufferSize(int32 size) OVERRIDE; virtual int Connect(net::OldCompletionCallback* callback) OVERRIDE; diff --git a/jingle/notifier/base/fake_ssl_client_socket_unittest.cc b/jingle/notifier/base/fake_ssl_client_socket_unittest.cc index eb3ba5a..28ee5db 100644 --- a/jingle/notifier/base/fake_ssl_client_socket_unittest.cc +++ b/jingle/notifier/base/fake_ssl_client_socket_unittest.cc @@ -51,6 +51,8 @@ class MockClientSocket : public net::StreamSocket { MOCK_METHOD3(Read, int(net::IOBuffer*, int, const net::CompletionCallback&)); MOCK_METHOD3(Write, int(net::IOBuffer*, int, net::OldCompletionCallback*)); + MOCK_METHOD3(Write, int(net::IOBuffer*, int, + const net::CompletionCallback&)); MOCK_METHOD1(SetReceiveBufferSize, bool(int32)); MOCK_METHOD1(SetSendBufferSize, bool(int32)); MOCK_METHOD1(Connect, int(net::OldCompletionCallback*)); diff --git a/jingle/notifier/base/proxy_resolving_client_socket.cc b/jingle/notifier/base/proxy_resolving_client_socket.cc index 3d46ed6b..c7d54c2 100644 --- a/jingle/notifier/base/proxy_resolving_client_socket.cc +++ b/jingle/notifier/base/proxy_resolving_client_socket.cc @@ -89,6 +89,13 @@ int ProxyResolvingClientSocket::Write(net::IOBuffer* buf, int buf_len, NOTREACHED(); return net::ERR_SOCKET_NOT_CONNECTED; } +int ProxyResolvingClientSocket::Write(net::IOBuffer* buf, int buf_len, + const net::CompletionCallback& callback) { + if (transport_.get() && transport_->socket()) + return transport_->socket()->Write(buf, buf_len, callback); + NOTREACHED(); + return net::ERR_SOCKET_NOT_CONNECTED; +} bool ProxyResolvingClientSocket::SetReceiveBufferSize(int32 size) { if (transport_.get() && transport_->socket()) diff --git a/jingle/notifier/base/proxy_resolving_client_socket.h b/jingle/notifier/base/proxy_resolving_client_socket.h index 4463364..6eae9f4 100644 --- a/jingle/notifier/base/proxy_resolving_client_socket.h +++ b/jingle/notifier/base/proxy_resolving_client_socket.h @@ -52,6 +52,8 @@ class ProxyResolvingClientSocket : public net::StreamSocket { const net::CompletionCallback& callback) OVERRIDE; virtual int Write(net::IOBuffer* buf, int buf_len, net::OldCompletionCallback* callback) OVERRIDE; + virtual int Write(net::IOBuffer* buf, int buf_len, + const net::CompletionCallback& callback) OVERRIDE; virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; virtual bool SetSendBufferSize(int32 size) OVERRIDE; virtual int Connect(net::OldCompletionCallback* callback) OVERRIDE; |