| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 return ssl_params_->GetDirectConnectionParams()->destination(); | 61 return ssl_params_->GetDirectConnectionParams()->destination(); |
| 62 } else { | 62 } else { |
| 63 return transport_params_->destination(); | 63 return transport_params_->destination(); |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 | 66 |
| 67 HttpProxySocketParams::~HttpProxySocketParams() {} | 67 HttpProxySocketParams::~HttpProxySocketParams() {} |
| 68 | 68 |
| 69 // HttpProxyConnectJobs will time out after this many seconds. Note this is on | 69 // HttpProxyConnectJobs will time out after this many seconds. Note this is on |
| 70 // top of the timeout for the transport socket. | 70 // top of the timeout for the transport socket. |
| 71 #if (defined(OS_ANDROID) || defined(OS_IOS)) && defined(SPDY_PROXY_AUTH_ORIGIN) | 71 // TODO(kundaji): Proxy connect timeout should be independent of platform and be |
| 72 // based on proxy. Bug 407446. |
| 73 #if defined(OS_ANDROID) || defined(OS_IOS) |
| 72 static const int kHttpProxyConnectJobTimeoutInSeconds = 10; | 74 static const int kHttpProxyConnectJobTimeoutInSeconds = 10; |
| 73 #else | 75 #else |
| 74 static const int kHttpProxyConnectJobTimeoutInSeconds = 30; | 76 static const int kHttpProxyConnectJobTimeoutInSeconds = 30; |
| 75 #endif | 77 #endif |
| 76 | 78 |
| 77 | |
| 78 HttpProxyConnectJob::HttpProxyConnectJob( | 79 HttpProxyConnectJob::HttpProxyConnectJob( |
| 79 const std::string& group_name, | 80 const std::string& group_name, |
| 80 RequestPriority priority, | 81 RequestPriority priority, |
| 81 const scoped_refptr<HttpProxySocketParams>& params, | 82 const scoped_refptr<HttpProxySocketParams>& params, |
| 82 const base::TimeDelta& timeout_duration, | 83 const base::TimeDelta& timeout_duration, |
| 83 TransportClientSocketPool* transport_pool, | 84 TransportClientSocketPool* transport_pool, |
| 84 SSLClientSocketPool* ssl_pool, | 85 SSLClientSocketPool* ssl_pool, |
| 85 HostResolver* host_resolver, | 86 HostResolver* host_resolver, |
| 86 Delegate* delegate, | 87 Delegate* delegate, |
| 87 NetLog* net_log) | 88 NetLog* net_log) |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 base_.RemoveHigherLayeredPool(higher_pool); | 542 base_.RemoveHigherLayeredPool(higher_pool); |
| 542 } | 543 } |
| 543 | 544 |
| 544 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { | 545 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { |
| 545 if (base_.CloseOneIdleSocket()) | 546 if (base_.CloseOneIdleSocket()) |
| 546 return true; | 547 return true; |
| 547 return base_.CloseOneIdleConnectionInHigherLayeredPool(); | 548 return base_.CloseOneIdleConnectionInHigherLayeredPool(); |
| 548 } | 549 } |
| 549 | 550 |
| 550 } // namespace net | 551 } // namespace net |
| OLD | NEW |