| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/socks_client_socket_pool.h" | 5 #include "net/socket/socks_client_socket_pool.h" |
| 6 | 6 |
| 7 #include "base/time.h" | 7 #include "base/time.h" |
| 8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/socket/client_socket_factory.h" | 10 #include "net/socket/client_socket_factory.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 // Add a SOCKS connection on top of the tcp socket. | 122 // Add a SOCKS connection on top of the tcp socket. |
| 123 if (socks_params_.is_socks_v5()) { | 123 if (socks_params_.is_socks_v5()) { |
| 124 socket_.reset(new SOCKS5ClientSocket(tcp_socket_handle_.release(), | 124 socket_.reset(new SOCKS5ClientSocket(tcp_socket_handle_.release(), |
| 125 socks_params_.destination())); | 125 socks_params_.destination())); |
| 126 } else { | 126 } else { |
| 127 socket_.reset(new SOCKSClientSocket(tcp_socket_handle_.release(), | 127 socket_.reset(new SOCKSClientSocket(tcp_socket_handle_.release(), |
| 128 socks_params_.destination(), | 128 socks_params_.destination(), |
| 129 resolver_)); | 129 resolver_)); |
| 130 } | 130 } |
| 131 return socket_->Connect(&callback_, net_log()); | 131 return socket_->Connect(&callback_); |
| 132 } | 132 } |
| 133 | 133 |
| 134 int SOCKSConnectJob::DoSOCKSConnectComplete(int result) { | 134 int SOCKSConnectJob::DoSOCKSConnectComplete(int result) { |
| 135 if (result != OK) { | 135 if (result != OK) { |
| 136 socket_->Disconnect(); | 136 socket_->Disconnect(); |
| 137 return result; | 137 return result; |
| 138 } | 138 } |
| 139 | 139 |
| 140 set_socket(socket_.release()); | 140 set_socket(socket_.release()); |
| 141 return result; | 141 return result; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 const std::string& group_name) const { | 205 const std::string& group_name) const { |
| 206 return base_.IdleSocketCountInGroup(group_name); | 206 return base_.IdleSocketCountInGroup(group_name); |
| 207 } | 207 } |
| 208 | 208 |
| 209 LoadState SOCKSClientSocketPool::GetLoadState( | 209 LoadState SOCKSClientSocketPool::GetLoadState( |
| 210 const std::string& group_name, const ClientSocketHandle* handle) const { | 210 const std::string& group_name, const ClientSocketHandle* handle) const { |
| 211 return base_.GetLoadState(group_name, handle); | 211 return base_.GetLoadState(group_name, handle); |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace net | 214 } // namespace net |
| OLD | NEW |