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 28 matching lines...) Expand all Loading... |
39 : direct_params_(direct_params), | 39 : direct_params_(direct_params), |
40 socks_proxy_params_(socks_proxy_params), | 40 socks_proxy_params_(socks_proxy_params), |
41 http_proxy_params_(http_proxy_params), | 41 http_proxy_params_(http_proxy_params), |
42 host_and_port_(host_and_port), | 42 host_and_port_(host_and_port), |
43 ssl_config_(ssl_config), | 43 ssl_config_(ssl_config), |
44 privacy_mode_(privacy_mode), | 44 privacy_mode_(privacy_mode), |
45 load_flags_(load_flags), | 45 load_flags_(load_flags), |
46 force_spdy_over_ssl_(force_spdy_over_ssl), | 46 force_spdy_over_ssl_(force_spdy_over_ssl), |
47 want_spdy_over_npn_(want_spdy_over_npn), | 47 want_spdy_over_npn_(want_spdy_over_npn), |
48 ignore_limits_(false) { | 48 ignore_limits_(false) { |
49 if (direct_params_.get()) { | 49 if (direct_params_) { |
50 DCHECK(!socks_proxy_params_.get()); | 50 DCHECK(!socks_proxy_params_); |
51 DCHECK(!http_proxy_params_.get()); | 51 DCHECK(!http_proxy_params_); |
52 ignore_limits_ = direct_params_->ignore_limits(); | 52 ignore_limits_ = direct_params_->ignore_limits(); |
53 } else if (socks_proxy_params_.get()) { | 53 } else if (socks_proxy_params_) { |
54 DCHECK(!http_proxy_params_.get()); | 54 DCHECK(!http_proxy_params_); |
55 ignore_limits_ = socks_proxy_params_->ignore_limits(); | 55 ignore_limits_ = socks_proxy_params_->ignore_limits(); |
56 } else { | 56 } else { |
57 DCHECK(http_proxy_params_.get()); | 57 DCHECK(http_proxy_params_); |
58 ignore_limits_ = http_proxy_params_->ignore_limits(); | 58 ignore_limits_ = http_proxy_params_->ignore_limits(); |
59 } | 59 } |
60 } | 60 } |
61 | 61 |
62 SSLSocketParams::~SSLSocketParams() {} | 62 SSLSocketParams::~SSLSocketParams() {} |
63 | 63 |
64 SSLSocketParams::ConnectionType SSLSocketParams::GetConnectionType() const { | 64 SSLSocketParams::ConnectionType SSLSocketParams::GetConnectionType() const { |
65 if (direct_params_.get()) { | 65 if (direct_params_) { |
66 DCHECK(!socks_proxy_params_.get()); | 66 DCHECK(!socks_proxy_params_); |
67 DCHECK(!http_proxy_params_.get()); | 67 DCHECK(!http_proxy_params_); |
68 return DIRECT; | 68 return DIRECT; |
69 } | 69 } |
70 | 70 |
71 if (socks_proxy_params_.get()) { | 71 if (socks_proxy_params_) { |
72 DCHECK(!http_proxy_params_.get()); | 72 DCHECK(!http_proxy_params_); |
73 return SOCKS_PROXY; | 73 return SOCKS_PROXY; |
74 } | 74 } |
75 | 75 |
76 DCHECK(http_proxy_params_.get()); | 76 DCHECK(http_proxy_params_); |
77 return HTTP_PROXY; | 77 return HTTP_PROXY; |
78 } | 78 } |
79 | 79 |
80 const scoped_refptr<TransportSocketParams>& | 80 const scoped_refptr<TransportSocketParams>& |
81 SSLSocketParams::GetDirectConnectionParams() const { | 81 SSLSocketParams::GetDirectConnectionParams() const { |
82 DCHECK_EQ(GetConnectionType(), DIRECT); | 82 DCHECK_EQ(GetConnectionType(), DIRECT); |
83 return direct_params_; | 83 return direct_params_; |
84 } | 84 } |
85 | 85 |
86 const scoped_refptr<SOCKSSocketParams>& | 86 const scoped_refptr<SOCKSSocketParams>& |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 CHECK(it != messenger_map_.end()); | 854 CHECK(it != messenger_map_.end()); |
855 delete it->second; | 855 delete it->second; |
856 messenger_map_.erase(it); | 856 messenger_map_.erase(it); |
857 } | 857 } |
858 | 858 |
859 void SSLClientSocketPool::OnSSLConfigChanged() { | 859 void SSLClientSocketPool::OnSSLConfigChanged() { |
860 FlushWithError(ERR_NETWORK_CHANGED); | 860 FlushWithError(ERR_NETWORK_CHANGED); |
861 } | 861 } |
862 | 862 |
863 } // namespace net | 863 } // namespace net |
OLD | NEW |