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