summaryrefslogtreecommitdiffstats
path: root/jingle/notifier
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-01 20:38:10 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-01 20:38:10 +0000
commitf1f3f0f8af3740ec2afaebcaed410950a9cc0ac8 (patch)
tree6ccdd87ccfc89adbcb372c517559fa61fbc6c6b2 /jingle/notifier
parentd1666539b57bf8552e203d355fd09909d36f9732 (diff)
downloadchromium_src-f1f3f0f8af3740ec2afaebcaed410950a9cc0ac8.zip
chromium_src-f1f3f0f8af3740ec2afaebcaed410950a9cc0ac8.tar.gz
chromium_src-f1f3f0f8af3740ec2afaebcaed410950a9cc0ac8.tar.bz2
Begin CompletionCallback switchover.
Rename CompletionCallback to OldCompletionCallback in preparation for introducing a new CompletionCallback based on base::Callback. Also renames other CompletionCallback types like CancelableCompletionCallback and TestCompletionCallback and CompletionCallbackImpl. All using sed with s/CompletionCallback/OldCompletionCallback/g. BUG=98719 TEST=none Review URL: http://codereview.chromium.org/8070013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103650 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle/notifier')
-rw-r--r--jingle/notifier/base/chrome_async_socket.h8
-rw-r--r--jingle/notifier/base/fake_ssl_client_socket.cc8
-rw-r--r--jingle/notifier/base/fake_ssl_client_socket.h14
-rw-r--r--jingle/notifier/base/fake_ssl_client_socket_unittest.cc12
-rw-r--r--jingle/notifier/base/proxy_resolving_client_socket.cc8
-rw-r--r--jingle/notifier/base/proxy_resolving_client_socket.h12
-rw-r--r--jingle/notifier/base/proxy_resolving_client_socket_unittest.cc4
-rw-r--r--jingle/notifier/communicator/xmpp_connection_generator.h2
8 files changed, 34 insertions, 34 deletions
diff --git a/jingle/notifier/base/chrome_async_socket.h b/jingle/notifier/base/chrome_async_socket.h
index 5cf1ca6..2960b6d 100644
--- a/jingle/notifier/base/chrome_async_socket.h
+++ b/jingle/notifier/base/chrome_async_socket.h
@@ -176,10 +176,10 @@ class ChromeAsyncSocket : public buzz::AsyncSocket {
void DoClose();
// Callbacks passed to |transport_socket_|.
- net::CompletionCallbackImpl<ChromeAsyncSocket> connect_callback_;
- net::CompletionCallbackImpl<ChromeAsyncSocket> read_callback_;
- net::CompletionCallbackImpl<ChromeAsyncSocket> write_callback_;
- net::CompletionCallbackImpl<ChromeAsyncSocket> ssl_connect_callback_;
+ net::OldCompletionCallbackImpl<ChromeAsyncSocket> connect_callback_;
+ net::OldCompletionCallbackImpl<ChromeAsyncSocket> read_callback_;
+ net::OldCompletionCallbackImpl<ChromeAsyncSocket> write_callback_;
+ net::OldCompletionCallbackImpl<ChromeAsyncSocket> ssl_connect_callback_;
scoped_ptr<ResolvingClientSocketFactory> client_socket_factory_;
diff --git a/jingle/notifier/base/fake_ssl_client_socket.cc b/jingle/notifier/base/fake_ssl_client_socket.cc
index 20a3f39..2ab7ef5 100644
--- a/jingle/notifier/base/fake_ssl_client_socket.cc
+++ b/jingle/notifier/base/fake_ssl_client_socket.cc
@@ -99,14 +99,14 @@ FakeSSLClientSocket::FakeSSLClientSocket(
FakeSSLClientSocket::~FakeSSLClientSocket() {}
int FakeSSLClientSocket::Read(net::IOBuffer* buf, int buf_len,
- net::CompletionCallback* callback) {
+ net::OldCompletionCallback* callback) {
DCHECK_EQ(next_handshake_state_, STATE_NONE);
DCHECK(handshake_completed_);
return transport_socket_->Read(buf, buf_len, callback);
}
int FakeSSLClientSocket::Write(net::IOBuffer* buf, int buf_len,
- net::CompletionCallback* callback) {
+ net::OldCompletionCallback* callback) {
DCHECK_EQ(next_handshake_state_, STATE_NONE);
DCHECK(handshake_completed_);
return transport_socket_->Write(buf, buf_len, callback);
@@ -120,7 +120,7 @@ bool FakeSSLClientSocket::SetSendBufferSize(int32 size) {
return transport_socket_->SetSendBufferSize(size);
}
-int FakeSSLClientSocket::Connect(net::CompletionCallback* callback) {
+int FakeSSLClientSocket::Connect(net::OldCompletionCallback* callback) {
// We don't support synchronous operation, even if
// |transport_socket_| does.
DCHECK(callback);
@@ -167,7 +167,7 @@ int FakeSSLClientSocket::DoHandshakeLoop() {
void FakeSSLClientSocket::RunUserConnectCallback(int status) {
DCHECK_LE(status, net::OK);
next_handshake_state_ = STATE_NONE;
- net::CompletionCallback* user_connect_callback = user_connect_callback_;
+ net::OldCompletionCallback* user_connect_callback = user_connect_callback_;
user_connect_callback_ = NULL;
user_connect_callback->Run(status);
}
diff --git a/jingle/notifier/base/fake_ssl_client_socket.h b/jingle/notifier/base/fake_ssl_client_socket.h
index 1688b70..d358173 100644
--- a/jingle/notifier/base/fake_ssl_client_socket.h
+++ b/jingle/notifier/base/fake_ssl_client_socket.h
@@ -46,12 +46,12 @@ class FakeSSLClientSocket : public net::StreamSocket {
// net::StreamSocket implementation.
virtual int Read(net::IOBuffer* buf, int buf_len,
- net::CompletionCallback* callback);
+ net::OldCompletionCallback* callback);
virtual int Write(net::IOBuffer* buf, int buf_len,
- net::CompletionCallback* callback);
+ net::OldCompletionCallback* callback);
virtual bool SetReceiveBufferSize(int32 size);
virtual bool SetSendBufferSize(int32 size);
- virtual int Connect(net::CompletionCallback* callback);
+ virtual int Connect(net::OldCompletionCallback* callback);
virtual void Disconnect();
virtual bool IsConnected() const;
virtual bool IsConnectedAndIdle() const;
@@ -90,10 +90,10 @@ class FakeSSLClientSocket : public net::StreamSocket {
net::Error ProcessVerifyServerHelloDone(size_t read);
// Callbacks passed to |transport_socket_|.
- net::CompletionCallbackImpl<FakeSSLClientSocket> connect_callback_;
- net::CompletionCallbackImpl<FakeSSLClientSocket>
+ net::OldCompletionCallbackImpl<FakeSSLClientSocket> connect_callback_;
+ net::OldCompletionCallbackImpl<FakeSSLClientSocket>
send_client_hello_callback_;
- net::CompletionCallbackImpl<FakeSSLClientSocket>
+ net::OldCompletionCallbackImpl<FakeSSLClientSocket>
verify_server_hello_callback_;
scoped_ptr<net::StreamSocket> transport_socket_;
@@ -106,7 +106,7 @@ class FakeSSLClientSocket : public net::StreamSocket {
bool handshake_completed_;
// The callback passed to Connect().
- net::CompletionCallback* user_connect_callback_;
+ net::OldCompletionCallback* user_connect_callback_;
scoped_refptr<net::DrainableIOBuffer> write_buf_;
scoped_refptr<net::DrainableIOBuffer> read_buf_;
diff --git a/jingle/notifier/base/fake_ssl_client_socket_unittest.cc b/jingle/notifier/base/fake_ssl_client_socket_unittest.cc
index 2fe21b4..86f5fb1 100644
--- a/jingle/notifier/base/fake_ssl_client_socket_unittest.cc
+++ b/jingle/notifier/base/fake_ssl_client_socket_unittest.cc
@@ -47,11 +47,11 @@ class MockClientSocket : public net::StreamSocket {
public:
virtual ~MockClientSocket() {}
- MOCK_METHOD3(Read, int(net::IOBuffer*, int, net::CompletionCallback*));
- MOCK_METHOD3(Write, int(net::IOBuffer*, int, net::CompletionCallback*));
+ MOCK_METHOD3(Read, int(net::IOBuffer*, int, net::OldCompletionCallback*));
+ MOCK_METHOD3(Write, int(net::IOBuffer*, int, net::OldCompletionCallback*));
MOCK_METHOD1(SetReceiveBufferSize, bool(int32));
MOCK_METHOD1(SetSendBufferSize, bool(int32));
- MOCK_METHOD1(Connect, int(net::CompletionCallback*));
+ MOCK_METHOD1(Connect, int(net::OldCompletionCallback*));
MOCK_METHOD0(Disconnect, void());
MOCK_CONST_METHOD0(IsConnected, bool());
MOCK_CONST_METHOD0(IsConnectedAndIdle, bool());
@@ -108,7 +108,7 @@ class FakeSSLClientSocketTest : public testing::Test {
void ExpectStatus(
bool async, int expected_status, int immediate_status,
- TestCompletionCallback* test_completion_callback) {
+ TestOldCompletionCallback* test_completion_callback) {
if (async) {
EXPECT_EQ(net::ERR_IO_PENDING, immediate_status);
int status = test_completion_callback->WaitForResult();
@@ -149,7 +149,7 @@ class FakeSSLClientSocketTest : public testing::Test {
for (int i = 0; i < num_resets + 1; ++i) {
SCOPED_TRACE(i);
- TestCompletionCallback test_completion_callback;
+ TestOldCompletionCallback test_completion_callback;
int status = fake_ssl_client_socket.Connect(&test_completion_callback);
if (async) {
EXPECT_FALSE(fake_ssl_client_socket.IsConnected());
@@ -242,7 +242,7 @@ class FakeSSLClientSocketTest : public testing::Test {
(error == ERR_MALFORMED_SERVER_HELLO)) ?
net::ERR_UNEXPECTED : error;
- TestCompletionCallback test_completion_callback;
+ TestOldCompletionCallback test_completion_callback;
int status = fake_ssl_client_socket.Connect(&test_completion_callback);
EXPECT_FALSE(fake_ssl_client_socket.IsConnected());
ExpectStatus(async, expected_status, status, &test_completion_callback);
diff --git a/jingle/notifier/base/proxy_resolving_client_socket.cc b/jingle/notifier/base/proxy_resolving_client_socket.cc
index 445b3f5..d922a44 100644
--- a/jingle/notifier/base/proxy_resolving_client_socket.cc
+++ b/jingle/notifier/base/proxy_resolving_client_socket.cc
@@ -65,7 +65,7 @@ ProxyResolvingClientSocket::~ProxyResolvingClientSocket() {
}
int ProxyResolvingClientSocket::Read(net::IOBuffer* buf, int buf_len,
- net::CompletionCallback* callback) {
+ net::OldCompletionCallback* callback) {
if (transport_.get() && transport_->socket())
return transport_->socket()->Read(buf, buf_len, callback);
NOTREACHED();
@@ -73,7 +73,7 @@ int ProxyResolvingClientSocket::Read(net::IOBuffer* buf, int buf_len,
}
int ProxyResolvingClientSocket::Write(net::IOBuffer* buf, int buf_len,
- net::CompletionCallback* callback) {
+ net::OldCompletionCallback* callback) {
if (transport_.get() && transport_->socket())
return transport_->socket()->Write(buf, buf_len, callback);
NOTREACHED();
@@ -94,7 +94,7 @@ bool ProxyResolvingClientSocket::SetSendBufferSize(int32 size) {
return false;
}
-int ProxyResolvingClientSocket::Connect(net::CompletionCallback* callback) {
+int ProxyResolvingClientSocket::Connect(net::OldCompletionCallback* callback) {
DCHECK(!user_connect_callback_);
tried_direct_connect_fallback_ = false;
@@ -124,7 +124,7 @@ int ProxyResolvingClientSocket::Connect(net::CompletionCallback* callback) {
void ProxyResolvingClientSocket::RunUserConnectCallback(int status) {
DCHECK_LE(status, net::OK);
- net::CompletionCallback* user_connect_callback = user_connect_callback_;
+ net::OldCompletionCallback* user_connect_callback = user_connect_callback_;
user_connect_callback_ = NULL;
user_connect_callback->Run(status);
}
diff --git a/jingle/notifier/base/proxy_resolving_client_socket.h b/jingle/notifier/base/proxy_resolving_client_socket.h
index 850bf9b..0cdd533 100644
--- a/jingle/notifier/base/proxy_resolving_client_socket.h
+++ b/jingle/notifier/base/proxy_resolving_client_socket.h
@@ -45,12 +45,12 @@ class ProxyResolvingClientSocket : public net::StreamSocket {
// net::StreamSocket implementation.
virtual int Read(net::IOBuffer* buf, int buf_len,
- net::CompletionCallback* callback) OVERRIDE;
+ net::OldCompletionCallback* callback) OVERRIDE;
virtual int Write(net::IOBuffer* buf, int buf_len,
- net::CompletionCallback* callback) OVERRIDE;
+ net::OldCompletionCallback* callback) OVERRIDE;
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
virtual bool SetSendBufferSize(int32 size) OVERRIDE;
- virtual int Connect(net::CompletionCallback* callback) OVERRIDE;
+ virtual int Connect(net::OldCompletionCallback* callback) OVERRIDE;
virtual void Disconnect() OVERRIDE;
virtual bool IsConnected() const OVERRIDE;
virtual bool IsConnectedAndIdle() const OVERRIDE;
@@ -75,9 +75,9 @@ class ProxyResolvingClientSocket : public net::StreamSocket {
void ReportSuccessfulProxyConnection();
// Callbacks passed to net APIs.
- net::CompletionCallbackImpl<ProxyResolvingClientSocket>
+ net::OldCompletionCallbackImpl<ProxyResolvingClientSocket>
proxy_resolve_callback_;
- net::CompletionCallbackImpl<ProxyResolvingClientSocket> connect_callback_;
+ net::OldCompletionCallbackImpl<ProxyResolvingClientSocket> connect_callback_;
scoped_refptr<net::HttpNetworkSession> network_session_;
@@ -94,7 +94,7 @@ class ProxyResolvingClientSocket : public net::StreamSocket {
scoped_runnable_method_factory_;
// The callback passed to Connect().
- net::CompletionCallback* user_connect_callback_;
+ net::OldCompletionCallback* user_connect_callback_;
};
} // namespace notifier
diff --git a/jingle/notifier/base/proxy_resolving_client_socket_unittest.cc b/jingle/notifier/base/proxy_resolving_client_socket_unittest.cc
index 48807a6..acbac4a 100644
--- a/jingle/notifier/base/proxy_resolving_client_socket_unittest.cc
+++ b/jingle/notifier/base/proxy_resolving_client_socket_unittest.cc
@@ -74,7 +74,7 @@ TEST_F(ProxyResolvingClientSocketTest, DISABLED_ConnectError) {
url_request_context_getter_,
net::SSLConfig(),
dest);
- TestCompletionCallback callback;
+ TestOldCompletionCallback callback;
int status = proxy_resolving_socket.Connect(&callback);
// Connect always returns ERR_IO_PENDING because it is always asynchronous.
EXPECT_EQ(net::ERR_IO_PENDING, status);
@@ -112,7 +112,7 @@ TEST_F(ProxyResolvingClientSocketTest, ReportsBadProxies) {
net::SSLConfig(),
dest);
- TestCompletionCallback callback;
+ TestOldCompletionCallback callback;
int status = proxy_resolving_socket.Connect(&callback);
EXPECT_EQ(net::ERR_IO_PENDING, status);
status = callback.WaitForResult();
diff --git a/jingle/notifier/communicator/xmpp_connection_generator.h b/jingle/notifier/communicator/xmpp_connection_generator.h
index e37e1f8..34f5ace 100644
--- a/jingle/notifier/communicator/xmpp_connection_generator.h
+++ b/jingle/notifier/communicator/xmpp_connection_generator.h
@@ -70,7 +70,7 @@ class XmppConnectionGenerator {
Delegate* delegate_;
net::SingleRequestHostResolver host_resolver_;
- scoped_ptr<net::CompletionCallback> resolve_callback_;
+ scoped_ptr<net::OldCompletionCallback> resolve_callback_;
net::AddressList address_list_;
net::BoundNetLog bound_net_log_;
scoped_ptr<ConnectionSettingsList> settings_list_;