Index: net/quic/quic_unacked_packet_map.cc |
diff --git a/net/quic/quic_unacked_packet_map.cc b/net/quic/quic_unacked_packet_map.cc |
index 85074dfce46012056fbb193038c85b312fdd3682..2f971ee5c302331dd7d5ed36206b509d4d931d6f 100644 |
--- a/net/quic/quic_unacked_packet_map.cc |
+++ b/net/quic/quic_unacked_packet_map.cc |
@@ -107,8 +107,8 @@ void QuicUnackedPacketMap::OnRetransmittedPacket( |
transmission_info->all_transmissions)); |
} |
-void QuicUnackedPacketMap::ClearPreviousRetransmissions(size_t num_to_clear) { |
- while (!unacked_packets_.empty() && num_to_clear > 0) { |
+void QuicUnackedPacketMap::ClearAllPreviousRetransmissions() { |
+ while (!unacked_packets_.empty() && least_unacked_ < largest_observed_) { |
// If this packet is in flight, or has retransmittable data, then there is |
// no point in clearing out any further packets, because they would not |
// affect the high water mark. |
@@ -137,7 +137,6 @@ void QuicUnackedPacketMap::ClearPreviousRetransmissions(size_t num_to_clear) { |
} |
unacked_packets_.pop_front(); |
++least_unacked_; |
- --num_to_clear; |
} |
} |