diff options
Diffstat (limited to 'net/udp')
-rw-r--r-- | net/udp/udp_socket_libevent.cc | 10 | ||||
-rw-r--r-- | net/udp/udp_socket_libevent.h | 10 |
2 files changed, 12 insertions, 8 deletions
diff --git a/net/udp/udp_socket_libevent.cc b/net/udp/udp_socket_libevent.cc index 3782db3..beb1dca 100644 --- a/net/udp/udp_socket_libevent.cc +++ b/net/udp/udp_socket_libevent.cc @@ -292,6 +292,16 @@ void UDPSocketLibevent::AllowBroadcast() { socket_options_ |= SOCKET_OPTION_BROADCAST; } +void UDPSocketLibevent::ReadWatcher::OnFileCanReadWithoutBlocking(int) { + if (!socket_->read_callback_.is_null()) + socket_->DidCompleteRead(); +} + +void UDPSocketLibevent::WriteWatcher::OnFileCanWriteWithoutBlocking(int) { + if (!socket_->write_callback_.is_null()) + socket_->DidCompleteWrite(); +} + void UDPSocketLibevent::DoReadCallback(int rv) { DCHECK_NE(rv, ERR_IO_PENDING); DCHECK(!read_callback_.is_null()); diff --git a/net/udp/udp_socket_libevent.h b/net/udp/udp_socket_libevent.h index 4d3cddd..ce8a0f2 100644 --- a/net/udp/udp_socket_libevent.h +++ b/net/udp/udp_socket_libevent.h @@ -127,10 +127,7 @@ class NET_EXPORT UDPSocketLibevent : public base::NonThreadSafe { // MessageLoopForIO::Watcher methods - virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE { - if (!socket_->read_callback_.is_null()) - socket_->DidCompleteRead(); - } + virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE; virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE {} @@ -148,10 +145,7 @@ class NET_EXPORT UDPSocketLibevent : public base::NonThreadSafe { virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE {} - virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE { - if (!socket_->write_callback_.is_null()) - socket_->DidCompleteWrite(); - } + virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE; private: UDPSocketLibevent* const socket_; |