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.h" | 5 #include "net/socket/ssl_client_socket.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/metrics/sparse_histogram.h" | 8 #include "base/metrics/sparse_histogram.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "crypto/ec_private_key.h" | 10 #include "crypto/ec_private_key.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 bool SSLClientSocket::WasNpnNegotiated() const { | 95 bool SSLClientSocket::WasNpnNegotiated() const { |
96 return was_npn_negotiated_; | 96 return was_npn_negotiated_; |
97 } | 97 } |
98 | 98 |
99 NextProto SSLClientSocket::GetNegotiatedProtocol() const { | 99 NextProto SSLClientSocket::GetNegotiatedProtocol() const { |
100 return protocol_negotiated_; | 100 return protocol_negotiated_; |
101 } | 101 } |
102 | 102 |
103 bool SSLClientSocket::IgnoreCertError(int error, int load_flags) { | 103 bool SSLClientSocket::IgnoreCertError(int error, int load_flags) { |
104 if (error == OK || load_flags & LOAD_IGNORE_ALL_CERT_ERRORS) | 104 return error == OK || (load_flags & LOAD_IGNORE_ALL_CERT_ERRORS); |
105 return true; | |
106 | |
107 if (error == ERR_CERT_COMMON_NAME_INVALID && | |
108 (load_flags & LOAD_IGNORE_CERT_COMMON_NAME_INVALID)) | |
109 return true; | |
110 | |
111 if (error == ERR_CERT_DATE_INVALID && | |
112 (load_flags & LOAD_IGNORE_CERT_DATE_INVALID)) | |
113 return true; | |
114 | |
115 if (error == ERR_CERT_AUTHORITY_INVALID && | |
116 (load_flags & LOAD_IGNORE_CERT_AUTHORITY_INVALID)) | |
117 return true; | |
118 | |
119 return false; | |
120 } | 105 } |
121 | 106 |
122 bool SSLClientSocket::set_was_npn_negotiated(bool negotiated) { | 107 bool SSLClientSocket::set_was_npn_negotiated(bool negotiated) { |
123 return was_npn_negotiated_ = negotiated; | 108 return was_npn_negotiated_ = negotiated; |
124 } | 109 } |
125 | 110 |
126 bool SSLClientSocket::was_spdy_negotiated() const { | 111 bool SSLClientSocket::was_spdy_negotiated() const { |
127 return was_spdy_negotiated_; | 112 return was_spdy_negotiated_; |
128 } | 113 } |
129 | 114 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 } else { | 283 } else { |
299 sample += 500; | 284 sample += 500; |
300 } | 285 } |
301 } else { | 286 } else { |
302 DCHECK_EQ(kExtensionALPN, negotiation_extension_); | 287 DCHECK_EQ(kExtensionALPN, negotiation_extension_); |
303 } | 288 } |
304 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSLProtocolNegotiation", sample); | 289 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSLProtocolNegotiation", sample); |
305 } | 290 } |
306 | 291 |
307 } // namespace net | 292 } // namespace net |
OLD | NEW |