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

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

Issue 657013003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 void TCPListenSocket::Accept() { 100 void TCPListenSocket::Accept() {
101 SocketDescriptor conn = AcceptSocket(); 101 SocketDescriptor conn = AcceptSocket();
102 if (conn == kInvalidSocket) 102 if (conn == kInvalidSocket)
103 return; 103 return;
104 scoped_ptr<TCPListenSocket> sock( 104 scoped_ptr<TCPListenSocket> sock(
105 new TCPListenSocket(conn, socket_delegate_)); 105 new TCPListenSocket(conn, socket_delegate_));
106 // It's up to the delegate to AddRef if it wants to keep it around. 106 // It's up to the delegate to AddRef if it wants to keep it around.
107 #if defined(OS_POSIX) 107 #if defined(OS_POSIX)
108 sock->WatchSocket(WAITING_READ); 108 sock->WatchSocket(WAITING_READ);
109 #endif 109 #endif
110 socket_delegate_->DidAccept(this, sock.PassAs<StreamListenSocket>()); 110 socket_delegate_->DidAccept(this, sock.Pass());
111 } 111 }
112 112
113 TCPListenSocketFactory::TCPListenSocketFactory(const string& ip, int port) 113 TCPListenSocketFactory::TCPListenSocketFactory(const string& ip, int port)
114 : ip_(ip), 114 : ip_(ip),
115 port_(port) { 115 port_(port) {
116 } 116 }
117 117
118 TCPListenSocketFactory::~TCPListenSocketFactory() {} 118 TCPListenSocketFactory::~TCPListenSocketFactory() {}
119 119
120 scoped_ptr<StreamListenSocket> TCPListenSocketFactory::CreateAndListen( 120 scoped_ptr<StreamListenSocket> TCPListenSocketFactory::CreateAndListen(
121 StreamListenSocket::Delegate* delegate) const { 121 StreamListenSocket::Delegate* delegate) const {
122 return TCPListenSocket::CreateAndListen(ip_, port_, delegate) 122 return TCPListenSocket::CreateAndListen(ip_, port_, delegate);
123 .PassAs<StreamListenSocket>();
124 } 123 }
125 124
126 } // namespace net 125 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_unittest.cc ('k') | net/socket/transport_client_socket_pool_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698