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

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

Issue 869393005: Perform ClientHello padding if the field trial is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@net_connection_error_uma
Patch Set: CR comment updates Created 5 years, 10 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') | net/ssl/ssl_config.h » ('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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 ssl_socket_->set_was_spdy_negotiated(true); 469 ssl_socket_->set_was_spdy_negotiated(true);
470 } 470 }
471 } 471 }
472 if (params_->want_spdy_over_npn() && !ssl_socket_->was_spdy_negotiated()) 472 if (params_->want_spdy_over_npn() && !ssl_socket_->was_spdy_negotiated())
473 return ERR_NPN_NEGOTIATION_FAILED; 473 return ERR_NPN_NEGOTIATION_FAILED;
474 474
475 // Spdy might be turned on by default, or it might be over npn. 475 // Spdy might be turned on by default, or it might be over npn.
476 bool using_spdy = params_->force_spdy_over_ssl() || 476 bool using_spdy = params_->force_spdy_over_ssl() ||
477 params_->want_spdy_over_npn(); 477 params_->want_spdy_over_npn();
478 478
479 const std::string& host = params_->host_and_port().host();
480 bool is_google =
481 host == "google.com" ||
482 (host.size() > 11 && host.rfind(".google.com") == host.size() - 11);
Alexei Svitkine (slow) 2015/02/06 22:44:01 Can this use google_util::IsGoogleHostname() too?
jeremyim 2015/02/06 22:47:22 Unfortunately, I believe that's a layering violati
Ryan Sleevi 2015/02/07 00:20:56 Correct. I mean, this is a layering violation as
jeremyim 2015/02/07 03:24:29 This change has been reverted. Back to using 2 boo
479 if (result == OK || 483 if (result == OK ||
480 ssl_socket_->IgnoreCertError(result, params_->load_flags())) { 484 ssl_socket_->IgnoreCertError(result, params_->load_flags())) {
481 DCHECK(!connect_timing_.ssl_start.is_null()); 485 DCHECK(!connect_timing_.ssl_start.is_null());
482 base::TimeDelta connect_duration = 486 base::TimeDelta connect_duration =
483 connect_timing_.ssl_end - connect_timing_.ssl_start; 487 connect_timing_.ssl_end - connect_timing_.ssl_start;
484 if (using_spdy) { 488 if (using_spdy) {
485 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SpdyConnectionLatency_2", 489 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SpdyConnectionLatency_2",
486 connect_duration, 490 connect_duration,
487 base::TimeDelta::FromMilliseconds(1), 491 base::TimeDelta::FromMilliseconds(1),
488 base::TimeDelta::FromMinutes(1), 492 base::TimeDelta::FromMinutes(1),
(...skipping 25 matching lines...) Expand all
514 base::TimeDelta::FromMinutes(1), 518 base::TimeDelta::FromMinutes(1),
515 100); 519 100);
516 } else if (ssl_info.handshake_type == SSLInfo::HANDSHAKE_FULL) { 520 } else if (ssl_info.handshake_type == SSLInfo::HANDSHAKE_FULL) {
517 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Full_Handshake", 521 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Full_Handshake",
518 connect_duration, 522 connect_duration,
519 base::TimeDelta::FromMilliseconds(1), 523 base::TimeDelta::FromMilliseconds(1),
520 base::TimeDelta::FromMinutes(1), 524 base::TimeDelta::FromMinutes(1),
521 100); 525 100);
522 } 526 }
523 527
524 const std::string& host = params_->host_and_port().host();
525 bool is_google =
526 host == "google.com" ||
527 (host.size() > 11 && host.rfind(".google.com") == host.size() - 11);
528 if (is_google) { 528 if (is_google) {
529 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Google2", 529 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Google2",
530 connect_duration, 530 connect_duration,
531 base::TimeDelta::FromMilliseconds(1), 531 base::TimeDelta::FromMilliseconds(1),
532 base::TimeDelta::FromMinutes(1), 532 base::TimeDelta::FromMinutes(1),
533 100); 533 100);
534 if (ssl_info.handshake_type == SSLInfo::HANDSHAKE_RESUME) { 534 if (ssl_info.handshake_type == SSLInfo::HANDSHAKE_RESUME) {
535 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Google_" 535 UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Google_"
536 "Resume_Handshake", 536 "Resume_Handshake",
537 connect_duration, 537 connect_duration,
(...skipping 12 matching lines...) Expand all
550 } 550 }
551 551
552 if (result == OK || IsCertificateError(result)) { 552 if (result == OK || IsCertificateError(result)) {
553 SetSocket(ssl_socket_.Pass()); 553 SetSocket(ssl_socket_.Pass());
554 } else if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) { 554 } else if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED) {
555 error_response_info_.cert_request_info = new SSLCertRequestInfo; 555 error_response_info_.cert_request_info = new SSLCertRequestInfo;
556 ssl_socket_->GetSSLCertRequestInfo( 556 ssl_socket_->GetSSLCertRequestInfo(
557 error_response_info_.cert_request_info.get()); 557 error_response_info_.cert_request_info.get());
558 } 558 }
559 559
560 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_Connection_Error", std::abs(result));
561 if (is_google) {
562 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_Connection_Error_Google",
563 std::abs(result));
564 }
565
560 return result; 566 return result;
561 } 567 }
562 568
563 void SSLConnectJob::ResumeSSLConnection() { 569 void SSLConnectJob::ResumeSSLConnection() {
564 DCHECK_EQ(next_state_, STATE_SSL_CONNECT); 570 DCHECK_EQ(next_state_, STATE_SSL_CONNECT);
565 messenger_ = NULL; 571 messenger_ = NULL;
566 OnIOComplete(OK); 572 OnIOComplete(OK);
567 } 573 }
568 574
569 SSLConnectJob::State SSLConnectJob::GetInitialState( 575 SSLConnectJob::State SSLConnectJob::GetInitialState(
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 CHECK(it != messenger_map_.end()); 845 CHECK(it != messenger_map_.end());
840 delete it->second; 846 delete it->second;
841 messenger_map_.erase(it); 847 messenger_map_.erase(it);
842 } 848 }
843 849
844 void SSLClientSocketPool::OnSSLConfigChanged() { 850 void SSLClientSocketPool::OnSSLConfigChanged() {
845 FlushWithError(ERR_NETWORK_CHANGED); 851 FlushWithError(ERR_NETWORK_CHANGED);
846 } 852 }
847 853
848 } // namespace net 854 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_openssl.cc ('k') | net/ssl/ssl_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698