Chromium Code Reviews| Index: net/socket/socks5_client_socket_unittest.cc |
| diff --git a/net/socket/socks5_client_socket_unittest.cc b/net/socket/socks5_client_socket_unittest.cc |
| index 717d858eef840730e4847dbea30429bcd99edd06..562feb2107245d16c8beb5cbd1e6cbab6be71a7a 100644 |
| --- a/net/socket/socks5_client_socket_unittest.cc |
| +++ b/net/socket/socks5_client_socket_unittest.cc |
| @@ -47,6 +47,8 @@ class SOCKS5ClientSocketTest : public PlatformTest { |
| CapturingNetLog net_log_; |
| scoped_ptr<SOCKS5ClientSocket> user_sock_; |
| AddressList address_list_; |
| + // Filled in by BuildMockSocket() and owned by its return value |
| + // (which |user_sock| is set to). |
| StreamSocket* tcp_sock_; |
| TestCompletionCallback callback_; |
| scoped_ptr<MockHostResolver> host_resolver_; |
| @@ -94,7 +96,11 @@ SOCKS5ClientSocket* SOCKS5ClientSocketTest::BuildMockSocket( |
| EXPECT_EQ(OK, rv); |
| EXPECT_TRUE(tcp_sock_->IsConnected()); |
| - return new SOCKS5ClientSocket(tcp_sock_, |
| + scoped_ptr<ClientSocketHandle> connection(new ClientSocketHandle); |
| + // |connection| takes ownership of |tcp_sock_|, but we still keep a |
| + // non-owning pointer to it. |
|
Ryan Sleevi
2013/08/13 20:26:13
comment nit: s/we still//
https://groups.google.c
akalin
2013/08/13 20:51:28
Done.
|
| + connection->set_socket(tcp_sock_); |
| + return new SOCKS5ClientSocket(connection.release(), |
|
Ryan Sleevi
2013/08/13 20:26:13
style nit: connection.release() should be on a new
akalin
2013/08/13 20:51:28
Done.
|
| HostResolver::RequestInfo(HostPortPair(hostname, port))); |
| } |