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

Unified Diff: net/quic/quic_sent_packet_manager.cc

Issue 288333002: Minor cleanup to simplify QuicSentPacketManager's OnPacketSent and (Closed) Base URL: https://chromium.googlesource.com/chromium/src
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_sent_packet_manager.cc
diff --git a/net/quic/quic_sent_packet_manager.cc b/net/quic/quic_sent_packet_manager.cc
index 97214f3788edcb2a4b2b29d026bca6b6875687d3..ba581672f17d8ba1c745af3cb103f3276b618056 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -445,23 +445,16 @@ bool QuicSentPacketManager::OnPacketSent(
}
// Only track packets as pending that the send algorithm wants us to track.
- if (!send_algorithm_->OnPacketSent(sent_time,
- unacked_packets_.bytes_in_flight(),
- sequence_number,
- bytes,
- has_retransmittable_data)) {
- unacked_packets_.SetSent(sequence_number, sent_time, bytes, false);
- // Do not reset the retransmission timer, since the packet isn't tracked.
- return false;
- }
-
- const bool set_retransmission_timer = !unacked_packets_.HasPendingPackets();
-
- unacked_packets_.SetSent(sequence_number, sent_time, bytes, true);
-
- // Reset the retransmission timer anytime a packet is sent in tail loss probe
- // mode or before the crypto handshake has completed.
- return set_retransmission_timer || GetRetransmissionMode() != RTO_MODE;
+ const bool pending =
+ send_algorithm_->OnPacketSent(sent_time,
+ unacked_packets_.bytes_in_flight(),
+ sequence_number,
+ bytes,
+ has_retransmittable_data);
+ unacked_packets_.SetSent(sequence_number, sent_time, bytes, pending);
+
+ // Reset the retransmission timer anytime a pending packet is sent.
+ return pending;
}
void QuicSentPacketManager::OnRetransmissionTimeout() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698