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

Side by Side Diff: net/socket/tcp_server_socket_win.cc

Issue 9837122: Reset accept_callback_ before calling it from TCPServerSocket. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/socket/tcp_server_socket_win.h" 5 #include "net/socket/tcp_server_socket_win.h"
6 6
7 #include <mstcpip.h> 7 #include <mstcpip.h>
8 8
9 #include "net/base/ip_endpoint.h" 9 #include "net/base/ip_endpoint.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 WSANETWORKEVENTS ev; 175 WSANETWORKEVENTS ev;
176 if (WSAEnumNetworkEvents(socket_, socket_event_, &ev) == SOCKET_ERROR) { 176 if (WSAEnumNetworkEvents(socket_, socket_event_, &ev) == SOCKET_ERROR) {
177 PLOG(ERROR) << "WSAEnumNetworkEvents()"; 177 PLOG(ERROR) << "WSAEnumNetworkEvents()";
178 return; 178 return;
179 } 179 }
180 180
181 if (ev.lNetworkEvents & FD_ACCEPT) { 181 if (ev.lNetworkEvents & FD_ACCEPT) {
182 int result = AcceptInternal(accept_socket_); 182 int result = AcceptInternal(accept_socket_);
183 if (result != ERR_IO_PENDING) { 183 if (result != ERR_IO_PENDING) {
184 accept_socket_ = NULL; 184 accept_socket_ = NULL;
185 accept_callback_.Run(result); 185 CompletionCallback callback = accept_callback_;
186 accept_callback_.Reset(); 186 accept_callback_.Reset();
187 callback.Run(result);
187 } 188 }
188 } 189 }
189 } 190 }
190 191
191 } // namespace net 192 } // namespace net
OLDNEW
« net/socket/tcp_server_socket_libevent.cc ('K') | « net/socket/tcp_server_socket_libevent.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698