Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Unified Diff: net/udp/udp_socket_libevent.h

Issue 8801005: base::Bind: Convert Socket::Read. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/udp/udp_socket_libevent.h
diff --git a/net/udp/udp_socket_libevent.h b/net/udp/udp_socket_libevent.h
index 1b823c76465d4c39f8e1574467fafc5284c8fc7a..db06bb15e43c8bb354229dd69a62f1531c21d4e4 100644
--- a/net/udp/udp_socket_libevent.h
+++ b/net/udp/udp_socket_libevent.h
@@ -55,6 +55,7 @@ class UDPSocketLibevent : public base::NonThreadSafe {
// Only usable from the client-side of a UDP socket, after the socket
// has been connected.
int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback);
+ int Read(IOBuffer* buf, int buf_len, const CompletionCallback& callback);
// Write to the socket.
// Only usable from the client-side of a UDP socket, after the socket
@@ -78,6 +79,10 @@ class UDPSocketLibevent : public base::NonThreadSafe {
int buf_len,
IPEndPoint* address,
OldCompletionCallback* callback);
+ int RecvFrom(IOBuffer* buf,
+ int buf_len,
+ IPEndPoint* address,
+ const CompletionCallback& callback);
// Send to a socket with a particular destination.
// |buf| is the buffer to send
@@ -114,7 +119,7 @@ class UDPSocketLibevent : public base::NonThreadSafe {
// MessageLoopForIO::Watcher methods
virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE {
- if (socket_->read_callback_)
+ if (socket_->old_read_callback_)
csilv 2011/12/07 00:03:48 also check for read_callback_ here
James Hawkins 2011/12/07 00:19:37 Done.
socket_->DidCompleteRead();
}
@@ -209,7 +214,8 @@ class UDPSocketLibevent : public base::NonThreadSafe {
scoped_ptr<IPEndPoint> send_to_address_;
// External callback; called when read is complete.
- OldCompletionCallback* read_callback_;
+ OldCompletionCallback* old_read_callback_;
+ CompletionCallback read_callback_;
// External callback; called when write is complete.
OldCompletionCallback* write_callback_;

Powered by Google App Engine
This is Rietveld 408576698