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

Unified Diff: net/socket/socks5_client_socket_unittest.cc

Issue 22794008: Remove deprecated functions that take StreamSockets instead of handles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
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)));
}

Powered by Google App Engine
This is Rietveld 408576698