| 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/quic/quic_client_session.h" | 5 #include "net/quic/quic_client_session.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/metrics/sparse_histogram.h" | 10 #include "base/metrics/sparse_histogram.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 socket_(socket.Pass()), | 177 socket_(socket.Pass()), |
| 178 transport_security_state_(transport_security_state), | 178 transport_security_state_(transport_security_state), |
| 179 server_info_(server_info.Pass()), | 179 server_info_(server_info.Pass()), |
| 180 num_total_streams_(0), | 180 num_total_streams_(0), |
| 181 task_runner_(task_runner), | 181 task_runner_(task_runner), |
| 182 net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_QUIC_SESSION)), | 182 net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_QUIC_SESSION)), |
| 183 packet_reader_(socket_.get(), this, net_log_), | 183 packet_reader_(socket_.get(), this, net_log_), |
| 184 dns_resolution_end_time_(dns_resolution_end_time), | 184 dns_resolution_end_time_(dns_resolution_end_time), |
| 185 logger_(new QuicConnectionLogger(this, connection_description, net_log_)), | 185 logger_(new QuicConnectionLogger(this, connection_description, net_log_)), |
| 186 going_away_(false), | 186 going_away_(false), |
| 187 disabled_reason_(QUIC_DISABLED_NOT), |
| 187 weak_factory_(this) { | 188 weak_factory_(this) { |
| 188 crypto_stream_.reset( | 189 crypto_stream_.reset( |
| 189 crypto_client_stream_factory | 190 crypto_client_stream_factory |
| 190 ? crypto_client_stream_factory->CreateQuicCryptoClientStream( | 191 ? crypto_client_stream_factory->CreateQuicCryptoClientStream( |
| 191 server_id, this, crypto_config) | 192 server_id, this, crypto_config) |
| 192 : new QuicCryptoClientStream( | 193 : new QuicCryptoClientStream( |
| 193 server_id, this, | 194 server_id, this, |
| 194 new ProofVerifyContextChromium(cert_verify_flags, net_log_), | 195 new ProofVerifyContextChromium(cert_verify_flags, net_log_), |
| 195 crypto_config)); | 196 crypto_config)); |
| 196 connection->set_debug_visitor(logger_.get()); | 197 connection->set_debug_visitor(logger_.get()); |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 UMA_HISTOGRAM_SPARSE_SLOWLY( | 670 UMA_HISTOGRAM_SPARSE_SLOWLY( |
| 670 "Net.QuicSession.ConnectionCloseErrorCodeClient", error); | 671 "Net.QuicSession.ConnectionCloseErrorCodeClient", error); |
| 671 } | 672 } |
| 672 | 673 |
| 673 if (error == QUIC_CONNECTION_TIMED_OUT) { | 674 if (error == QUIC_CONNECTION_TIMED_OUT) { |
| 674 UMA_HISTOGRAM_COUNTS( | 675 UMA_HISTOGRAM_COUNTS( |
| 675 "Net.QuicSession.ConnectionClose.NumOpenStreams.TimedOut", | 676 "Net.QuicSession.ConnectionClose.NumOpenStreams.TimedOut", |
| 676 GetNumOpenStreams()); | 677 GetNumOpenStreams()); |
| 677 if (IsCryptoHandshakeConfirmed()) { | 678 if (IsCryptoHandshakeConfirmed()) { |
| 678 if (GetNumOpenStreams() > 0) { | 679 if (GetNumOpenStreams() > 0) { |
| 680 disabled_reason_ = QUIC_DISABLED_TIMEOUT_WITH_OPEN_STREAMS; |
| 679 UMA_HISTOGRAM_BOOLEAN( | 681 UMA_HISTOGRAM_BOOLEAN( |
| 680 "Net.QuicSession.TimedOutWithOpenStreams.HasUnackedPackets", | 682 "Net.QuicSession.TimedOutWithOpenStreams.HasUnackedPackets", |
| 681 connection()->sent_packet_manager().HasUnackedPackets()); | 683 connection()->sent_packet_manager().HasUnackedPackets()); |
| 682 UMA_HISTOGRAM_COUNTS( | 684 UMA_HISTOGRAM_COUNTS( |
| 683 "Net.QuicSession.TimedOutWithOpenStreams.ConsecutiveRTOCount", | 685 "Net.QuicSession.TimedOutWithOpenStreams.ConsecutiveRTOCount", |
| 684 connection()->sent_packet_manager().consecutive_rto_count()); | 686 connection()->sent_packet_manager().consecutive_rto_count()); |
| 685 UMA_HISTOGRAM_COUNTS( | 687 UMA_HISTOGRAM_COUNTS( |
| 686 "Net.QuicSession.TimedOutWithOpenStreams.ConsecutiveTLPCount", | 688 "Net.QuicSession.TimedOutWithOpenStreams.ConsecutiveTLPCount", |
| 687 connection()->sent_packet_manager().consecutive_tlp_count()); | 689 connection()->sent_packet_manager().consecutive_tlp_count()); |
| 688 } | 690 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 715 RecordHandshakeFailureReason(HANDSHAKE_FAILURE_BLACK_HOLE); | 717 RecordHandshakeFailureReason(HANDSHAKE_FAILURE_BLACK_HOLE); |
| 716 UMA_HISTOGRAM_SPARSE_SLOWLY( | 718 UMA_HISTOGRAM_SPARSE_SLOWLY( |
| 717 "Net.QuicSession.ConnectionClose.HandshakeFailureBlackHole.QuicError", | 719 "Net.QuicSession.ConnectionClose.HandshakeFailureBlackHole.QuicError", |
| 718 error); | 720 error); |
| 719 } else { | 721 } else { |
| 720 RecordHandshakeFailureReason(HANDSHAKE_FAILURE_UNKNOWN); | 722 RecordHandshakeFailureReason(HANDSHAKE_FAILURE_UNKNOWN); |
| 721 UMA_HISTOGRAM_SPARSE_SLOWLY( | 723 UMA_HISTOGRAM_SPARSE_SLOWLY( |
| 722 "Net.QuicSession.ConnectionClose.HandshakeFailureUnknown.QuicError", | 724 "Net.QuicSession.ConnectionClose.HandshakeFailureUnknown.QuicError", |
| 723 error); | 725 error); |
| 724 } | 726 } |
| 727 } else if (error == QUIC_PUBLIC_RESET) { |
| 728 disabled_reason_ = QUIC_DISABLED_PUBLIC_RESET_POST_HANDSHAKE; |
| 725 } | 729 } |
| 726 | 730 |
| 727 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicSession.QuicVersion", | 731 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicSession.QuicVersion", |
| 728 connection()->version()); | 732 connection()->version()); |
| 729 NotifyFactoryOfSessionGoingAway(); | 733 NotifyFactoryOfSessionGoingAway(); |
| 730 if (!callback_.is_null()) { | 734 if (!callback_.is_null()) { |
| 731 base::ResetAndReturn(&callback_).Run(ERR_QUIC_PROTOCOL_ERROR); | 735 base::ResetAndReturn(&callback_).Run(ERR_QUIC_PROTOCOL_ERROR); |
| 732 } | 736 } |
| 733 socket_->Close(); | 737 socket_->Close(); |
| 734 QuicSession::OnConnectionClosed(error, from_peer); | 738 QuicSession::OnConnectionClosed(error, from_peer); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 return; | 934 return; |
| 931 | 935 |
| 932 // TODO(rch): re-enable this code once beta is cut. | 936 // TODO(rch): re-enable this code once beta is cut. |
| 933 // if (stream_factory_) | 937 // if (stream_factory_) |
| 934 // stream_factory_->OnSessionConnectTimeout(this); | 938 // stream_factory_->OnSessionConnectTimeout(this); |
| 935 // CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED); | 939 // CloseAllStreams(ERR_QUIC_HANDSHAKE_FAILED); |
| 936 // DCHECK_EQ(0u, GetNumOpenStreams()); | 940 // DCHECK_EQ(0u, GetNumOpenStreams()); |
| 937 } | 941 } |
| 938 | 942 |
| 939 } // namespace net | 943 } // namespace net |
| OLD | NEW |