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

Unified Diff: net/udp/udp_socket_libevent.cc

Issue 914853002: Add CHECK() in UdpSocketLibevent to debug crbug.com/452121 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months 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
« no previous file with comments | « net/udp/udp_socket_libevent.h ('k') | net/udp/udp_socket_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/udp/udp_socket_libevent.cc
diff --git a/net/udp/udp_socket_libevent.cc b/net/udp/udp_socket_libevent.cc
index a36c59b4d64c37a459857c55be34803f04ecbcb0..7951155c0e6799697991590e15fc9436d286ba4c 100644
--- a/net/udp/udp_socket_libevent.cc
+++ b/net/udp/udp_socket_libevent.cc
@@ -105,11 +105,11 @@ int UDPSocketLibevent::Open(AddressFamily address_family) {
return OK;
}
-void UDPSocketLibevent::Close() {
+int UDPSocketLibevent::Close() {
DCHECK(CalledOnValidThread());
if (socket_ == kInvalidSocket)
- return;
+ return OK;
// Zero out any pending read/write callback state.
read_buf_ = NULL;
@@ -126,12 +126,17 @@ void UDPSocketLibevent::Close() {
ok = write_socket_watcher_.StopWatchingFileDescriptor();
DCHECK(ok);
- if (IGNORE_EINTR(close(socket_)) < 0)
+ int result = OK;
+ if (IGNORE_EINTR(close(socket_)) < 0) {
PLOG(ERROR) << "close";
+ result = MapSystemError(errno);
+ }
socket_ = kInvalidSocket;
addr_family_ = 0;
is_connected_ = false;
+
+ return result;
}
int UDPSocketLibevent::GetPeerAddress(IPEndPoint* address) const {
« no previous file with comments | « net/udp/udp_socket_libevent.h ('k') | net/udp/udp_socket_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698