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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 if (transport_pool_) | 384 if (transport_pool_) |
385 max_pool_timeout = transport_pool_->ConnectionTimeout(); | 385 max_pool_timeout = transport_pool_->ConnectionTimeout(); |
386 if (ssl_pool_) | 386 if (ssl_pool_) |
387 max_pool_timeout = std::max(max_pool_timeout, | 387 max_pool_timeout = std::max(max_pool_timeout, |
388 ssl_pool_->ConnectionTimeout()); | 388 ssl_pool_->ConnectionTimeout()); |
389 #endif | 389 #endif |
390 timeout_ = max_pool_timeout + | 390 timeout_ = max_pool_timeout + |
391 base::TimeDelta::FromSeconds(kHttpProxyConnectJobTimeoutInSeconds); | 391 base::TimeDelta::FromSeconds(kHttpProxyConnectJobTimeoutInSeconds); |
392 } | 392 } |
393 | 393 |
394 | |
395 scoped_ptr<ConnectJob> | 394 scoped_ptr<ConnectJob> |
396 HttpProxyClientSocketPool::HttpProxyConnectJobFactory::NewConnectJob( | 395 HttpProxyClientSocketPool::HttpProxyConnectJobFactory::NewConnectJob( |
397 const std::string& group_name, | 396 const std::string& group_name, |
398 const PoolBase::Request& request, | 397 const PoolBase::Request& request, |
399 ConnectJob::Delegate* delegate) const { | 398 ConnectJob::Delegate* delegate) { |
400 return scoped_ptr<ConnectJob>(new HttpProxyConnectJob(group_name, | 399 return scoped_ptr<ConnectJob>(new HttpProxyConnectJob(group_name, |
401 request.priority(), | 400 request.priority(), |
402 request.params(), | 401 request.params(), |
403 ConnectionTimeout(), | 402 ConnectionTimeout(), |
404 transport_pool_, | 403 transport_pool_, |
405 ssl_pool_, | 404 ssl_pool_, |
406 host_resolver_, | 405 host_resolver_, |
407 delegate, | 406 delegate, |
408 net_log_)); | 407 net_log_)); |
409 } | 408 } |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 base_.RemoveHigherLayeredPool(higher_pool); | 540 base_.RemoveHigherLayeredPool(higher_pool); |
542 } | 541 } |
543 | 542 |
544 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { | 543 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { |
545 if (base_.CloseOneIdleSocket()) | 544 if (base_.CloseOneIdleSocket()) |
546 return true; | 545 return true; |
547 return base_.CloseOneIdleConnectionInHigherLayeredPool(); | 546 return base_.CloseOneIdleConnectionInHigherLayeredPool(); |
548 } | 547 } |
549 | 548 |
550 } // namespace net | 549 } // namespace net |
OLD | NEW |