OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_sent_packet_manager.h" | 5 #include "net/quic/quic_sent_packet_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/debug/dump_without_crashing.h" | |
10 #include "base/logging.h" | 9 #include "base/logging.h" |
11 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
12 #include "net/quic/congestion_control/pacing_sender.h" | 11 #include "net/quic/congestion_control/pacing_sender.h" |
13 #include "net/quic/crypto/crypto_protocol.h" | 12 #include "net/quic/crypto/crypto_protocol.h" |
14 #include "net/quic/proto/cached_network_parameters.pb.h" | 13 #include "net/quic/proto/cached_network_parameters.pb.h" |
15 #include "net/quic/quic_ack_notifier_manager.h" | 14 #include "net/quic/quic_ack_notifier_manager.h" |
16 #include "net/quic/quic_connection_stats.h" | 15 #include "net/quic/quic_connection_stats.h" |
17 #include "net/quic/quic_flags.h" | 16 #include "net/quic/quic_flags.h" |
18 #include "net/quic/quic_utils_chromium.h" | 17 #include "net/quic/quic_utils_chromium.h" |
19 | 18 |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 // Only retransmit frames which are in flight, and therefore have been sent. | 647 // Only retransmit frames which are in flight, and therefore have been sent. |
649 if (!it->in_flight || it->retransmittable_frames == nullptr) { | 648 if (!it->in_flight || it->retransmittable_frames == nullptr) { |
650 continue; | 649 continue; |
651 } | 650 } |
652 if (!handshake_confirmed_) { | 651 if (!handshake_confirmed_) { |
653 DCHECK_NE(IS_HANDSHAKE, it->retransmittable_frames->HasCryptoHandshake()); | 652 DCHECK_NE(IS_HANDSHAKE, it->retransmittable_frames->HasCryptoHandshake()); |
654 } | 653 } |
655 MarkForRetransmission(sequence_number, TLP_RETRANSMISSION); | 654 MarkForRetransmission(sequence_number, TLP_RETRANSMISSION); |
656 return true; | 655 return true; |
657 } | 656 } |
658 #if defined(NDEBUG) | |
659 base::debug::DumpWithoutCrashing(); | |
660 #else | |
661 DLOG(FATAL) | 657 DLOG(FATAL) |
662 << "No retransmittable packets, so RetransmitOldestPacket failed."; | 658 << "No retransmittable packets, so RetransmitOldestPacket failed."; |
663 #endif | |
664 return false; | 659 return false; |
665 } | 660 } |
666 | 661 |
667 void QuicSentPacketManager::RetransmitRtoPackets() { | 662 void QuicSentPacketManager::RetransmitRtoPackets() { |
668 LOG_IF(DFATAL, pending_timer_transmission_count_ > 0) | 663 LOG_IF(DFATAL, pending_timer_transmission_count_ > 0) |
669 << "Retransmissions already queued:" << pending_timer_transmission_count_; | 664 << "Retransmissions already queued:" << pending_timer_transmission_count_; |
670 // Mark two packets for retransmission. | 665 // Mark two packets for retransmission. |
671 QuicPacketSequenceNumber sequence_number = unacked_packets_.GetLeastUnacked(); | 666 QuicPacketSequenceNumber sequence_number = unacked_packets_.GetLeastUnacked(); |
672 for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin(); | 667 for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin(); |
673 it != unacked_packets_.end(); ++it, ++sequence_number) { | 668 it != unacked_packets_.end(); ++it, ++sequence_number) { |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as | 939 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as |
945 // the default granularity of the Linux kernel's FQ qdisc. | 940 // the default granularity of the Linux kernel's FQ qdisc. |
946 using_pacing_ = true; | 941 using_pacing_ = true; |
947 send_algorithm_.reset( | 942 send_algorithm_.reset( |
948 new PacingSender(send_algorithm_.release(), | 943 new PacingSender(send_algorithm_.release(), |
949 QuicTime::Delta::FromMilliseconds(1), | 944 QuicTime::Delta::FromMilliseconds(1), |
950 kInitialUnpacedBurst)); | 945 kInitialUnpacedBurst)); |
951 } | 946 } |
952 | 947 |
953 } // namespace net | 948 } // namespace net |
OLD | NEW |