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

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

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk Created 7 years, 6 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 | « net/socket/ssl_server_socket_unittest.cc ('k') | net/socket/tcp_listen_socket_unittest.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_listen_socket.h" 5 #include "net/socket/tcp_listen_socket.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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 void TCPListenSocket::Accept() { 103 void TCPListenSocket::Accept() {
104 SocketDescriptor conn = AcceptSocket(); 104 SocketDescriptor conn = AcceptSocket();
105 if (conn == kInvalidSocket) 105 if (conn == kInvalidSocket)
106 return; 106 return;
107 scoped_refptr<TCPListenSocket> sock( 107 scoped_refptr<TCPListenSocket> sock(
108 new TCPListenSocket(conn, socket_delegate_)); 108 new TCPListenSocket(conn, socket_delegate_));
109 // It's up to the delegate to AddRef if it wants to keep it around. 109 // It's up to the delegate to AddRef if it wants to keep it around.
110 #if defined(OS_POSIX) 110 #if defined(OS_POSIX)
111 sock->WatchSocket(WAITING_READ); 111 sock->WatchSocket(WAITING_READ);
112 #endif 112 #endif
113 socket_delegate_->DidAccept(this, sock); 113 socket_delegate_->DidAccept(this, sock.get());
114 } 114 }
115 115
116 TCPListenSocketFactory::TCPListenSocketFactory(const string& ip, int port) 116 TCPListenSocketFactory::TCPListenSocketFactory(const string& ip, int port)
117 : ip_(ip), 117 : ip_(ip),
118 port_(port) { 118 port_(port) {
119 } 119 }
120 120
121 TCPListenSocketFactory::~TCPListenSocketFactory() {} 121 TCPListenSocketFactory::~TCPListenSocketFactory() {}
122 122
123 scoped_refptr<StreamListenSocket> TCPListenSocketFactory::CreateAndListen( 123 scoped_refptr<StreamListenSocket> TCPListenSocketFactory::CreateAndListen(
124 StreamListenSocket::Delegate* delegate) const { 124 StreamListenSocket::Delegate* delegate) const {
125 return TCPListenSocket::CreateAndListen(ip_, port_, delegate); 125 return TCPListenSocket::CreateAndListen(ip_, port_, delegate);
126 } 126 }
127 127
128 } // namespace net 128 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_server_socket_unittest.cc ('k') | net/socket/tcp_listen_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698