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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 DCHECK(http_proxy_params_.get() == NULL); | 62 DCHECK(http_proxy_params_.get() == NULL); |
63 DCHECK(socks_params_.get() != NULL); | 63 DCHECK(socks_params_.get() != NULL); |
64 ignore_limits_ = socks_params_->ignore_limits(); | 64 ignore_limits_ = socks_params_->ignore_limits(); |
65 break; | 65 break; |
66 default: | 66 default: |
67 LOG(DFATAL) << "unknown proxy type"; | 67 LOG(DFATAL) << "unknown proxy type"; |
68 break; | 68 break; |
69 } | 69 } |
70 } | 70 } |
71 | 71 |
| 72 SSLSocketParams::SSLSocketParams( |
| 73 const scoped_refptr<TransportSocketParams>& transport_params, |
| 74 const HostPortPair& host_and_port, |
| 75 const SSLConfig& ssl_config, |
| 76 int load_flags, |
| 77 bool force_spdy_over_ssl, |
| 78 bool want_spdy_over_npn) |
| 79 : transport_params_(transport_params), |
| 80 proxy_(ProxyServer::SCHEME_DIRECT), |
| 81 host_and_port_(host_and_port), |
| 82 ssl_config_(ssl_config), |
| 83 load_flags_(load_flags), |
| 84 force_spdy_over_ssl_(force_spdy_over_ssl), |
| 85 want_spdy_over_npn_(want_spdy_over_npn), |
| 86 ignore_limits_(transport_params_->ignore_limits()) {} |
| 87 |
| 88 SSLSocketParams::SSLSocketParams( |
| 89 const scoped_refptr<HttpProxySocketParams>& http_proxy_params, |
| 90 ProxyServer::Scheme proxy, |
| 91 const HostPortPair& host_and_port, |
| 92 const SSLConfig& ssl_config, |
| 93 int load_flags, |
| 94 bool force_spdy_over_ssl, |
| 95 bool want_spdy_over_npn) |
| 96 : http_proxy_params_(http_proxy_params), |
| 97 proxy_(proxy), |
| 98 host_and_port_(host_and_port), |
| 99 ssl_config_(ssl_config), |
| 100 load_flags_(load_flags), |
| 101 force_spdy_over_ssl_(force_spdy_over_ssl), |
| 102 want_spdy_over_npn_(want_spdy_over_npn), |
| 103 ignore_limits_(http_proxy_params_->ignore_limits()) { |
| 104 DCHECK(proxy_ == ProxyServer::SCHEME_HTTP || |
| 105 proxy_ == ProxyServer::SCHEME_HTTPS); |
| 106 } |
| 107 |
| 108 SSLSocketParams::SSLSocketParams( |
| 109 const scoped_refptr<SOCKSSocketParams>& socks_params, |
| 110 ProxyServer::Scheme proxy, |
| 111 const HostPortPair& host_and_port, |
| 112 const SSLConfig& ssl_config, |
| 113 int load_flags, |
| 114 bool force_spdy_over_ssl, |
| 115 bool want_spdy_over_npn) |
| 116 : socks_params_(socks_params), |
| 117 proxy_(proxy), |
| 118 host_and_port_(host_and_port), |
| 119 ssl_config_(ssl_config), |
| 120 load_flags_(load_flags), |
| 121 force_spdy_over_ssl_(force_spdy_over_ssl), |
| 122 want_spdy_over_npn_(want_spdy_over_npn), |
| 123 ignore_limits_(socks_params_->ignore_limits()) { |
| 124 DCHECK(proxy_ == ProxyServer::SCHEME_SOCKS4 || |
| 125 proxy_ == ProxyServer::SCHEME_SOCKS5); |
| 126 } |
| 127 |
72 SSLSocketParams::~SSLSocketParams() {} | 128 SSLSocketParams::~SSLSocketParams() {} |
73 | 129 |
74 // Timeout for the SSL handshake portion of the connect. | 130 // Timeout for the SSL handshake portion of the connect. |
75 static const int kSSLHandshakeTimeoutInSeconds = 30; | 131 static const int kSSLHandshakeTimeoutInSeconds = 30; |
76 | 132 |
77 SSLConnectJob::SSLConnectJob(const std::string& group_name, | 133 SSLConnectJob::SSLConnectJob(const std::string& group_name, |
78 const scoped_refptr<SSLSocketParams>& params, | 134 const scoped_refptr<SSLSocketParams>& params, |
79 const base::TimeDelta& timeout_duration, | 135 const base::TimeDelta& timeout_duration, |
80 TransportClientSocketPool* transport_pool, | 136 TransportClientSocketPool* transport_pool, |
81 SOCKSClientSocketPool* socks_pool, | 137 SOCKSClientSocketPool* socks_pool, |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 FlushWithError(ERR_NETWORK_CHANGED); | 678 FlushWithError(ERR_NETWORK_CHANGED); |
623 } | 679 } |
624 | 680 |
625 bool SSLClientSocketPool::CloseOneIdleConnection() { | 681 bool SSLClientSocketPool::CloseOneIdleConnection() { |
626 if (base_.CloseOneIdleSocket()) | 682 if (base_.CloseOneIdleSocket()) |
627 return true; | 683 return true; |
628 return base_.CloseOneIdleConnectionInLayeredPool(); | 684 return base_.CloseOneIdleConnectionInLayeredPool(); |
629 } | 685 } |
630 | 686 |
631 } // namespace net | 687 } // namespace net |
OLD | NEW |