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

Side by Side Diff: net/base/listen_socket.cc

Issue 4192012: Convert implicit scoped_refptr constructor calls to explicit ones, part 1 (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: fix presubmit Created 10 years, 1 month 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 | « net/base/host_resolver_impl_unittest.cc ('k') | net/base/mock_host_resolver.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 // winsock2.h must be included first in order to ensure it is included before 8 // winsock2.h must be included first in order to ensure it is included before
9 // windows.h. 9 // windows.h.
10 #include <winsock2.h> 10 #include <winsock2.h>
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 HANDLE_EINTR(accept(s, reinterpret_cast<sockaddr*>(&from), &from_len)); 114 HANDLE_EINTR(accept(s, reinterpret_cast<sockaddr*>(&from), &from_len));
115 if (conn != kInvalidSocket) { 115 if (conn != kInvalidSocket) {
116 net::SetNonBlocking(conn); 116 net::SetNonBlocking(conn);
117 } 117 }
118 return conn; 118 return conn;
119 } 119 }
120 120
121 void ListenSocket::Accept() { 121 void ListenSocket::Accept() {
122 SOCKET conn = Accept(socket_); 122 SOCKET conn = Accept(socket_);
123 if (conn != kInvalidSocket) { 123 if (conn != kInvalidSocket) {
124 scoped_refptr<ListenSocket> sock = 124 scoped_refptr<ListenSocket> sock(
125 new ListenSocket(conn, socket_delegate_); 125 new ListenSocket(conn, socket_delegate_));
126 // it's up to the delegate to AddRef if it wants to keep it around 126 // it's up to the delegate to AddRef if it wants to keep it around
127 #if defined(OS_POSIX) 127 #if defined(OS_POSIX)
128 sock->WatchSocket(WAITING_READ); 128 sock->WatchSocket(WAITING_READ);
129 #endif 129 #endif
130 socket_delegate_->DidAccept(this, sock); 130 socket_delegate_->DidAccept(this, sock);
131 } else { 131 } else {
132 // TODO(ibrar): some error handling required here 132 // TODO(ibrar): some error handling required here
133 } 133 }
134 } 134 }
135 135
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 } 310 }
311 } 311 }
312 312
313 void ListenSocket::OnFileCanWriteWithoutBlocking(int fd) { 313 void ListenSocket::OnFileCanWriteWithoutBlocking(int fd) {
314 // MessagePumpLibevent callback, we don't listen for write events 314 // MessagePumpLibevent callback, we don't listen for write events
315 // so we shouldn't ever reach here. 315 // so we shouldn't ever reach here.
316 NOTREACHED(); 316 NOTREACHED();
317 } 317 }
318 318
319 #endif 319 #endif
OLDNEW
« no previous file with comments | « net/base/host_resolver_impl_unittest.cc ('k') | net/base/mock_host_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698