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

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

Issue 131743009: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use size_t instead of int to fix win_x64 compile error Created 6 years, 11 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
Index: net/quic/congestion_control/inter_arrival_sender.cc
diff --git a/net/quic/congestion_control/inter_arrival_sender.cc b/net/quic/congestion_control/inter_arrival_sender.cc
index 1b86b639501e7d9014af7e879565e7d337564640..b0698ac80a94889f0e385804a95d5c56e637490e 100644
--- a/net/quic/congestion_control/inter_arrival_sender.cc
+++ b/net/quic/congestion_control/inter_arrival_sender.cc
@@ -216,27 +216,10 @@ bool InterArrivalSender::ProbingPhase(QuicTime feedback_receive_time) {
void InterArrivalSender::OnPacketAcked(
QuicPacketSequenceNumber /*acked_sequence_number*/,
- QuicByteCount acked_bytes,
- QuicTime::Delta rtt) {
- // RTT can't be negative.
- DCHECK_LE(0, rtt.ToMicroseconds());
-
+ QuicByteCount acked_bytes) {
if (probing_) {
probe_->OnAcknowledgedPacket(acked_bytes);
}
-
- if (rtt.IsInfinite()) {
- return;
- }
-
- if (smoothed_rtt_.IsZero()) {
- smoothed_rtt_ = rtt;
- } else {
- smoothed_rtt_ = QuicTime::Delta::FromMicroseconds(
- kOneMinusAlpha * smoothed_rtt_.ToMicroseconds() +
- kAlpha * rtt.ToMicroseconds());
- }
- state_machine_->set_rtt(smoothed_rtt_);
}
void InterArrivalSender::OnPacketLost(
@@ -337,6 +320,24 @@ QuicBandwidth InterArrivalSender::BandwidthEstimate() const {
return current_bandwidth_;
}
+void InterArrivalSender::UpdateRtt(QuicTime::Delta rtt) {
+ // RTT can't be negative.
+ DCHECK_LE(0, rtt.ToMicroseconds());
+
+ if (rtt.IsInfinite()) {
+ return;
+ }
+
+ if (smoothed_rtt_.IsZero()) {
+ smoothed_rtt_ = rtt;
+ } else {
+ smoothed_rtt_ = QuicTime::Delta::FromMicroseconds(
+ kOneMinusAlpha * smoothed_rtt_.ToMicroseconds() +
+ kAlpha * rtt.ToMicroseconds());
+ }
+ state_machine_->set_rtt(smoothed_rtt_);
+}
+
QuicTime::Delta InterArrivalSender::SmoothedRtt() const {
if (smoothed_rtt_.IsZero()) {
return QuicTime::Delta::FromMilliseconds(kInitialRttMs);
« no previous file with comments | « net/quic/congestion_control/inter_arrival_sender.h ('k') | net/quic/congestion_control/inter_arrival_sender_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698