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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 QuicByteCount window_size_bytes = bitrate_.ToBytesPerPeriod( | 80 QuicByteCount window_size_bytes = bitrate_.ToBytesPerPeriod( |
81 QuicTime::Delta::FromMicroseconds(kWindowSizeUs)); | 81 QuicTime::Delta::FromMicroseconds(kWindowSizeUs)); |
82 // Make sure window size is not less than a packet. | 82 // Make sure window size is not less than a packet. |
83 return max(kDefaultMaxPacketSize, window_size_bytes); | 83 return max(kDefaultMaxPacketSize, window_size_bytes); |
84 } | 84 } |
85 | 85 |
86 QuicBandwidth FixRateSender::BandwidthEstimate() const { | 86 QuicBandwidth FixRateSender::BandwidthEstimate() const { |
87 return bitrate_; | 87 return bitrate_; |
88 } | 88 } |
89 | 89 |
| 90 bool FixRateSender::HasReliableBandwidthEstimate() const { |
| 91 return true; |
| 92 } |
90 | 93 |
91 QuicTime::Delta FixRateSender::RetransmissionDelay() const { | 94 QuicTime::Delta FixRateSender::RetransmissionDelay() const { |
92 // TODO(pwestin): Calculate and return retransmission delay. | 95 // TODO(pwestin): Calculate and return retransmission delay. |
93 // Use 2 * the latest RTT for now. | 96 // Use 2 * the latest RTT for now. |
94 return latest_rtt_.Add(latest_rtt_); | 97 return latest_rtt_.Add(latest_rtt_); |
95 } | 98 } |
96 | 99 |
97 QuicByteCount FixRateSender::GetCongestionWindow() const { | 100 QuicByteCount FixRateSender::GetCongestionWindow() const { |
98 return 0; | 101 return 0; |
99 } | 102 } |
100 | 103 |
101 } // namespace net | 104 } // namespace net |
OLD | NEW |