summaryrefslogtreecommitdiffstats
path: root/jingle
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
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')
-rw-r--r--jingle/glue/channel_socket_adapter.cc12
-rw-r--r--jingle/glue/channel_socket_adapter.h8
-rw-r--r--jingle/glue/channel_socket_adapter_unittest.cc2
-rw-r--r--jingle/glue/pseudotcp_adapter.cc40
-rw-r--r--jingle/glue/pseudotcp_adapter.h6
-rw-r--r--jingle/glue/pseudotcp_adapter_unittest.cc24
-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
14 files changed, 80 insertions, 80 deletions
diff --git a/jingle/glue/channel_socket_adapter.cc b/jingle/glue/channel_socket_adapter.cc
index ca13af1..64cfa7f 100644
--- a/jingle/glue/channel_socket_adapter.cc
+++ b/jingle/glue/channel_socket_adapter.cc
@@ -35,7 +35,7 @@ TransportChannelSocketAdapter::~TransportChannelSocketAdapter() {
}
int TransportChannelSocketAdapter::Read(
- net::IOBuffer* buf, int buffer_size, net::CompletionCallback* callback) {
+ net::IOBuffer* buf, int buffer_size, net::OldCompletionCallback* callback) {
DCHECK_EQ(MessageLoop::current(), message_loop_);
DCHECK(buf);
DCHECK(callback);
@@ -54,7 +54,7 @@ int TransportChannelSocketAdapter::Read(
}
int TransportChannelSocketAdapter::Write(
- net::IOBuffer* buffer, int buffer_size, net::CompletionCallback* callback) {
+ net::IOBuffer* buffer, int buffer_size, net::OldCompletionCallback* callback) {
DCHECK_EQ(MessageLoop::current(), message_loop_);
DCHECK(buffer);
DCHECK(callback);
@@ -111,14 +111,14 @@ void TransportChannelSocketAdapter::Close(int error_code) {
channel_ = NULL;
if (read_callback_) {
- net::CompletionCallback* callback = read_callback_;
+ net::OldCompletionCallback* callback = read_callback_;
read_callback_ = NULL;
read_buffer_ = NULL;
callback->Run(error_code);
}
if (write_callback_) {
- net::CompletionCallback* callback = write_callback_;
+ net::OldCompletionCallback* callback = write_callback_;
write_callback_ = NULL;
write_buffer_ = NULL;
callback->Run(error_code);
@@ -141,7 +141,7 @@ void TransportChannelSocketAdapter::OnNewPacket(
memcpy(read_buffer_->data(), data, data_size);
- net::CompletionCallback* callback = read_callback_;
+ net::OldCompletionCallback* callback = read_callback_;
read_callback_ = NULL;
read_buffer_ = NULL;
@@ -163,7 +163,7 @@ void TransportChannelSocketAdapter::OnWritableState(
result = net::MapSystemError(channel_->GetError());
if (result != net::ERR_IO_PENDING) {
- net::CompletionCallback* callback = write_callback_;
+ net::OldCompletionCallback* callback = write_callback_;
write_callback_ = NULL;
write_buffer_ = NULL;
callback->Run(result);
diff --git a/jingle/glue/channel_socket_adapter.h b/jingle/glue/channel_socket_adapter.h
index 8c63fd9..4a3eafb 100644
--- a/jingle/glue/channel_socket_adapter.h
+++ b/jingle/glue/channel_socket_adapter.h
@@ -34,9 +34,9 @@ class TransportChannelSocketAdapter : public net::Socket,
// Socket interface.
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);
@@ -51,11 +51,11 @@ class TransportChannelSocketAdapter : public net::Socket,
cricket::TransportChannel* channel_;
- net::CompletionCallback* read_callback_; // Not owned.
+ net::OldCompletionCallback* read_callback_; // Not owned.
scoped_refptr<net::IOBuffer> read_buffer_;
int read_buffer_size_;
- net::CompletionCallback* write_callback_; // Not owned.
+ net::OldCompletionCallback* write_callback_; // Not owned.
scoped_refptr<net::IOBuffer> write_buffer_;
int write_buffer_size_;
diff --git a/jingle/glue/channel_socket_adapter_unittest.cc b/jingle/glue/channel_socket_adapter_unittest.cc
index 8eb4d23..e8b34b5 100644
--- a/jingle/glue/channel_socket_adapter_unittest.cc
+++ b/jingle/glue/channel_socket_adapter_unittest.cc
@@ -59,7 +59,7 @@ class TransportChannelSocketAdapterTest : public testing::Test {
MockTransportChannel channel_;
scoped_ptr<TransportChannelSocketAdapter> target_;
- net::CompletionCallbackImpl<TransportChannelSocketAdapterTest> callback_;
+ net::OldCompletionCallbackImpl<TransportChannelSocketAdapterTest> callback_;
int callback_result_;
MessageLoopForIO message_loop_;
};
diff --git a/jingle/glue/pseudotcp_adapter.cc b/jingle/glue/pseudotcp_adapter.cc
index 94c81aa..d800d99 100644
--- a/jingle/glue/pseudotcp_adapter.cc
+++ b/jingle/glue/pseudotcp_adapter.cc
@@ -29,10 +29,10 @@ class PseudoTcpAdapter::Core : public cricket::IPseudoTcpNotify,
// Functions used to implement net::StreamSocket.
int Read(net::IOBuffer* buffer, int buffer_size,
- net::CompletionCallback* callback);
+ net::OldCompletionCallback* callback);
int Write(net::IOBuffer* buffer, int buffer_size,
- net::CompletionCallback* callback);
- int Connect(net::CompletionCallback* callback);
+ net::OldCompletionCallback* callback);
+ int Connect(net::OldCompletionCallback* callback);
void Disconnect();
bool IsConnected() const;
@@ -67,9 +67,9 @@ class PseudoTcpAdapter::Core : public cricket::IPseudoTcpNotify,
// This re-sets |timer| without triggering callbacks.
void AdjustClock();
- net::CompletionCallback* connect_callback_;
- net::CompletionCallback* read_callback_;
- net::CompletionCallback* write_callback_;
+ net::OldCompletionCallback* connect_callback_;
+ net::OldCompletionCallback* read_callback_;
+ net::OldCompletionCallback* write_callback_;
cricket::PseudoTcp pseudo_tcp_;
scoped_ptr<net::Socket> socket_;
@@ -82,8 +82,8 @@ class PseudoTcpAdapter::Core : public cricket::IPseudoTcpNotify,
bool socket_write_pending_;
scoped_refptr<net::IOBuffer> socket_read_buffer_;
- net::CompletionCallbackImpl<Core> socket_read_callback_;
- net::CompletionCallbackImpl<Core> socket_write_callback_;
+ net::OldCompletionCallbackImpl<Core> socket_read_callback_;
+ net::OldCompletionCallbackImpl<Core> socket_write_callback_;
base::OneShotTimer<Core> timer_;
@@ -110,7 +110,7 @@ PseudoTcpAdapter::Core::~Core() {
}
int PseudoTcpAdapter::Core::Read(net::IOBuffer* buffer, int buffer_size,
- net::CompletionCallback* callback) {
+ net::OldCompletionCallback* callback) {
DCHECK(!read_callback_);
// Reference the Core in case a callback deletes the adapter.
@@ -134,7 +134,7 @@ int PseudoTcpAdapter::Core::Read(net::IOBuffer* buffer, int buffer_size,
}
int PseudoTcpAdapter::Core::Write(net::IOBuffer* buffer, int buffer_size,
- net::CompletionCallback* callback) {
+ net::OldCompletionCallback* callback) {
DCHECK(!write_callback_);
// Reference the Core in case a callback deletes the adapter.
@@ -157,7 +157,7 @@ int PseudoTcpAdapter::Core::Write(net::IOBuffer* buffer, int buffer_size,
return result;
}
-int PseudoTcpAdapter::Core::Connect(net::CompletionCallback* callback) {
+int PseudoTcpAdapter::Core::Connect(net::OldCompletionCallback* callback) {
DCHECK_EQ(pseudo_tcp_.State(), cricket::PseudoTcp::TCP_LISTEN);
// Reference the Core in case a callback deletes the adapter.
@@ -202,7 +202,7 @@ void PseudoTcpAdapter::Core::OnTcpOpen(PseudoTcp* tcp) {
DCHECK(tcp == &pseudo_tcp_);
if (connect_callback_) {
- net::CompletionCallback* callback = connect_callback_;
+ net::OldCompletionCallback* callback = connect_callback_;
connect_callback_ = NULL;
callback->Run(net::OK);
}
@@ -226,7 +226,7 @@ void PseudoTcpAdapter::Core::OnTcpReadable(PseudoTcp* tcp) {
AdjustClock();
- net::CompletionCallback* callback = read_callback_;
+ net::OldCompletionCallback* callback = read_callback_;
read_callback_ = NULL;
read_buffer_ = NULL;
callback->Run(result);
@@ -247,7 +247,7 @@ void PseudoTcpAdapter::Core::OnTcpWriteable(PseudoTcp* tcp) {
AdjustClock();
- net::CompletionCallback* callback = write_callback_;
+ net::OldCompletionCallback* callback = write_callback_;
write_callback_ = NULL;
write_buffer_ = NULL;
callback->Run(result);
@@ -257,19 +257,19 @@ void PseudoTcpAdapter::Core::OnTcpClosed(PseudoTcp* tcp, uint32 error) {
DCHECK_EQ(tcp, &pseudo_tcp_);
if (connect_callback_) {
- net::CompletionCallback* callback = connect_callback_;
+ net::OldCompletionCallback* callback = connect_callback_;
connect_callback_ = NULL;
callback->Run(net::MapSystemError(error));
}
if (read_callback_) {
- net::CompletionCallback* callback = read_callback_;
+ net::OldCompletionCallback* callback = read_callback_;
read_callback_ = NULL;
callback->Run(net::MapSystemError(error));
}
if (write_callback_) {
- net::CompletionCallback* callback = write_callback_;
+ net::OldCompletionCallback* callback = write_callback_;
write_callback_ = NULL;
callback->Run(net::MapSystemError(error));
}
@@ -394,13 +394,13 @@ PseudoTcpAdapter::~PseudoTcpAdapter() {
}
int PseudoTcpAdapter::Read(net::IOBuffer* buffer, int buffer_size,
- net::CompletionCallback* callback) {
+ net::OldCompletionCallback* callback) {
DCHECK(CalledOnValidThread());
return core_->Read(buffer, buffer_size, callback);
}
int PseudoTcpAdapter::Write(net::IOBuffer* buffer, int buffer_size,
- net::CompletionCallback* callback) {
+ net::OldCompletionCallback* callback) {
DCHECK(CalledOnValidThread());
return core_->Write(buffer, buffer_size, callback);
}
@@ -419,7 +419,7 @@ bool PseudoTcpAdapter::SetSendBufferSize(int32 size) {
return false;
}
-int PseudoTcpAdapter::Connect(net::CompletionCallback* callback) {
+int PseudoTcpAdapter::Connect(net::OldCompletionCallback* callback) {
DCHECK(CalledOnValidThread());
// net::StreamSocket requires that Connect return OK if already connected.
diff --git a/jingle/glue/pseudotcp_adapter.h b/jingle/glue/pseudotcp_adapter.h
index a764182..5edb3e0 100644
--- a/jingle/glue/pseudotcp_adapter.h
+++ b/jingle/glue/pseudotcp_adapter.h
@@ -31,14 +31,14 @@ class PseudoTcpAdapter : public net::StreamSocket, base::NonThreadSafe {
// net::Socket implementation.
virtual int Read(net::IOBuffer* buffer, int buffer_size,
- net::CompletionCallback* callback) OVERRIDE;
+ net::OldCompletionCallback* callback) OVERRIDE;
virtual int Write(net::IOBuffer* buffer, int buffer_size,
- net::CompletionCallback* callback) OVERRIDE;
+ net::OldCompletionCallback* callback) OVERRIDE;
virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
virtual bool SetSendBufferSize(int32 size) OVERRIDE;
// net::StreamSocket implementation.
- 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;
diff --git a/jingle/glue/pseudotcp_adapter_unittest.cc b/jingle/glue/pseudotcp_adapter_unittest.cc
index 12a6dbe..d418826 100644
--- a/jingle/glue/pseudotcp_adapter_unittest.cc
+++ b/jingle/glue/pseudotcp_adapter_unittest.cc
@@ -92,7 +92,7 @@ class FakeSocket : public net::Socket {
if (read_callback_) {
int size = std::min(read_buffer_size_, static_cast<int>(data.size()));
memcpy(read_buffer_->data(), &data[0], data.size());
- net::CompletionCallback* cb = read_callback_;
+ net::OldCompletionCallback* cb = read_callback_;
read_callback_ = NULL;
read_buffer_ = NULL;
cb->Run(size);
@@ -113,7 +113,7 @@ class FakeSocket : public net::Socket {
// net::Socket interface.
virtual int Read(net::IOBuffer* buf, int buf_len,
- net::CompletionCallback* callback) {
+ net::OldCompletionCallback* callback) {
CHECK(!read_callback_);
CHECK(buf);
@@ -133,7 +133,7 @@ class FakeSocket : public net::Socket {
}
virtual int Write(net::IOBuffer* buf, int buf_len,
- net::CompletionCallback* callback) OVERRIDE {
+ net::OldCompletionCallback* callback) OVERRIDE {
DCHECK(buf);
if (peer_socket_) {
MessageLoop::current()->PostDelayedTask(FROM_HERE, NewRunnableMethod(
@@ -156,7 +156,7 @@ class FakeSocket : public net::Socket {
private:
scoped_refptr<net::IOBuffer> read_buffer_;
int read_buffer_size_;
- net::CompletionCallback* read_callback_;
+ net::OldCompletionCallback* read_callback_;
std::deque<std::vector<char> > incoming_packets_;
@@ -292,8 +292,8 @@ class TCPChannelTester : public base::RefCountedThreadSafe<TCPChannelTester> {
scoped_refptr<net::DrainableIOBuffer> output_buffer_;
scoped_refptr<net::GrowableIOBuffer> input_buffer_;
- net::CompletionCallbackImpl<TCPChannelTester> write_cb_;
- net::CompletionCallbackImpl<TCPChannelTester> read_cb_;
+ net::OldCompletionCallbackImpl<TCPChannelTester> write_cb_;
+ net::OldCompletionCallbackImpl<TCPChannelTester> read_cb_;
int write_errors_;
int read_errors_;
};
@@ -322,8 +322,8 @@ class PseudoTcpAdapterTest : public testing::Test {
};
TEST_F(PseudoTcpAdapterTest, DataTransfer) {
- TestCompletionCallback host_connect_cb;
- TestCompletionCallback client_connect_cb;
+ TestOldCompletionCallback host_connect_cb;
+ TestOldCompletionCallback client_connect_cb;
int rv1 = host_pseudotcp_->Connect(&host_connect_cb);
int rv2 = client_pseudotcp_->Connect(&client_connect_cb);
@@ -357,8 +357,8 @@ TEST_F(PseudoTcpAdapterTest, LimitedChannel) {
host_socket_->set_latency(kLatencyMs);
client_socket_->set_rate_limiter(&client_limiter);
- TestCompletionCallback host_connect_cb;
- TestCompletionCallback client_connect_cb;
+ TestOldCompletionCallback host_connect_cb;
+ TestOldCompletionCallback client_connect_cb;
int rv1 = host_pseudotcp_->Connect(&host_connect_cb);
int rv2 = client_pseudotcp_->Connect(&client_connect_cb);
@@ -396,9 +396,9 @@ TEST_F(PseudoTcpAdapterTest, DeleteOnConnected) {
// This test verifies that deleting the adapter mid-callback doesn't lead
// to deleted structures being touched as the stack unrolls, so the failure
// mode is a crash rather than a normal test failure.
- TestCompletionCallback client_connect_cb;
+ TestOldCompletionCallback client_connect_cb;
DeleteOnConnected host_delete(&message_loop_, &host_pseudotcp_);
- net::CompletionCallbackImpl<DeleteOnConnected>
+ net::OldCompletionCallbackImpl<DeleteOnConnected>
host_connect_cb(&host_delete, &DeleteOnConnected::OnConnected);
host_pseudotcp_->Connect(&host_connect_cb);
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_;