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

Unified Diff: net/socket/tcp_server_socket_win.cc

Issue 8771030: base::Bind: Convert ServerSocket::Accept. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test logic fix. Created 9 years 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/socket/tcp_server_socket_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_server_socket_win.cc
diff --git a/net/socket/tcp_server_socket_win.cc b/net/socket/tcp_server_socket_win.cc
index bde65ec0640ace77cdc598455e8cdfb47efad4f3..baa541085c30cc17966e9a1e4b8fb95530a86e5b 100644
--- a/net/socket/tcp_server_socket_win.cc
+++ b/net/socket/tcp_server_socket_win.cc
@@ -20,7 +20,6 @@ TCPServerSocketWin::TCPServerSocketWin(net::NetLog* net_log,
: socket_(INVALID_SOCKET),
socket_event_(WSA_INVALID_EVENT),
accept_socket_(NULL),
- accept_callback_(NULL),
net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_SOCKET)) {
scoped_refptr<NetLog::EventParameters> params;
if (source.is_valid())
@@ -99,11 +98,11 @@ int TCPServerSocketWin::GetLocalAddress(IPEndPoint* address) const {
}
int TCPServerSocketWin::Accept(
- scoped_ptr<StreamSocket>* socket, OldCompletionCallback* callback) {
+ scoped_ptr<StreamSocket>* socket, const CompletionCallback& callback) {
DCHECK(CalledOnValidThread());
DCHECK(socket);
- DCHECK(callback);
- DCHECK(!accept_callback_);
+ DCHECK(!callback.is_null());
+ DCHECK(accept_callback_.is_null());
net_log_.BeginEvent(NetLog::TYPE_TCP_ACCEPT, NULL);
@@ -182,10 +181,9 @@ void TCPServerSocketWin::OnObjectSignaled(HANDLE object) {
if (ev.lNetworkEvents & FD_ACCEPT) {
int result = AcceptInternal(accept_socket_);
if (result != ERR_IO_PENDING) {
- OldCompletionCallback* c = accept_callback_;
- accept_callback_ = NULL;
accept_socket_ = NULL;
- c->Run(result);
+ accept_callback_.Run(result);
+ accept_callback_.Reset();
}
}
}
« no previous file with comments | « net/socket/tcp_server_socket_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698