| 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/http/http_proxy_client_socket_pool.h" | 5 #include "net/http/http_proxy_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/http/http_proxy_client_socket.h" | 10 #include "net/http/http_proxy_client_socket.h" |
| 11 #include "net/socket/client_socket_factory.h" | 11 #include "net/socket/client_socket_factory.h" |
| 12 #include "net/socket/client_socket_handle.h" | 12 #include "net/socket/client_socket_handle.h" |
| 13 #include "net/socket/client_socket_pool_base.h" | 13 #include "net/socket/client_socket_pool_base.h" |
| 14 | 14 |
| 15 namespace net { | 15 namespace net { |
| 16 | 16 |
| 17 HttpProxySocketParams::HttpProxySocketParams( | 17 HttpProxySocketParams::HttpProxySocketParams( |
| 18 const scoped_refptr<TCPSocketParams>& proxy_server, | 18 const scoped_refptr<TCPSocketParams>& proxy_server, |
| 19 const GURL& request_url, | 19 const GURL& request_url, |
| 20 HostPortPair endpoint, | 20 HostPortPair endpoint, |
| 21 scoped_refptr<HttpAuthController> auth_controller, | 21 HttpAuthController* auth_controller, |
| 22 bool tunnel) | 22 bool tunnel) |
| 23 : tcp_params_(proxy_server), | 23 : tcp_params_(proxy_server), |
| 24 request_url_(request_url), | 24 request_url_(request_url), |
| 25 endpoint_(endpoint), | 25 endpoint_(endpoint), |
| 26 auth_controller_(auth_controller), | 26 auth_controller_(auth_controller), |
| 27 tunnel_(tunnel) { | 27 tunnel_(tunnel) { |
| 28 } | 28 } |
| 29 | 29 |
| 30 HttpProxySocketParams::~HttpProxySocketParams() {} | 30 HttpProxySocketParams::~HttpProxySocketParams() {} |
| 31 | 31 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 return result; | 131 return result; |
| 132 } | 132 } |
| 133 | 133 |
| 134 int HttpProxyConnectJob::DoHttpProxyConnect() { | 134 int HttpProxyConnectJob::DoHttpProxyConnect() { |
| 135 next_state_ = kStateHttpProxyConnectComplete; | 135 next_state_ = kStateHttpProxyConnectComplete; |
| 136 | 136 |
| 137 // Add a HttpProxy connection on top of the tcp socket. | 137 // Add a HttpProxy connection on top of the tcp socket. |
| 138 socket_.reset(new HttpProxyClientSocket(tcp_socket_handle_.release(), | 138 socket_.reset(new HttpProxyClientSocket(tcp_socket_handle_.release(), |
| 139 params_->request_url(), | 139 params_->request_url(), |
| 140 params_->endpoint(), | 140 params_->endpoint(), |
| 141 params_->auth_controller(), | 141 params_->ReleaseAuthController(), |
| 142 params_->tunnel())); | 142 params_->tunnel())); |
| 143 return socket_->Connect(&callback_); | 143 return socket_->Connect(&callback_); |
| 144 } | 144 } |
| 145 | 145 |
| 146 int HttpProxyConnectJob::DoHttpProxyConnectComplete(int result) { | 146 int HttpProxyConnectJob::DoHttpProxyConnectComplete(int result) { |
| 147 DCHECK_NE(result, ERR_RETRY_CONNECTION); | 147 DCHECK_NE(result, ERR_RETRY_CONNECTION); |
| 148 | 148 |
| 149 if (result == OK || result == ERR_PROXY_AUTH_REQUESTED) | 149 if (result == OK || result == ERR_PROXY_AUTH_REQUESTED) |
| 150 set_socket(socket_.release()); | 150 set_socket(socket_.release()); |
| 151 | 151 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 const std::string& group_name) const { | 220 const std::string& group_name) const { |
| 221 return base_.IdleSocketCountInGroup(group_name); | 221 return base_.IdleSocketCountInGroup(group_name); |
| 222 } | 222 } |
| 223 | 223 |
| 224 LoadState HttpProxyClientSocketPool::GetLoadState( | 224 LoadState HttpProxyClientSocketPool::GetLoadState( |
| 225 const std::string& group_name, const ClientSocketHandle* handle) const { | 225 const std::string& group_name, const ClientSocketHandle* handle) const { |
| 226 return base_.GetLoadState(group_name, handle); | 226 return base_.GetLoadState(group_name, handle); |
| 227 } | 227 } |
| 228 | 228 |
| 229 } // namespace net | 229 } // namespace net |
| OLD | NEW |