Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 |
| OLD | NEW |