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/socket/ssl_client_socket_pool.h" | 5 #include "net/socket/ssl_client_socket_pool.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 ConnectJob* SSLClientSocketPool::SSLConnectJobFactory::NewConnectJob( | 484 ConnectJob* SSLClientSocketPool::SSLConnectJobFactory::NewConnectJob( |
485 const std::string& group_name, | 485 const std::string& group_name, |
486 const PoolBase::Request& request, | 486 const PoolBase::Request& request, |
487 ConnectJob::Delegate* delegate) const { | 487 ConnectJob::Delegate* delegate) const { |
488 return new SSLConnectJob(group_name, request.params(), ConnectionTimeout(), | 488 return new SSLConnectJob(group_name, request.params(), ConnectionTimeout(), |
489 transport_pool_, socks_pool_, http_proxy_pool_, | 489 transport_pool_, socks_pool_, http_proxy_pool_, |
490 client_socket_factory_, host_resolver_, | 490 client_socket_factory_, host_resolver_, |
491 context_, delegate, net_log_); | 491 context_, delegate, net_log_); |
492 } | 492 } |
493 | 493 |
| 494 base::TimeDelta |
| 495 SSLClientSocketPool::SSLConnectJobFactory::ConnectionTimeout() const { |
| 496 return timeout_; |
| 497 } |
| 498 |
494 int SSLClientSocketPool::RequestSocket(const std::string& group_name, | 499 int SSLClientSocketPool::RequestSocket(const std::string& group_name, |
495 const void* socket_params, | 500 const void* socket_params, |
496 RequestPriority priority, | 501 RequestPriority priority, |
497 ClientSocketHandle* handle, | 502 ClientSocketHandle* handle, |
498 const CompletionCallback& callback, | 503 const CompletionCallback& callback, |
499 const BoundNetLog& net_log) { | 504 const BoundNetLog& net_log) { |
500 const scoped_refptr<SSLSocketParams>* casted_socket_params = | 505 const scoped_refptr<SSLSocketParams>* casted_socket_params = |
501 static_cast<const scoped_refptr<SSLSocketParams>*>(socket_params); | 506 static_cast<const scoped_refptr<SSLSocketParams>*>(socket_params); |
502 | 507 |
503 return base_.RequestSocket(group_name, *casted_socket_params, priority, | 508 return base_.RequestSocket(group_name, *casted_socket_params, priority, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 Flush(); | 606 Flush(); |
602 } | 607 } |
603 | 608 |
604 bool SSLClientSocketPool::CloseOneIdleConnection() { | 609 bool SSLClientSocketPool::CloseOneIdleConnection() { |
605 if (base_.CloseOneIdleSocket()) | 610 if (base_.CloseOneIdleSocket()) |
606 return true; | 611 return true; |
607 return base_.CloseOneIdleConnectionInLayeredPool(); | 612 return base_.CloseOneIdleConnectionInLayeredPool(); |
608 } | 613 } |
609 | 614 |
610 } // namespace net | 615 } // namespace net |
OLD | NEW |