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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 28 matching lines...) Expand all
39 fix_rate_leaky_bucket_.SetDrainingRate(feedback_receive_time, bitrate_); 39 fix_rate_leaky_bucket_.SetDrainingRate(feedback_receive_time, bitrate_);
40 paced_sender_.UpdateBandwidthEstimate(feedback_receive_time, bitrate_); 40 paced_sender_.UpdateBandwidthEstimate(feedback_receive_time, bitrate_);
41 } 41 }
42 // Silently ignore invalid messages in release mode. 42 // Silently ignore invalid messages in release mode.
43 } 43 }
44 44
45 void FixRateSender::OnIncomingAck( 45 void FixRateSender::OnIncomingAck(
46 QuicPacketSequenceNumber /*acked_sequence_number*/, 46 QuicPacketSequenceNumber /*acked_sequence_number*/,
47 QuicByteCount bytes_acked, 47 QuicByteCount bytes_acked,
48 QuicTime::Delta rtt) { 48 QuicTime::Delta rtt) {
49 // RTT can't be negative.
50 DCHECK_LE(0, rtt.ToMicroseconds());
51
52 data_in_flight_ -= bytes_acked;
53 if (rtt.IsInfinite()) {
54 return;
55 }
49 latest_rtt_ = rtt; 56 latest_rtt_ = rtt;
50 data_in_flight_ -= bytes_acked;
51 } 57 }
52 58
53 void FixRateSender::OnIncomingLoss(QuicTime /*ack_receive_time*/) { 59 void FixRateSender::OnIncomingLoss(QuicTime /*ack_receive_time*/) {
54 // Ignore losses for fix rate sender. 60 // Ignore losses for fix rate sender.
55 } 61 }
56 62
57 void FixRateSender::SentPacket(QuicTime sent_time, 63 void FixRateSender::SentPacket(QuicTime sent_time,
58 QuicPacketSequenceNumber /*sequence_number*/, 64 QuicPacketSequenceNumber /*sequence_number*/,
59 QuicByteCount bytes, 65 QuicByteCount bytes,
60 Retransmission is_retransmission) { 66 Retransmission is_retransmission) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 104
99 QuicBandwidth FixRateSender::BandwidthEstimate() { 105 QuicBandwidth FixRateSender::BandwidthEstimate() {
100 return bitrate_; 106 return bitrate_;
101 } 107 }
102 108
103 QuicTime::Delta FixRateSender::SmoothedRtt() { 109 QuicTime::Delta FixRateSender::SmoothedRtt() {
104 // TODO(satyamshekhar): Calculate and return smoothed rtt. 110 // TODO(satyamshekhar): Calculate and return smoothed rtt.
105 return latest_rtt_; 111 return latest_rtt_;
106 } 112 }
107 113
114 QuicTime::Delta FixRateSender::RetransmissionDelay() {
115 // TODO(pwestin): Calculate and return retransmission delay.
116 // Use 2 * the latest RTT for now.
117 return latest_rtt_.Add(latest_rtt_);
118 }
119
108 } // namespace net 120 } // namespace net
OLDNEW
« 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