| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 else if (!channel_id_service->IsSystemTimeValid()) | 169 else if (!channel_id_service->IsSystemTimeValid()) |
| 170 supported = CLIENT_BAD_SYSTEM_TIME; | 170 supported = CLIENT_BAD_SYSTEM_TIME; |
| 171 else | 171 else |
| 172 supported = CLIENT_ONLY; | 172 supported = CLIENT_ONLY; |
| 173 } | 173 } |
| 174 UMA_HISTOGRAM_ENUMERATION("DomainBoundCerts.Support", supported, | 174 UMA_HISTOGRAM_ENUMERATION("DomainBoundCerts.Support", supported, |
| 175 CHANNEL_ID_USAGE_MAX); | 175 CHANNEL_ID_USAGE_MAX); |
| 176 } | 176 } |
| 177 | 177 |
| 178 // static | 178 // static |
| 179 void SSLClientSocket::RecordConnectionTypeMetrics(int ssl_version) { | |
| 180 UpdateConnectionTypeHistograms(CONNECTION_SSL); | |
| 181 switch (ssl_version) { | |
| 182 case SSL_CONNECTION_VERSION_SSL2: | |
| 183 UpdateConnectionTypeHistograms(CONNECTION_SSL_SSL2); | |
| 184 break; | |
| 185 case SSL_CONNECTION_VERSION_SSL3: | |
| 186 UpdateConnectionTypeHistograms(CONNECTION_SSL_SSL3); | |
| 187 break; | |
| 188 case SSL_CONNECTION_VERSION_TLS1: | |
| 189 UpdateConnectionTypeHistograms(CONNECTION_SSL_TLS1); | |
| 190 break; | |
| 191 case SSL_CONNECTION_VERSION_TLS1_1: | |
| 192 UpdateConnectionTypeHistograms(CONNECTION_SSL_TLS1_1); | |
| 193 break; | |
| 194 case SSL_CONNECTION_VERSION_TLS1_2: | |
| 195 UpdateConnectionTypeHistograms(CONNECTION_SSL_TLS1_2); | |
| 196 break; | |
| 197 } | |
| 198 } | |
| 199 | |
| 200 // static | |
| 201 bool SSLClientSocket::IsChannelIDEnabled( | 179 bool SSLClientSocket::IsChannelIDEnabled( |
| 202 const SSLConfig& ssl_config, | 180 const SSLConfig& ssl_config, |
| 203 ChannelIDService* channel_id_service) { | 181 ChannelIDService* channel_id_service) { |
| 204 if (!ssl_config.channel_id_enabled) | 182 if (!ssl_config.channel_id_enabled) |
| 205 return false; | 183 return false; |
| 206 if (!channel_id_service) { | 184 if (!channel_id_service) { |
| 207 DVLOG(1) << "NULL channel_id_service_, not enabling channel ID."; | 185 DVLOG(1) << "NULL channel_id_service_, not enabling channel ID."; |
| 208 return false; | 186 return false; |
| 209 } | 187 } |
| 210 if (!crypto::ECPrivateKey::IsSupported()) { | 188 if (!crypto::ECPrivateKey::IsSupported()) { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 } else { | 261 } else { |
| 284 sample += 500; | 262 sample += 500; |
| 285 } | 263 } |
| 286 } else { | 264 } else { |
| 287 DCHECK_EQ(kExtensionALPN, negotiation_extension_); | 265 DCHECK_EQ(kExtensionALPN, negotiation_extension_); |
| 288 } | 266 } |
| 289 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSLProtocolNegotiation", sample); | 267 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSLProtocolNegotiation", sample); |
| 290 } | 268 } |
| 291 | 269 |
| 292 } // namespace net | 270 } // namespace net |
| OLD | NEW |