Index: net/quic/congestion_control/pacing_sender.cc |
diff --git a/net/quic/congestion_control/pacing_sender.cc b/net/quic/congestion_control/pacing_sender.cc |
index 20d2b3b819a14f48b09b9ba80e32a3a62b950ffb..03e553477ced4ea1e0f08ae81e63e838d8bf3f0d 100644 |
--- a/net/quic/congestion_control/pacing_sender.cc |
+++ b/net/quic/congestion_control/pacing_sender.cc |
@@ -15,15 +15,12 @@ PacingSender::PacingSender(SendAlgorithmInterface* sender, |
burst_tokens_(initial_packet_burst), |
last_delayed_packet_sent_time_(QuicTime::Zero()), |
next_packet_send_time_(QuicTime::Zero()), |
- was_last_send_delayed_(false), |
- has_valid_rtt_(false) { |
+ was_last_send_delayed_(false) { |
} |
PacingSender::~PacingSender() {} |
void PacingSender::SetFromConfig(const QuicConfig& config, bool is_server) { |
- // TODO(ianswett): Consider using the suggested RTT for pacing an initial |
- // response. |
sender_->SetFromConfig(config, is_server); |
} |
@@ -42,9 +39,6 @@ void PacingSender::OnCongestionEvent(bool rtt_updated, |
QuicByteCount bytes_in_flight, |
const CongestionVector& acked_packets, |
const CongestionVector& lost_packets) { |
- if (rtt_updated) { |
- has_valid_rtt_ = true; |
- } |
sender_->OnCongestionEvent( |
rtt_updated, bytes_in_flight, acked_packets, lost_packets); |
} |
@@ -55,11 +49,10 @@ bool PacingSender::OnPacketSent( |
QuicPacketSequenceNumber sequence_number, |
QuicByteCount bytes, |
HasRetransmittableData has_retransmittable_data) { |
- // Only pace data packets once we have an updated RTT. |
const bool in_flight = |
sender_->OnPacketSent(sent_time, bytes_in_flight, sequence_number, |
bytes, has_retransmittable_data); |
- if (has_retransmittable_data != HAS_RETRANSMITTABLE_DATA || !has_valid_rtt_) { |
+ if (has_retransmittable_data != HAS_RETRANSMITTABLE_DATA) { |
return in_flight; |
} |
if (burst_tokens_ > 0) { |
@@ -117,10 +110,6 @@ QuicTime::Delta PacingSender::TimeUntilSend( |
HasRetransmittableData has_retransmittable_data) const { |
QuicTime::Delta time_until_send = |
sender_->TimeUntilSend(now, bytes_in_flight, has_retransmittable_data); |
- if (!has_valid_rtt_) { |
- // Don't pace if we don't have an updated RTT estimate. |
- return time_until_send; |
- } |
if (bytes_in_flight == 0) { |
// Add more burst tokens anytime the connection is entering quiescence. |
burst_tokens_ = initial_packet_burst_; |
@@ -143,6 +132,8 @@ QuicTime::Delta PacingSender::TimeUntilSend( |
} |
// If the next send time is within the alarm granularity, send immediately. |
+ // TODO(ianswett): This granularity logic ends up sending more packets than |
+ // intended in an effort to make up for lost time that wasn't lost. |
if (next_packet_send_time_ > now.Add(alarm_granularity_)) { |
DVLOG(1) << "Delaying packet: " |
<< next_packet_send_time_.Subtract(now).ToMicroseconds(); |