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

Unified Diff: net/quic/congestion_control/fix_rate_sender.cc

Issue 20227003: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Land Recent QUIC changes Created 7 years, 5 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/congestion_control/fix_rate_sender.h ('k') | net/quic/congestion_control/inter_arrival_sender.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/fix_rate_sender.cc
diff --git a/net/quic/congestion_control/fix_rate_sender.cc b/net/quic/congestion_control/fix_rate_sender.cc
index 5398cc6234d7fa25cfb28a2f94758dd4760a58f4..cd0923d8513172eb242e47e345e8e98473302e71 100644
--- a/net/quic/congestion_control/fix_rate_sender.cc
+++ b/net/quic/congestion_control/fix_rate_sender.cc
@@ -46,8 +46,14 @@ void FixRateSender::OnIncomingAck(
QuicPacketSequenceNumber /*acked_sequence_number*/,
QuicByteCount bytes_acked,
QuicTime::Delta rtt) {
- latest_rtt_ = rtt;
+ // RTT can't be negative.
+ DCHECK_LE(0, rtt.ToMicroseconds());
+
data_in_flight_ -= bytes_acked;
+ if (rtt.IsInfinite()) {
+ return;
+ }
+ latest_rtt_ = rtt;
}
void FixRateSender::OnIncomingLoss(QuicTime /*ack_receive_time*/) {
@@ -105,4 +111,10 @@ QuicTime::Delta FixRateSender::SmoothedRtt() {
return latest_rtt_;
}
+QuicTime::Delta FixRateSender::RetransmissionDelay() {
+ // TODO(pwestin): Calculate and return retransmission delay.
+ // Use 2 * the latest RTT for now.
+ return latest_rtt_.Add(latest_rtt_);
+}
+
} // namespace net
« no previous file with comments | « net/quic/congestion_control/fix_rate_sender.h ('k') | net/quic/congestion_control/inter_arrival_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698