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

Side by Side Diff: net/socket/tcp_server_socket_libevent.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, 8 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
« no previous file with comments | « no previous file | net/socket/tcp_server_socket_win.cc » ('j') | 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) 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_libevent.h" 5 #include "net/socket/tcp_server_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 <sys/socket.h> 10 #include <sys/socket.h>
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 180 }
181 181
182 void TCPServerSocketLibevent::OnFileCanReadWithoutBlocking(int fd) { 182 void TCPServerSocketLibevent::OnFileCanReadWithoutBlocking(int fd) {
183 DCHECK(CalledOnValidThread()); 183 DCHECK(CalledOnValidThread());
184 184
185 int result = AcceptInternal(accept_socket_); 185 int result = AcceptInternal(accept_socket_);
186 if (result != ERR_IO_PENDING) { 186 if (result != ERR_IO_PENDING) {
187 accept_socket_ = NULL; 187 accept_socket_ = NULL;
188 bool ok = accept_socket_watcher_.StopWatchingFileDescriptor(); 188 bool ok = accept_socket_watcher_.StopWatchingFileDescriptor();
189 DCHECK(ok); 189 DCHECK(ok);
190 accept_callback_.Run(result); 190 CompletionCallback callback = accept_callback_;
James Hawkins 2012/03/28 23:25:22 accept_callback_.Reset().Run(result);
Sergey Ulanov 2012/03/29 00:05:38 I don't think Callback<>.Reset() returns anything,
James Hawkins 2012/03/30 20:25:01 Huh. I could swear someone just added this recent
191 accept_callback_.Reset(); 191 accept_callback_.Reset();
192 callback.Run(result);
192 } 193 }
193 } 194 }
194 195
195 void TCPServerSocketLibevent::OnFileCanWriteWithoutBlocking(int fd) { 196 void TCPServerSocketLibevent::OnFileCanWriteWithoutBlocking(int fd) {
196 NOTREACHED(); 197 NOTREACHED();
197 } 198 }
198 199
199 } // namespace net 200 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/socket/tcp_server_socket_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698