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

Side by Side Diff: net/socket/ssl_client_socket_pool.cc

Issue 590513002: Add histogram to track NPN/ALPN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Shorten enum descriptions. Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « net/socket/ssl_client_socket_openssl.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.h" 10 #include "base/metrics/histogram.h"
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 445
446 int SSLConnectJob::DoSSLConnectComplete(int result) { 446 int SSLConnectJob::DoSSLConnectComplete(int result) {
447 connect_timing_.ssl_end = base::TimeTicks::Now(); 447 connect_timing_.ssl_end = base::TimeTicks::Now();
448 448
449 SSLClientSocket::NextProtoStatus status = 449 SSLClientSocket::NextProtoStatus status =
450 SSLClientSocket::kNextProtoUnsupported; 450 SSLClientSocket::kNextProtoUnsupported;
451 std::string proto; 451 std::string proto;
452 // GetNextProto will fail and and trigger a NOTREACHED if we pass in a socket 452 // GetNextProto will fail and and trigger a NOTREACHED if we pass in a socket
453 // that hasn't had SSL_ImportFD called on it. If we get a certificate error 453 // that hasn't had SSL_ImportFD called on it. If we get a certificate error
454 // here, then we know that we called SSL_ImportFD. 454 // here, then we know that we called SSL_ImportFD.
455 if (result == OK || IsCertificateError(result)) 455 if (result == OK || IsCertificateError(result)) {
456 status = ssl_socket_->GetNextProto(&proto); 456 status = ssl_socket_->GetNextProto(&proto);
457 ssl_socket_->RecordNegotiationExtension();
458 }
457 459
458 // If we want spdy over npn, make sure it succeeded. 460 // If we want spdy over npn, make sure it succeeded.
459 if (status == SSLClientSocket::kNextProtoNegotiated) { 461 if (status == SSLClientSocket::kNextProtoNegotiated) {
460 ssl_socket_->set_was_npn_negotiated(true); 462 ssl_socket_->set_was_npn_negotiated(true);
461 NextProto protocol_negotiated = 463 NextProto protocol_negotiated =
462 SSLClientSocket::NextProtoFromString(proto); 464 SSLClientSocket::NextProtoFromString(proto);
463 ssl_socket_->set_protocol_negotiated(protocol_negotiated); 465 ssl_socket_->set_protocol_negotiated(protocol_negotiated);
464 // If we negotiated a SPDY version, it must have been present in 466 // If we negotiated a SPDY version, it must have been present in
465 // SSLConfig::next_protos. 467 // SSLConfig::next_protos.
466 // TODO(mbelshe): Verify this. 468 // TODO(mbelshe): Verify this.
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 CHECK(it != messenger_map_.end()); 844 CHECK(it != messenger_map_.end());
843 delete it->second; 845 delete it->second;
844 messenger_map_.erase(it); 846 messenger_map_.erase(it);
845 } 847 }
846 848
847 void SSLClientSocketPool::OnSSLConfigChanged() { 849 void SSLClientSocketPool::OnSSLConfigChanged() {
848 FlushWithError(ERR_NETWORK_CHANGED); 850 FlushWithError(ERR_NETWORK_CHANGED);
849 } 851 }
850 852
851 } // namespace net 853 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_openssl.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698