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 "base/logging.h" | 9 #include "base/logging.h" |
10 #include "net/quic/quic_protocol.h" | 10 #include "net/quic/quic_protocol.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 void FixRateSender::OnIncomingLoss(QuicTime /*ack_receive_time*/) { | 54 void FixRateSender::OnIncomingLoss(QuicTime /*ack_receive_time*/) { |
55 // Ignore losses for fix rate sender. | 55 // Ignore losses for fix rate sender. |
56 } | 56 } |
57 | 57 |
58 void FixRateSender::SentPacket(QuicTime sent_time, | 58 void FixRateSender::SentPacket(QuicTime sent_time, |
59 QuicPacketSequenceNumber /*sequence_number*/, | 59 QuicPacketSequenceNumber /*sequence_number*/, |
60 QuicByteCount bytes, | 60 QuicByteCount bytes, |
61 Retransmission is_retransmission) { | 61 Retransmission is_retransmission) { |
62 fix_rate_leaky_bucket_.Add(sent_time, bytes); | 62 fix_rate_leaky_bucket_.Add(sent_time, bytes); |
63 paced_sender_.SentPacket(sent_time, bytes); | 63 paced_sender_.SentPacket(sent_time, bytes); |
64 if (!is_retransmission) { | 64 if (is_retransmission == NOT_RETRANSMISSION) { |
65 data_in_flight_ += bytes; | 65 data_in_flight_ += bytes; |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 void FixRateSender::AbandoningPacket( | 69 void FixRateSender::AbandoningPacket( |
70 QuicPacketSequenceNumber /*sequence_number*/, | 70 QuicPacketSequenceNumber /*sequence_number*/, |
71 QuicByteCount /*abandoned_bytes*/) { | 71 QuicByteCount /*abandoned_bytes*/) { |
72 } | 72 } |
73 | 73 |
74 QuicTime::Delta FixRateSender::TimeUntilSend( | 74 QuicTime::Delta FixRateSender::TimeUntilSend( |
(...skipping 25 matching lines...) Expand all Loading... |
100 QuicBandwidth FixRateSender::BandwidthEstimate() { | 100 QuicBandwidth FixRateSender::BandwidthEstimate() { |
101 return bitrate_; | 101 return bitrate_; |
102 } | 102 } |
103 | 103 |
104 QuicTime::Delta FixRateSender::SmoothedRtt() { | 104 QuicTime::Delta FixRateSender::SmoothedRtt() { |
105 // TODO(satyamshekhar): Calculate and return smoothed rtt. | 105 // TODO(satyamshekhar): Calculate and return smoothed rtt. |
106 return latest_rtt_; | 106 return latest_rtt_; |
107 } | 107 } |
108 | 108 |
109 } // namespace net | 109 } // namespace net |
OLD | NEW |