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_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
11 #include "base/metrics/sparse_histogram.h" | 11 #include "base/metrics/sparse_histogram.h" |
12 #include "base/profiler/scoped_tracker.h" | 12 #include "base/profiler/scoped_tracker.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "net/base/host_port_pair.h" | 14 #include "net/base/host_port_pair.h" |
15 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
16 #include "net/http/http_proxy_client_socket.h" | 16 #include "net/http/http_proxy_client_socket.h" |
17 #include "net/http/http_proxy_client_socket_pool.h" | 17 #include "net/http/http_proxy_client_socket_pool.h" |
18 #include "net/socket/client_socket_factory.h" | 18 #include "net/socket/client_socket_factory.h" |
19 #include "net/socket/client_socket_handle.h" | 19 #include "net/socket/client_socket_handle.h" |
20 #include "net/socket/socks_client_socket_pool.h" | 20 #include "net/socket/socks_client_socket_pool.h" |
21 #include "net/socket/ssl_client_socket.h" | 21 #include "net/socket/ssl_client_socket.h" |
22 #include "net/socket/transport_client_socket_pool.h" | 22 #include "net/socket/transport_client_socket_pool.h" |
23 #include "net/ssl/ssl_cert_request_info.h" | 23 #include "net/ssl/ssl_cert_request_info.h" |
24 #include "net/ssl/ssl_cipher_suite_names.h" | |
24 #include "net/ssl/ssl_connection_status_flags.h" | 25 #include "net/ssl/ssl_connection_status_flags.h" |
25 #include "net/ssl/ssl_info.h" | 26 #include "net/ssl/ssl_info.h" |
26 | 27 |
27 namespace net { | 28 namespace net { |
28 | 29 |
29 SSLSocketParams::SSLSocketParams( | 30 SSLSocketParams::SSLSocketParams( |
30 const scoped_refptr<TransportSocketParams>& direct_params, | 31 const scoped_refptr<TransportSocketParams>& direct_params, |
31 const scoped_refptr<SOCKSSocketParams>& socks_proxy_params, | 32 const scoped_refptr<SOCKSSocketParams>& socks_proxy_params, |
32 const scoped_refptr<HttpProxySocketParams>& http_proxy_params, | 33 const scoped_refptr<HttpProxySocketParams>& http_proxy_params, |
33 const HostPortPair& host_and_port, | 34 const HostPortPair& host_and_port, |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
364 100); | 365 100); |
365 | 366 |
366 SSLInfo ssl_info; | 367 SSLInfo ssl_info; |
367 bool has_ssl_info = ssl_socket_->GetSSLInfo(&ssl_info); | 368 bool has_ssl_info = ssl_socket_->GetSSLInfo(&ssl_info); |
368 DCHECK(has_ssl_info); | 369 DCHECK(has_ssl_info); |
369 | 370 |
370 UMA_HISTOGRAM_ENUMERATION("Net.SSLVersion", SSLConnectionStatusToVersion( | 371 UMA_HISTOGRAM_ENUMERATION("Net.SSLVersion", SSLConnectionStatusToVersion( |
371 ssl_info.connection_status), | 372 ssl_info.connection_status), |
372 SSL_CONNECTION_VERSION_MAX); | 373 SSL_CONNECTION_VERSION_MAX); |
373 | 374 |
374 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_CipherSuite", | 375 uint16 cipher_suite = |
375 SSLConnectionStatusToCipherSuite( | 376 SSLConnectionStatusToCipherSuite(ssl_info.connection_status); |
376 ssl_info.connection_status)); | 377 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_CipherSuite", cipher_suite); |
378 | |
379 const char *str, *cipher_str, *mac_str; | |
380 bool is_aead; | |
381 SSLCipherSuiteToStrings(&str, &cipher_str, &mac_str, &is_aead, | |
382 cipher_suite); | |
383 // UMA_HISTOGRAM_... macros cache the Histogram instance and thus only work | |
agl
2015/08/26 17:28:02
What decision are we going to make with this data?
sigbjorn
2015/08/27 14:51:38
For now, as long as DH is still supported (for how
| |
384 // if the histogram name is constant, so don't generate it dynamically. | |
385 if (strncmp(str, "RSA", 3) == 0) { | |
386 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_KeyExchange.RSA", | |
387 ssl_info.key_exchange_info); | |
388 } else if (strncmp(str, "DHE", 3) == 0) { | |
389 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_KeyExchange.DHE", | |
390 ssl_info.key_exchange_info); | |
391 } else if (strncmp(str, "DH", 2) == 0) { | |
392 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_KeyExchange.DH", | |
393 ssl_info.key_exchange_info); | |
394 } else if (strncmp(str, "ECDHE", 5) == 0) { | |
395 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_KeyExchange.ECDHE", | |
396 ssl_info.key_exchange_info); | |
397 } else if (strncmp(str, "ECDH", 4) == 0) { | |
398 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_KeyExchange.ECDH", | |
399 ssl_info.key_exchange_info); | |
400 } else { | |
401 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_KeyExchange.Unknown", | |
402 ssl_info.key_exchange_info); | |
403 } | |
377 | 404 |
378 if (ssl_info.handshake_type == SSLInfo::HANDSHAKE_RESUME) { | 405 if (ssl_info.handshake_type == SSLInfo::HANDSHAKE_RESUME) { |
379 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Resume_Handshake", | 406 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Resume_Handshake", |
380 connect_duration, | 407 connect_duration, |
381 base::TimeDelta::FromMilliseconds(1), | 408 base::TimeDelta::FromMilliseconds(1), |
382 base::TimeDelta::FromMinutes(1), | 409 base::TimeDelta::FromMinutes(1), |
383 100); | 410 100); |
384 } else if (ssl_info.handshake_type == SSLInfo::HANDSHAKE_FULL) { | 411 } else if (ssl_info.handshake_type == SSLInfo::HANDSHAKE_FULL) { |
385 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Full_Handshake", | 412 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Full_Handshake", |
386 connect_duration, | 413 connect_duration, |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
661 if (base_.CloseOneIdleSocket()) | 688 if (base_.CloseOneIdleSocket()) |
662 return true; | 689 return true; |
663 return base_.CloseOneIdleConnectionInHigherLayeredPool(); | 690 return base_.CloseOneIdleConnectionInHigherLayeredPool(); |
664 } | 691 } |
665 | 692 |
666 void SSLClientSocketPool::OnSSLConfigChanged() { | 693 void SSLClientSocketPool::OnSSLConfigChanged() { |
667 FlushWithError(ERR_NETWORK_CHANGED); | 694 FlushWithError(ERR_NETWORK_CHANGED); |
668 } | 695 } |
669 | 696 |
670 } // namespace net | 697 } // namespace net |
OLD | NEW |