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

Side by Side Diff: net/udp/udp_socket_libevent.cc

Issue 932913002: PCHECK when closing UDP sockets (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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/udp/udp_socket_libevent.h" 5 #include "net/udp/udp_socket_libevent.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <netdb.h> 9 #include <netdb.h>
10 #include <net/if.h> 10 #include <net/if.h>
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 write_buf_ = NULL; 119 write_buf_ = NULL;
120 write_buf_len_ = 0; 120 write_buf_len_ = 0;
121 write_callback_.Reset(); 121 write_callback_.Reset();
122 send_to_address_.reset(); 122 send_to_address_.reset();
123 123
124 bool ok = read_socket_watcher_.StopWatchingFileDescriptor(); 124 bool ok = read_socket_watcher_.StopWatchingFileDescriptor();
125 DCHECK(ok); 125 DCHECK(ok);
126 ok = write_socket_watcher_.StopWatchingFileDescriptor(); 126 ok = write_socket_watcher_.StopWatchingFileDescriptor();
127 DCHECK(ok); 127 DCHECK(ok);
128 128
129 if (IGNORE_EINTR(close(socket_)) < 0) 129 PCHECK(0 == IGNORE_EINTR(close(socket_)));
130 PLOG(ERROR) << "close";
131 130
132 socket_ = kInvalidSocket; 131 socket_ = kInvalidSocket;
133 addr_family_ = 0; 132 addr_family_ = 0;
134 is_connected_ = false; 133 is_connected_ = false;
135 } 134 }
136 135
137 int UDPSocketLibevent::GetPeerAddress(IPEndPoint* address) const { 136 int UDPSocketLibevent::GetPeerAddress(IPEndPoint* address) const {
138 DCHECK(CalledOnValidThread()); 137 DCHECK(CalledOnValidThread());
139 DCHECK(address); 138 DCHECK(address);
140 if (!is_connected()) 139 if (!is_connected())
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 return MapSystemError(errno); 743 return MapSystemError(errno);
745 744
746 return OK; 745 return OK;
747 } 746 }
748 747
749 void UDPSocketLibevent::DetachFromThread() { 748 void UDPSocketLibevent::DetachFromThread() {
750 base::NonThreadSafe::DetachFromThread(); 749 base::NonThreadSafe::DetachFromThread();
751 } 750 }
752 751
753 } // namespace net 752 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698