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/chromium/quic_chromium_client_session.h" | 5 #include "net/quic/chromium/quic_chromium_client_session.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
955 histogram->AddCount(error, num_streams); | 955 histogram->AddCount(error, num_streams); |
956 } | 956 } |
957 UMA_HISTOGRAM_SPARSE_SLOWLY( | 957 UMA_HISTOGRAM_SPARSE_SLOWLY( |
958 "Net.QuicSession.ConnectionCloseErrorCodeClient", error); | 958 "Net.QuicSession.ConnectionCloseErrorCodeClient", error); |
959 } | 959 } |
960 | 960 |
961 if (error == QUIC_NETWORK_IDLE_TIMEOUT) { | 961 if (error == QUIC_NETWORK_IDLE_TIMEOUT) { |
962 UMA_HISTOGRAM_COUNTS( | 962 UMA_HISTOGRAM_COUNTS( |
963 "Net.QuicSession.ConnectionClose.NumOpenStreams.TimedOut", | 963 "Net.QuicSession.ConnectionClose.NumOpenStreams.TimedOut", |
964 GetNumOpenOutgoingStreams()); | 964 GetNumOpenOutgoingStreams()); |
965 // Notify the factory the connection timed out with open streams. | |
966 if (GetNumOpenOutgoingStreams() > 0 && stream_factory_) { | |
967 stream_factory_->OnTimeoutWithOpenStreams(); | |
968 } | |
969 if (IsCryptoHandshakeConfirmed()) { | 965 if (IsCryptoHandshakeConfirmed()) { |
970 if (GetNumOpenOutgoingStreams() > 0) { | 966 if (GetNumOpenOutgoingStreams() > 0) { |
971 UMA_HISTOGRAM_BOOLEAN( | 967 UMA_HISTOGRAM_BOOLEAN( |
972 "Net.QuicSession.TimedOutWithOpenStreams.HasUnackedPackets", | 968 "Net.QuicSession.TimedOutWithOpenStreams.HasUnackedPackets", |
973 connection()->sent_packet_manager().HasUnackedPackets()); | 969 connection()->sent_packet_manager().HasUnackedPackets()); |
974 UMA_HISTOGRAM_COUNTS( | 970 UMA_HISTOGRAM_COUNTS( |
975 "Net.QuicSession.TimedOutWithOpenStreams.ConsecutiveRTOCount", | 971 "Net.QuicSession.TimedOutWithOpenStreams.ConsecutiveRTOCount", |
976 connection()->sent_packet_manager().GetConsecutiveRtoCount()); | 972 connection()->sent_packet_manager().GetConsecutiveRtoCount()); |
977 UMA_HISTOGRAM_COUNTS( | 973 UMA_HISTOGRAM_COUNTS( |
978 "Net.QuicSession.TimedOutWithOpenStreams.ConsecutiveTLPCount", | 974 "Net.QuicSession.TimedOutWithOpenStreams.ConsecutiveTLPCount", |
979 connection()->sent_packet_manager().GetConsecutiveTlpCount()); | 975 connection()->sent_packet_manager().GetConsecutiveTlpCount()); |
980 UMA_HISTOGRAM_SPARSE_SLOWLY( | 976 UMA_HISTOGRAM_SPARSE_SLOWLY( |
981 "Net.QuicSession.TimedOutWithOpenStreams.LocalPort", | 977 "Net.QuicSession.TimedOutWithOpenStreams.LocalPort", |
982 connection()->self_address().port()); | 978 connection()->self_address().port()); |
983 } | 979 } |
984 } else { | 980 } else { |
985 UMA_HISTOGRAM_COUNTS( | 981 UMA_HISTOGRAM_COUNTS( |
986 "Net.QuicSession.ConnectionClose.NumOpenStreams.HandshakeTimedOut", | 982 "Net.QuicSession.ConnectionClose.NumOpenStreams.HandshakeTimedOut", |
987 GetNumOpenOutgoingStreams()); | 983 GetNumOpenOutgoingStreams()); |
988 UMA_HISTOGRAM_COUNTS( | 984 UMA_HISTOGRAM_COUNTS( |
989 "Net.QuicSession.ConnectionClose.NumTotalStreams.HandshakeTimedOut", | 985 "Net.QuicSession.ConnectionClose.NumTotalStreams.HandshakeTimedOut", |
990 num_total_streams_); | 986 num_total_streams_); |
991 } | 987 } |
992 } | 988 } |
993 | 989 |
994 if (!IsCryptoHandshakeConfirmed()) { | 990 if (IsCryptoHandshakeConfirmed()) { |
991 if (stream_factory_ && | |
992 (error == QUIC_TOO_MANY_RTOS || (error == QUIC_NETWORK_IDLE_TIMEOUT && | |
993 GetNumOpenOutgoingStreams() > 0))) { | |
994 stream_factory_->OnBlackholeAfterHandshakeConfirmed(this); | |
995 } | |
996 } else { | |
Jana
2017/04/07 21:59:29
Nice. I like the way you refactored code to get th
Ryan Hamilton
2017/04/07 22:37:20
Yay! Thanks. It took *way* too long for me to figu
| |
995 if (error == QUIC_PUBLIC_RESET) { | 997 if (error == QUIC_PUBLIC_RESET) { |
996 RecordHandshakeFailureReason(HANDSHAKE_FAILURE_PUBLIC_RESET); | 998 RecordHandshakeFailureReason(HANDSHAKE_FAILURE_PUBLIC_RESET); |
997 } else if (connection()->GetStats().packets_received == 0) { | 999 } else if (connection()->GetStats().packets_received == 0) { |
998 RecordHandshakeFailureReason(HANDSHAKE_FAILURE_BLACK_HOLE); | 1000 RecordHandshakeFailureReason(HANDSHAKE_FAILURE_BLACK_HOLE); |
999 UMA_HISTOGRAM_SPARSE_SLOWLY( | 1001 UMA_HISTOGRAM_SPARSE_SLOWLY( |
1000 "Net.QuicSession.ConnectionClose.HandshakeFailureBlackHole.QuicError", | 1002 "Net.QuicSession.ConnectionClose.HandshakeFailureBlackHole.QuicError", |
1001 error); | 1003 error); |
1002 } else { | 1004 } else { |
1003 RecordHandshakeFailureReason(HANDSHAKE_FAILURE_UNKNOWN); | 1005 RecordHandshakeFailureReason(HANDSHAKE_FAILURE_UNKNOWN); |
1004 UMA_HISTOGRAM_SPARSE_SLOWLY( | 1006 UMA_HISTOGRAM_SPARSE_SLOWLY( |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1509 } | 1511 } |
1510 | 1512 |
1511 size_t QuicChromiumClientSession::EstimateMemoryUsage() const { | 1513 size_t QuicChromiumClientSession::EstimateMemoryUsage() const { |
1512 // TODO(xunjieli): Estimate |crypto_stream_|, QuicSpdySession's | 1514 // TODO(xunjieli): Estimate |crypto_stream_|, QuicSpdySession's |
1513 // QuicHeaderList, QuicSession's QuiCWriteBlockedList, open streams and | 1515 // QuicHeaderList, QuicSession's QuiCWriteBlockedList, open streams and |
1514 // unacked packet map. | 1516 // unacked packet map. |
1515 return base::trace_event::EstimateMemoryUsage(packet_readers_); | 1517 return base::trace_event::EstimateMemoryUsage(packet_readers_); |
1516 } | 1518 } |
1517 | 1519 |
1518 } // namespace net | 1520 } // namespace net |
OLD | NEW |