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 // QUIC connections should not timeout while there are open streams, |
| 992 // since PING frames are sent to prevent timeouts. If, however, the |
| 993 // connection timed out with open streams then QUIC traffic has become |
| 994 // blackholed. Alternatively, if too many retransmission timeouts occur |
| 995 // then QUIC traffic has become blackholed. |
| 996 if (stream_factory_ && |
| 997 (error == QUIC_TOO_MANY_RTOS || (error == QUIC_NETWORK_IDLE_TIMEOUT && |
| 998 GetNumOpenOutgoingStreams() > 0))) { |
| 999 stream_factory_->OnBlackholeAfterHandshakeConfirmed(this); |
| 1000 } |
| 1001 } else { |
995 if (error == QUIC_PUBLIC_RESET) { | 1002 if (error == QUIC_PUBLIC_RESET) { |
996 RecordHandshakeFailureReason(HANDSHAKE_FAILURE_PUBLIC_RESET); | 1003 RecordHandshakeFailureReason(HANDSHAKE_FAILURE_PUBLIC_RESET); |
997 } else if (connection()->GetStats().packets_received == 0) { | 1004 } else if (connection()->GetStats().packets_received == 0) { |
998 RecordHandshakeFailureReason(HANDSHAKE_FAILURE_BLACK_HOLE); | 1005 RecordHandshakeFailureReason(HANDSHAKE_FAILURE_BLACK_HOLE); |
999 UMA_HISTOGRAM_SPARSE_SLOWLY( | 1006 UMA_HISTOGRAM_SPARSE_SLOWLY( |
1000 "Net.QuicSession.ConnectionClose.HandshakeFailureBlackHole.QuicError", | 1007 "Net.QuicSession.ConnectionClose.HandshakeFailureBlackHole.QuicError", |
1001 error); | 1008 error); |
1002 } else { | 1009 } else { |
1003 RecordHandshakeFailureReason(HANDSHAKE_FAILURE_UNKNOWN); | 1010 RecordHandshakeFailureReason(HANDSHAKE_FAILURE_UNKNOWN); |
1004 UMA_HISTOGRAM_SPARSE_SLOWLY( | 1011 UMA_HISTOGRAM_SPARSE_SLOWLY( |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1509 } | 1516 } |
1510 | 1517 |
1511 size_t QuicChromiumClientSession::EstimateMemoryUsage() const { | 1518 size_t QuicChromiumClientSession::EstimateMemoryUsage() const { |
1512 // TODO(xunjieli): Estimate |crypto_stream_|, QuicSpdySession's | 1519 // TODO(xunjieli): Estimate |crypto_stream_|, QuicSpdySession's |
1513 // QuicHeaderList, QuicSession's QuiCWriteBlockedList, open streams and | 1520 // QuicHeaderList, QuicSession's QuiCWriteBlockedList, open streams and |
1514 // unacked packet map. | 1521 // unacked packet map. |
1515 return base::trace_event::EstimateMemoryUsage(packet_readers_); | 1522 return base::trace_event::EstimateMemoryUsage(packet_readers_); |
1516 } | 1523 } |
1517 | 1524 |
1518 } // namespace net | 1525 } // namespace net |
OLD | NEW |