summaryrefslogtreecommitdiffstats
path: root/net/udp
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 /net/udp
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 'net/udp')
-rw-r--r--net/udp/datagram_server_socket.h4
-rw-r--r--net/udp/udp_client_socket.cc4
-rw-r--r--net/udp/udp_client_socket.h4
-rw-r--r--net/udp/udp_server_socket.cc4
-rw-r--r--net/udp/udp_server_socket.h4
-rw-r--r--net/udp/udp_socket_libevent.cc14
-rw-r--r--net/udp/udp_socket_libevent.h14
-rw-r--r--net/udp/udp_socket_unittest.cc10
-rw-r--r--net/udp/udp_socket_win.cc14
-rw-r--r--net/udp/udp_socket_win.h14
10 files changed, 43 insertions, 43 deletions
diff --git a/net/udp/datagram_server_socket.h b/net/udp/datagram_server_socket.h
index 9f2c2ea6..9b43f36 100644
--- a/net/udp/datagram_server_socket.h
+++ b/net/udp/datagram_server_socket.h
@@ -39,7 +39,7 @@ class NET_EXPORT DatagramServerSocket : public DatagramSocket {
virtual int RecvFrom(IOBuffer* buf,
int buf_len,
IPEndPoint* address,
- CompletionCallback* callback) = 0;
+ OldCompletionCallback* callback) = 0;
// Send to a socket with a particular destination.
// |buf| is the buffer to send
@@ -53,7 +53,7 @@ class NET_EXPORT DatagramServerSocket : public DatagramSocket {
virtual int SendTo(IOBuffer* buf,
int buf_len,
const IPEndPoint& address,
- CompletionCallback* callback) = 0;
+ OldCompletionCallback* callback) = 0;
};
} // namespace net
diff --git a/net/udp/udp_client_socket.cc b/net/udp/udp_client_socket.cc
index 32fc50b..96c4c33 100644
--- a/net/udp/udp_client_socket.cc
+++ b/net/udp/udp_client_socket.cc
@@ -24,13 +24,13 @@ int UDPClientSocket::Connect(const IPEndPoint& address) {
int UDPClientSocket::Read(IOBuffer* buf,
int buf_len,
- CompletionCallback* callback) {
+ OldCompletionCallback* callback) {
return socket_.Read(buf, buf_len, callback);
}
int UDPClientSocket::Write(IOBuffer* buf,
int buf_len,
- CompletionCallback* callback) {
+ OldCompletionCallback* callback) {
return socket_.Write(buf, buf_len, callback);
}
diff --git a/net/udp/udp_client_socket.h b/net/udp/udp_client_socket.h
index cb4d525..7aa4a7f 100644
--- a/net/udp/udp_client_socket.h
+++ b/net/udp/udp_client_socket.h
@@ -26,8 +26,8 @@ class NET_EXPORT_PRIVATE UDPClientSocket : public DatagramClientSocket {
// Implement DatagramClientSocket:
virtual int Connect(const IPEndPoint& address);
- virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback);
- virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback);
+ virtual int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback);
+ virtual int Write(IOBuffer* buf, int buf_len, OldCompletionCallback* callback);
virtual void Close();
virtual int GetPeerAddress(IPEndPoint* address) const;
virtual int GetLocalAddress(IPEndPoint* address) const;
diff --git a/net/udp/udp_server_socket.cc b/net/udp/udp_server_socket.cc
index 80b831f..54391c5 100644
--- a/net/udp/udp_server_socket.cc
+++ b/net/udp/udp_server_socket.cc
@@ -26,14 +26,14 @@ int UDPServerSocket::Listen(const IPEndPoint& address) {
int UDPServerSocket::RecvFrom(IOBuffer* buf,
int buf_len,
IPEndPoint* address,
- CompletionCallback* callback) {
+ OldCompletionCallback* callback) {
return socket_.RecvFrom(buf, buf_len, address, callback);
}
int UDPServerSocket::SendTo(IOBuffer* buf,
int buf_len,
const IPEndPoint& address,
- CompletionCallback* callback) {
+ OldCompletionCallback* callback) {
return socket_.SendTo(buf, buf_len, address, callback);
}
diff --git a/net/udp/udp_server_socket.h b/net/udp/udp_server_socket.h
index 6fdc2c4..92dfef3 100644
--- a/net/udp/udp_server_socket.h
+++ b/net/udp/udp_server_socket.h
@@ -27,11 +27,11 @@ class NET_EXPORT UDPServerSocket : public DatagramServerSocket {
virtual int RecvFrom(IOBuffer* buf,
int buf_len,
IPEndPoint* address,
- CompletionCallback* callback);
+ OldCompletionCallback* callback);
virtual int SendTo(IOBuffer* buf,
int buf_len,
const IPEndPoint& address,
- CompletionCallback* callback);
+ OldCompletionCallback* callback);
virtual void Close();
virtual int GetPeerAddress(IPEndPoint* address) const;
virtual int GetLocalAddress(IPEndPoint* address) const;
diff --git a/net/udp/udp_socket_libevent.cc b/net/udp/udp_socket_libevent.cc
index 201f208..33f9edd 100644
--- a/net/udp/udp_socket_libevent.cc
+++ b/net/udp/udp_socket_libevent.cc
@@ -135,14 +135,14 @@ int UDPSocketLibevent::GetLocalAddress(IPEndPoint* address) const {
int UDPSocketLibevent::Read(IOBuffer* buf,
int buf_len,
- CompletionCallback* callback) {
+ OldCompletionCallback* callback) {
return RecvFrom(buf, buf_len, NULL, callback);
}
int UDPSocketLibevent::RecvFrom(IOBuffer* buf,
int buf_len,
IPEndPoint* address,
- CompletionCallback* callback) {
+ OldCompletionCallback* callback) {
DCHECK(CalledOnValidThread());
DCHECK_NE(kInvalidSocket, socket_);
DCHECK(!read_callback_);
@@ -170,21 +170,21 @@ int UDPSocketLibevent::RecvFrom(IOBuffer* buf,
int UDPSocketLibevent::Write(IOBuffer* buf,
int buf_len,
- CompletionCallback* callback) {
+ OldCompletionCallback* callback) {
return SendToOrWrite(buf, buf_len, NULL, callback);
}
int UDPSocketLibevent::SendTo(IOBuffer* buf,
int buf_len,
const IPEndPoint& address,
- CompletionCallback* callback) {
+ OldCompletionCallback* callback) {
return SendToOrWrite(buf, buf_len, &address, callback);
}
int UDPSocketLibevent::SendToOrWrite(IOBuffer* buf,
int buf_len,
const IPEndPoint* address,
- CompletionCallback* callback) {
+ OldCompletionCallback* callback) {
DCHECK(CalledOnValidThread());
DCHECK_NE(kInvalidSocket, socket_);
DCHECK(!write_callback_);
@@ -262,7 +262,7 @@ void UDPSocketLibevent::DoReadCallback(int rv) {
DCHECK(read_callback_);
// since Run may result in Read being called, clear read_callback_ up front.
- CompletionCallback* c = read_callback_;
+ OldCompletionCallback* c = read_callback_;
read_callback_ = NULL;
c->Run(rv);
}
@@ -272,7 +272,7 @@ void UDPSocketLibevent::DoWriteCallback(int rv) {
DCHECK(write_callback_);
// since Run may result in Write being called, clear write_callback_ up front.
- CompletionCallback* c = write_callback_;
+ OldCompletionCallback* c = write_callback_;
write_callback_ = NULL;
c->Run(rv);
}
diff --git a/net/udp/udp_socket_libevent.h b/net/udp/udp_socket_libevent.h
index a078150..d6a99b1 100644
--- a/net/udp/udp_socket_libevent.h
+++ b/net/udp/udp_socket_libevent.h
@@ -55,12 +55,12 @@ class UDPSocketLibevent : public base::NonThreadSafe {
// Read from the socket.
// Only usable from the client-side of a UDP socket, after the socket
// has been connected.
- int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback);
+ int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback);
// Write to the socket.
// Only usable from the client-side of a UDP socket, after the socket
// has been connected.
- int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback);
+ int Write(IOBuffer* buf, int buf_len, OldCompletionCallback* callback);
// Read from a socket and receive sender address information.
// |buf| is the buffer to read data into.
@@ -78,7 +78,7 @@ class UDPSocketLibevent : public base::NonThreadSafe {
int RecvFrom(IOBuffer* buf,
int buf_len,
IPEndPoint* address,
- CompletionCallback* callback);
+ OldCompletionCallback* callback);
// Send to a socket with a particular destination.
// |buf| is the buffer to send
@@ -92,7 +92,7 @@ class UDPSocketLibevent : public base::NonThreadSafe {
int SendTo(IOBuffer* buf,
int buf_len,
const IPEndPoint& address,
- CompletionCallback* callback);
+ OldCompletionCallback* callback);
// Returns true if the socket is already connected or bound.
bool is_connected() const { return socket_ != kInvalidSocket; }
@@ -154,7 +154,7 @@ class UDPSocketLibevent : public base::NonThreadSafe {
int SendToOrWrite(IOBuffer* buf,
int buf_len,
const IPEndPoint* address,
- CompletionCallback* callback);
+ OldCompletionCallback* callback);
int InternalRecvFrom(IOBuffer* buf, int buf_len, IPEndPoint* address);
int InternalSendTo(IOBuffer* buf, int buf_len, const IPEndPoint* address);
@@ -195,10 +195,10 @@ class UDPSocketLibevent : public base::NonThreadSafe {
scoped_ptr<IPEndPoint> send_to_address_;
// External callback; called when read is complete.
- CompletionCallback* read_callback_;
+ OldCompletionCallback* read_callback_;
// External callback; called when write is complete.
- CompletionCallback* write_callback_;
+ OldCompletionCallback* write_callback_;
BoundNetLog net_log_;
diff --git a/net/udp/udp_socket_unittest.cc b/net/udp/udp_socket_unittest.cc
index bae3a87..8a66f34 100644
--- a/net/udp/udp_socket_unittest.cc
+++ b/net/udp/udp_socket_unittest.cc
@@ -31,7 +31,7 @@ class UDPSocketTest : public PlatformTest {
// Blocks until data is read from the socket.
std::string RecvFromSocket(UDPServerSocket* socket) {
- TestCompletionCallback callback;
+ TestOldCompletionCallback callback;
int rv = socket->RecvFrom(buffer_, kMaxRead, &recv_from_address_,
&callback);
@@ -54,7 +54,7 @@ class UDPSocketTest : public PlatformTest {
int SendToSocket(UDPServerSocket* socket,
std::string msg,
const IPEndPoint& address) {
- TestCompletionCallback callback;
+ TestOldCompletionCallback callback;
int length = msg.length();
scoped_refptr<StringIOBuffer> io_buffer(new StringIOBuffer(msg));
@@ -76,7 +76,7 @@ class UDPSocketTest : public PlatformTest {
}
std::string ReadSocket(UDPClientSocket* socket) {
- TestCompletionCallback callback;
+ TestOldCompletionCallback callback;
int rv = socket->Read(buffer_, kMaxRead, &callback);
if (rv == ERR_IO_PENDING)
@@ -89,7 +89,7 @@ class UDPSocketTest : public PlatformTest {
// Loop until |msg| has been written to the socket or until an
// error occurs.
int WriteSocket(UDPClientSocket* socket, std::string msg) {
- TestCompletionCallback callback;
+ TestOldCompletionCallback callback;
int length = msg.length();
scoped_refptr<StringIOBuffer> io_buffer(new StringIOBuffer(msg));
@@ -394,7 +394,7 @@ TEST_F(UDPSocketTest, CloseWithPendingRead) {
int rv = server.Listen(bind_address);
EXPECT_EQ(OK, rv);
- TestCompletionCallback callback;
+ TestOldCompletionCallback callback;
IPEndPoint from;
rv = server.RecvFrom(buffer_, kMaxRead, &from, &callback);
EXPECT_EQ(rv, ERR_IO_PENDING);
diff --git a/net/udp/udp_socket_win.cc b/net/udp/udp_socket_win.cc
index fe7eaae..49f2f44 100644
--- a/net/udp/udp_socket_win.cc
+++ b/net/udp/udp_socket_win.cc
@@ -134,14 +134,14 @@ int UDPSocketWin::GetLocalAddress(IPEndPoint* address) const {
int UDPSocketWin::Read(IOBuffer* buf,
int buf_len,
- CompletionCallback* callback) {
+ OldCompletionCallback* callback) {
return RecvFrom(buf, buf_len, NULL, callback);
}
int UDPSocketWin::RecvFrom(IOBuffer* buf,
int buf_len,
IPEndPoint* address,
- CompletionCallback* callback) {
+ OldCompletionCallback* callback) {
DCHECK(CalledOnValidThread());
DCHECK_NE(INVALID_SOCKET, socket_);
DCHECK(!read_callback_);
@@ -161,21 +161,21 @@ int UDPSocketWin::RecvFrom(IOBuffer* buf,
int UDPSocketWin::Write(IOBuffer* buf,
int buf_len,
- CompletionCallback* callback) {
+ OldCompletionCallback* callback) {
return SendToOrWrite(buf, buf_len, NULL, callback);
}
int UDPSocketWin::SendTo(IOBuffer* buf,
int buf_len,
const IPEndPoint& address,
- CompletionCallback* callback) {
+ OldCompletionCallback* callback) {
return SendToOrWrite(buf, buf_len, &address, callback);
}
int UDPSocketWin::SendToOrWrite(IOBuffer* buf,
int buf_len,
const IPEndPoint* address,
- CompletionCallback* callback) {
+ OldCompletionCallback* callback) {
DCHECK(CalledOnValidThread());
DCHECK_NE(INVALID_SOCKET, socket_);
DCHECK(!write_callback_);
@@ -244,7 +244,7 @@ void UDPSocketWin::DoReadCallback(int rv) {
DCHECK(read_callback_);
// since Run may result in Read being called, clear read_callback_ up front.
- CompletionCallback* c = read_callback_;
+ OldCompletionCallback* c = read_callback_;
read_callback_ = NULL;
c->Run(rv);
}
@@ -254,7 +254,7 @@ void UDPSocketWin::DoWriteCallback(int rv) {
DCHECK(write_callback_);
// since Run may result in Write being called, clear write_callback_ up front.
- CompletionCallback* c = write_callback_;
+ OldCompletionCallback* c = write_callback_;
write_callback_ = NULL;
c->Run(rv);
}
diff --git a/net/udp/udp_socket_win.h b/net/udp/udp_socket_win.h
index 2dc818a..a3ed37e 100644
--- a/net/udp/udp_socket_win.h
+++ b/net/udp/udp_socket_win.h
@@ -57,12 +57,12 @@ class UDPSocketWin : public base::NonThreadSafe {
// Read from the socket.
// Only usable from the client-side of a UDP socket, after the socket
// has been connected.
- int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback);
+ int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback);
// Write to the socket.
// Only usable from the client-side of a UDP socket, after the socket
// has been connected.
- int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback);
+ int Write(IOBuffer* buf, int buf_len, OldCompletionCallback* callback);
// Read from a socket and receive sender address information.
// |buf| is the buffer to read data into.
@@ -80,7 +80,7 @@ class UDPSocketWin : public base::NonThreadSafe {
int RecvFrom(IOBuffer* buf,
int buf_len,
IPEndPoint* address,
- CompletionCallback* callback);
+ OldCompletionCallback* callback);
// Send to a socket with a particular destination.
// |buf| is the buffer to send
@@ -94,7 +94,7 @@ class UDPSocketWin : public base::NonThreadSafe {
int SendTo(IOBuffer* buf,
int buf_len,
const IPEndPoint& address,
- CompletionCallback* callback);
+ OldCompletionCallback* callback);
// Returns true if the socket is already connected or bound.
bool is_connected() const { return socket_ != INVALID_SOCKET; }
@@ -142,7 +142,7 @@ class UDPSocketWin : public base::NonThreadSafe {
int SendToOrWrite(IOBuffer* buf,
int buf_len,
const IPEndPoint* address,
- CompletionCallback* callback);
+ OldCompletionCallback* callback);
int InternalRecvFrom(IOBuffer* buf, int buf_len, IPEndPoint* address);
int InternalSendTo(IOBuffer* buf, int buf_len, const IPEndPoint* address);
@@ -186,10 +186,10 @@ class UDPSocketWin : public base::NonThreadSafe {
scoped_refptr<IOBuffer> write_iobuffer_;
// External callback; called when read is complete.
- CompletionCallback* read_callback_;
+ OldCompletionCallback* read_callback_;
// External callback; called when write is complete.
- CompletionCallback* write_callback_;
+ OldCompletionCallback* write_callback_;
BoundNetLog net_log_;