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

Side by Side Diff: net/quic/congestion_control/pacing_sender.cc

Issue 1811043002: Landing Recent QUIC changes until 2016-03-15 16:26 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add an export clause. Created 4 years, 9 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/pacing_sender.h" 5 #include "net/quic/congestion_control/pacing_sender.h"
6 6
7 using std::min; 7 using std::min;
8 8
9 namespace net { 9 namespace net {
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 void PacingSender::OnRetransmissionTimeout(bool packets_retransmitted) { 110 void PacingSender::OnRetransmissionTimeout(bool packets_retransmitted) {
111 sender_->OnRetransmissionTimeout(packets_retransmitted); 111 sender_->OnRetransmissionTimeout(packets_retransmitted);
112 } 112 }
113 113
114 void PacingSender::OnConnectionMigration() { 114 void PacingSender::OnConnectionMigration() {
115 sender_->OnConnectionMigration(); 115 sender_->OnConnectionMigration();
116 } 116 }
117 117
118 QuicTime::Delta PacingSender::TimeUntilSend( 118 QuicTime::Delta PacingSender::TimeUntilSend(
119 QuicTime now, 119 QuicTime now,
120 QuicByteCount bytes_in_flight, 120 QuicByteCount bytes_in_flight) const {
121 HasRetransmittableData has_retransmittable_data) const {
122 QuicTime::Delta time_until_send = 121 QuicTime::Delta time_until_send =
123 sender_->TimeUntilSend(now, bytes_in_flight, has_retransmittable_data); 122 sender_->TimeUntilSend(now, bytes_in_flight);
124 if (burst_tokens_ > 0 || bytes_in_flight == 0) { 123 if (burst_tokens_ > 0 || bytes_in_flight == 0) {
125 // Don't pace if we have burst tokens available or leaving quiescence. 124 // Don't pace if we have burst tokens available or leaving quiescence.
126 return time_until_send; 125 return time_until_send;
127 } 126 }
128 127
129 if (!time_until_send.IsZero()) { 128 if (!time_until_send.IsZero()) {
130 DCHECK(time_until_send.IsInfinite()); 129 DCHECK(time_until_send.IsInfinite());
131 // The underlying sender prevents sending. 130 // The underlying sender prevents sending.
132 return time_until_send; 131 return time_until_send;
133 } 132 }
134 133
135 if (has_retransmittable_data == NO_RETRANSMITTABLE_DATA) {
136 // Don't pace ACK packets, since they do not count against CWND and do not
137 // cause CWND to grow.
138 return QuicTime::Delta::Zero();
139 }
140
141 // If the next send time is within the alarm granularity, send immediately. 134 // If the next send time is within the alarm granularity, send immediately.
142 if (ideal_next_packet_send_time_ > now.Add(alarm_granularity_)) { 135 if (ideal_next_packet_send_time_ > now.Add(alarm_granularity_)) {
143 DVLOG(1) << "Delaying packet: " 136 DVLOG(1) << "Delaying packet: "
144 << ideal_next_packet_send_time_.Subtract(now).ToMicroseconds(); 137 << ideal_next_packet_send_time_.Subtract(now).ToMicroseconds();
145 was_last_send_delayed_ = true; 138 was_last_send_delayed_ = true;
146 return ideal_next_packet_send_time_.Subtract(now); 139 return ideal_next_packet_send_time_.Subtract(now);
147 } 140 }
148 141
149 DVLOG(1) << "Sending packet now"; 142 DVLOG(1) << "Sending packet now";
150 return QuicTime::Delta::Zero(); 143 return QuicTime::Delta::Zero();
(...skipping 25 matching lines...) Expand all
176 169
177 QuicByteCount PacingSender::GetSlowStartThreshold() const { 170 QuicByteCount PacingSender::GetSlowStartThreshold() const {
178 return sender_->GetSlowStartThreshold(); 171 return sender_->GetSlowStartThreshold();
179 } 172 }
180 173
181 CongestionControlType PacingSender::GetCongestionControlType() const { 174 CongestionControlType PacingSender::GetCongestionControlType() const {
182 return sender_->GetCongestionControlType(); 175 return sender_->GetCongestionControlType();
183 } 176 }
184 177
185 } // namespace net 178 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/pacing_sender.h ('k') | net/quic/congestion_control/pacing_sender_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698