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

Unified Diff: net/quic/quic_unacked_packet_map.cc

Issue 551223002: Discard old packets from the QuicSentPacketManager which are only (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_flaky_test_74798317
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 7276b139e91bc7f223c40504c98187819a2c93a4..85074dfce46012056fbb193038c85b312fdd3682 100644
--- a/net/quic/quic_unacked_packet_map.cc
+++ b/net/quic/quic_unacked_packet_map.cc
@@ -52,7 +52,7 @@ void QuicUnackedPacketMap::AddPacket(
void QuicUnackedPacketMap::RemoveObsoletePackets() {
while (!unacked_packets_.empty()) {
- if (!IsPacketUseless(least_unacked_, unacked_packets_.front())) {
+ if (!IsPacketRemovable(least_unacked_, unacked_packets_.front())) {
break;
}
delete unacked_packets_.front().all_transmissions;
@@ -207,6 +207,16 @@ bool QuicUnackedPacketMap::IsPacketUseless(
info.all_transmissions == NULL;
}
+bool QuicUnackedPacketMap::IsPacketRemovable(
+ QuicPacketSequenceNumber sequence_number,
+ const TransmissionInfo& info) const {
+ return (sequence_number <= largest_observed_ ||
+ unacked_packets_.size() > kMaxTcpCongestionWindow) &&
+ !info.in_flight &&
+ info.retransmittable_frames == NULL &&
+ info.all_transmissions == NULL;
+}
+
bool QuicUnackedPacketMap::IsUnacked(
QuicPacketSequenceNumber sequence_number) const {
if (sequence_number < least_unacked_ ||
« 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