OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 kHttpProxyConnectJobTimeoutInSeconds)); | 199 kHttpProxyConnectJobTimeoutInSeconds)); |
200 | 200 |
201 next_state_ = STATE_HTTP_PROXY_CONNECT; | 201 next_state_ = STATE_HTTP_PROXY_CONNECT; |
202 return result; | 202 return result; |
203 } | 203 } |
204 | 204 |
205 int HttpProxyConnectJob::DoSSLConnect() { | 205 int HttpProxyConnectJob::DoSSLConnect() { |
206 if (params_->tunnel()) { | 206 if (params_->tunnel()) { |
207 SpdySessionKey key(params_->destination().host_port_pair(), | 207 SpdySessionKey key(params_->destination().host_port_pair(), |
208 ProxyServer::Direct(), | 208 ProxyServer::Direct(), |
209 kPrivacyModeDisabled); | 209 PRIVACY_MODE_DISABLED); |
210 if (params_->spdy_session_pool()->FindAvailableSession(key, net_log())) { | 210 if (params_->spdy_session_pool()->FindAvailableSession(key, net_log())) { |
211 using_spdy_ = true; | 211 using_spdy_ = true; |
212 next_state_ = STATE_SPDY_PROXY_CREATE_STREAM; | 212 next_state_ = STATE_SPDY_PROXY_CREATE_STREAM; |
213 return OK; | 213 return OK; |
214 } | 214 } |
215 } | 215 } |
216 next_state_ = STATE_SSL_CONNECT_COMPLETE; | 216 next_state_ = STATE_SSL_CONNECT_COMPLETE; |
217 transport_socket_handle_.reset(new ClientSocketHandle()); | 217 transport_socket_handle_.reset(new ClientSocketHandle()); |
218 return transport_socket_handle_->Init( | 218 return transport_socket_handle_->Init( |
219 group_name(), params_->ssl_params(), priority(), callback_, | 219 group_name(), params_->ssl_params(), priority(), callback_, |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 } | 295 } |
296 | 296 |
297 return result; | 297 return result; |
298 } | 298 } |
299 | 299 |
300 int HttpProxyConnectJob::DoSpdyProxyCreateStream() { | 300 int HttpProxyConnectJob::DoSpdyProxyCreateStream() { |
301 DCHECK(using_spdy_); | 301 DCHECK(using_spdy_); |
302 DCHECK(params_->tunnel()); | 302 DCHECK(params_->tunnel()); |
303 SpdySessionKey key(params_->destination().host_port_pair(), | 303 SpdySessionKey key(params_->destination().host_port_pair(), |
304 ProxyServer::Direct(), | 304 ProxyServer::Direct(), |
305 kPrivacyModeDisabled); | 305 PRIVACY_MODE_DISABLED); |
306 SpdySessionPool* spdy_pool = params_->spdy_session_pool(); | 306 SpdySessionPool* spdy_pool = params_->spdy_session_pool(); |
307 base::WeakPtr<SpdySession> spdy_session = | 307 base::WeakPtr<SpdySession> spdy_session = |
308 spdy_pool->FindAvailableSession(key, net_log()); | 308 spdy_pool->FindAvailableSession(key, net_log()); |
309 // It's possible that a session to the proxy has recently been created | 309 // It's possible that a session to the proxy has recently been created |
310 if (spdy_session) { | 310 if (spdy_session) { |
311 if (transport_socket_handle_.get()) { | 311 if (transport_socket_handle_.get()) { |
312 if (transport_socket_handle_->socket()) | 312 if (transport_socket_handle_->socket()) |
313 transport_socket_handle_->socket()->Disconnect(); | 313 transport_socket_handle_->socket()->Disconnect(); |
314 transport_socket_handle_->Reset(); | 314 transport_socket_handle_->Reset(); |
315 } | 315 } |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 base_.RemoveHigherLayeredPool(higher_pool); | 534 base_.RemoveHigherLayeredPool(higher_pool); |
535 } | 535 } |
536 | 536 |
537 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { | 537 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { |
538 if (base_.CloseOneIdleSocket()) | 538 if (base_.CloseOneIdleSocket()) |
539 return true; | 539 return true; |
540 return base_.CloseOneIdleConnectionInHigherLayeredPool(); | 540 return base_.CloseOneIdleConnectionInHigherLayeredPool(); |
541 } | 541 } |
542 | 542 |
543 } // namespace net | 543 } // namespace net |
OLD | NEW |