OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/congestion_control/fix_rate_sender.h" | 5 #include "net/quic/congestion_control/fix_rate_sender.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 void FixRateSender::UpdateRtt(QuicTime::Delta rtt_sample) { | 115 void FixRateSender::UpdateRtt(QuicTime::Delta rtt_sample) { |
116 // RTT can't be negative. | 116 // RTT can't be negative. |
117 DCHECK_LE(0, rtt_sample.ToMicroseconds()); | 117 DCHECK_LE(0, rtt_sample.ToMicroseconds()); |
118 if (rtt_sample.IsInfinite()) { | 118 if (rtt_sample.IsInfinite()) { |
119 return; | 119 return; |
120 } | 120 } |
121 latest_rtt_ = rtt_sample; | 121 latest_rtt_ = rtt_sample; |
122 } | 122 } |
123 | 123 |
124 QuicTime::Delta FixRateSender::SmoothedRtt() const { | |
125 // TODO(satyamshekhar): Calculate and return smoothed rtt. | |
126 return latest_rtt_; | |
127 } | |
128 | |
129 QuicTime::Delta FixRateSender::RetransmissionDelay() const { | 124 QuicTime::Delta FixRateSender::RetransmissionDelay() const { |
130 // TODO(pwestin): Calculate and return retransmission delay. | 125 // TODO(pwestin): Calculate and return retransmission delay. |
131 // Use 2 * the latest RTT for now. | 126 // Use 2 * the latest RTT for now. |
132 return latest_rtt_.Add(latest_rtt_); | 127 return latest_rtt_.Add(latest_rtt_); |
133 } | 128 } |
134 | 129 |
135 QuicByteCount FixRateSender::GetCongestionWindow() const { | 130 QuicByteCount FixRateSender::GetCongestionWindow() const { |
136 return 0; | 131 return 0; |
137 } | 132 } |
138 | 133 |
139 } // namespace net | 134 } // namespace net |
OLD | NEW |