Chromium Code Reviews| Index: net/socket/transport_client_socket_unittest.cc |
| diff --git a/net/socket/transport_client_socket_unittest.cc b/net/socket/transport_client_socket_unittest.cc |
| index 2f75e740067d5f126002a478f0cc3682e5126dd1..c4cdf8c7b4c48172ce611318a5876823d00e1027 100644 |
| --- a/net/socket/transport_client_socket_unittest.cc |
| +++ b/net/socket/transport_client_socket_unittest.cc |
| @@ -48,8 +48,9 @@ class TransportClientSocketTest |
| // Implement StreamListenSocket::Delegate methods |
| virtual void DidAccept(StreamListenSocket* server, |
| - StreamListenSocket* connection) OVERRIDE { |
| - connected_sock_ = reinterpret_cast<TCPListenSocket*>(connection); |
| + scoped_ptr<StreamListenSocket> connection) OVERRIDE { |
| + connected_sock_.reset( |
| + reinterpret_cast<TCPListenSocket*>(connection.release())); |
|
akalin
2013/08/30 20:53:02
I think you can just do connect_sock_ = connection
szym
2013/08/30 22:08:01
StreamListenSocket is the base class of TCPListenS
|
| } |
| virtual void DidRead(StreamListenSocket*, const char* str, int len) OVERRIDE { |
| // TODO(dkegel): this might not be long enough to tickle some bugs. |
| @@ -65,7 +66,7 @@ class TransportClientSocketTest |
| void CloseServerSocket() { |
| // delete the connected_sock_, which will close it. |
| - connected_sock_ = NULL; |
| + connected_sock_.reset(); |
| } |
| void PauseServerReads() { |
| @@ -94,8 +95,8 @@ class TransportClientSocketTest |
| scoped_ptr<StreamSocket> sock_; |
| private: |
| - scoped_refptr<TCPListenSocket> listen_sock_; |
| - scoped_refptr<TCPListenSocket> connected_sock_; |
| + scoped_ptr<TCPListenSocket> listen_sock_; |
| + scoped_ptr<TCPListenSocket> connected_sock_; |
| bool close_server_socket_on_next_send_; |
| }; |
| @@ -103,7 +104,7 @@ void TransportClientSocketTest::SetUp() { |
| ::testing::TestWithParam<ClientSocketTestTypes>::SetUp(); |
| // Find a free port to listen on |
| - scoped_refptr<TCPListenSocket> sock; |
| + scoped_ptr<TCPListenSocket> sock; |
| int port; |
| // Range of ports to listen on. Shouldn't need to try many. |
| const int kMinPort = 10100; |
| @@ -117,7 +118,7 @@ void TransportClientSocketTest::SetUp() { |
| break; |
| } |
| ASSERT_TRUE(sock.get() != NULL); |
| - listen_sock_ = sock; |
| + listen_sock_ = sock.Pass(); |
| listen_port_ = port; |
| AddressList addr; |