Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: net/quic/quic_unacked_packet_map.cc

Issue 556103002: Simplify QuicUnackedPacketMap's RemovePreviousTransmissions by always (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@discard_old_packets_74814618
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_unacked_packet_map.h ('k') | net/quic/quic_unacked_packet_map_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
}
« no previous file with comments | « net/quic/quic_unacked_packet_map.h ('k') | net/quic/quic_unacked_packet_map_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698