| 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 6fd3c363ef0b82b6d8d66bfd29fea651c99b9cba..b3f86a83c8b9593cd37a9b0eac9fd99620a265e4 100644
|
| --- a/net/socket/ssl_client_socket_impl.cc
|
| +++ b/net/socket/ssl_client_socket_impl.cc
|
| @@ -945,8 +945,8 @@ int SSLClientSocketImpl::Init() {
|
| return ERR_UNEXPECTED;
|
| }
|
|
|
| - bssl::UniquePtr<SSL_SESSION> session =
|
| - context->session_cache()->Lookup(GetSessionCacheKey());
|
| + bssl::UniquePtr<SSL_SESSION> session = context->session_cache()->Lookup(
|
| + GetSessionCacheKey(), &ssl_session_cache_lookup_count_);
|
| if (session)
|
| SSL_set_session(ssl_.get(), session.get());
|
|
|
| @@ -1147,6 +1147,19 @@ int SSLClientSocketImpl::DoHandshakeComplete(int result) {
|
| if (result < 0)
|
| return result;
|
|
|
| + SSLContext::GetInstance()->session_cache()->ResetLookupCount(
|
| + GetSessionCacheKey());
|
| + // If we got a session from the session cache, log how many concurrent
|
| + // handshakes that session was used in before we finished our handshake. This
|
| + // is only recorded if the session from the cache was actually used, and only
|
| + // if the ALPN protocol is h2 (under the assumption that TLS 1.3 servers will
|
| + // be speaking h2). See https://crbug.com/631988.
|
| + if (ssl_session_cache_lookup_count_ && negotiated_protocol_ == kProtoHTTP2 &&
|
| + SSL_session_reused(ssl_.get())) {
|
| + UMA_HISTOGRAM_EXACT_LINEAR("Net.SSLSessionConcurrentLookupCount",
|
| + ssl_session_cache_lookup_count_, 20);
|
| + }
|
| +
|
| // DHE is offered on the deprecated cipher fallback and then rejected
|
| // afterwards. This is to aid in diagnosing connection failures because a
|
| // server requires DHE ciphers.
|
|
|