Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1367)

Unified Diff: net/socket/ssl_client_socket_impl.cc

Issue 2243453002: Replace SSLProtocolNegotiation histogram with SSLNegotiatedAlpnProtocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/socket/ssl_client_socket_impl.cc
diff --git a/net/socket/ssl_client_socket_impl.cc b/net/socket/ssl_client_socket_impl.cc
index 6252539a3d0044a929ad0de20c9c1b8e19e26858..183bcb4d0d5135b5cba5f6dbe4812c4ff1808d82 100644
--- a/net/socket/ssl_client_socket_impl.cc
+++ b/net/socket/ssl_client_socket_impl.cc
@@ -1222,7 +1222,7 @@ int SSLClientSocketImpl::DoHandshakeComplete(int result) {
}
}
- RecordNegotiationExtension();
+ RecordNegotiatedProtocol();
RecordChannelIDSupport();
const uint8_t* ocsp_response_raw;
@@ -2342,26 +2342,31 @@ void SSLClientSocketImpl::LogConnectEndEvent(int rv) {
base::Bind(&NetLogSSLInfoCallback, base::Unretained(this)));
}
-void SSLClientSocketImpl::RecordNegotiationExtension() const {
- if (negotiation_extension_ == kExtensionUnknown)
- return;
- if (npn_status_ == kNextProtoUnsupported)
- return;
- base::HistogramBase::Sample sample =
- static_cast<base::HistogramBase::Sample>(negotiated_protocol_);
- // In addition to the protocol negotiated, we want to record which TLS
- // extension was used, and in case of NPN, whether there was overlap between
- // server and client list of supported protocols.
- if (negotiation_extension_ == kExtensionNPN) {
- if (npn_status_ == kNextProtoNoOverlap) {
- sample += 1000;
- } else {
- sample += 500;
- }
- } else {
- DCHECK_EQ(kExtensionALPN, negotiation_extension_);
+void SSLClientSocketImpl::RecordNegotiatedProtocol() const {
+ // Keep this enum in sync with Net.AlpnNegotiatedProtocol histogram.
+ // Do not change or re-use values.
+ enum {
+ ALPN_NOT_USED = 0,
+ ALPN_HTTP11_NEGOTIATED = 1,
+ ALPN_HTTP2_NEGOTIATED = 2,
+ ALPN_MAX
+ } protocol = ALPN_NOT_USED;
+
+ switch (negotiated_protocol_) {
davidben 2016/08/17 19:44:11 Why not just log the kProtoFoo values?
Bence 2016/08/18 13:37:34 Two reasons: (1) I want to fix the values here, cl
davidben 2016/08/25 18:10:41 The enum is small enough that I think it's fine to
Bence 2016/08/27 00:59:46 Done.
+ case kProtoUnknown:
+ protocol = ALPN_NOT_USED;
davidben 2016/08/17 19:44:11 [Note this will result in a larger histogram, but
davidben 2016/08/17 19:44:56 By the way, this assumes we don't allow unknown AL
Bence 2016/08/18 13:37:34 Acknowledged.
Bence 2016/08/18 13:37:34 I actually consider this an important feature: I w
davidben 2016/08/25 18:10:41 Sounds good.
+ break;
+ case kProtoHTTP11:
+ protocol = ALPN_HTTP11_NEGOTIATED;
+ break;
+ case kProtoHTTP2:
+ protocol = ALPN_HTTP2_NEGOTIATED;
+ break;
+ case kProtoQUIC1SPDY3:
+ NOTREACHED();
+ protocol = ALPN_NOT_USED;
}
- UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSLProtocolNegotiation", sample);
+ UMA_HISTOGRAM_ENUMERATION("Net.AlpnNegotiatedProtocol", protocol, ALPN_MAX);
davidben 2016/08/17 19:44:11 Nit: I think it'd be clearest if all the SSL histo
Bence 2016/08/18 13:37:34 Done.
}
void SSLClientSocketImpl::RecordChannelIDSupport() const {

Powered by Google App Engine
This is Rietveld 408576698