Index: net/quic/quic_sent_packet_manager.cc |
diff --git a/net/quic/quic_sent_packet_manager.cc b/net/quic/quic_sent_packet_manager.cc |
index 7a57ab39b632995602769a5eccffcca8f49ff00f..eaf66bd0fe94f396c79424ca28eb6b4a887c36b2 100644 |
--- a/net/quic/quic_sent_packet_manager.cc |
+++ b/net/quic/quic_sent_packet_manager.cc |
@@ -196,7 +196,7 @@ void QuicSentPacketManager::HandleAckForSentPackets( |
DVLOG(1) << ENDPOINT << "Got an ack for packet " << sequence_number; |
// If data is associated with the most recent transmission of this |
// packet, then inform the caller. |
- if (it->second.pending) { |
+ if (it->second.in_flight) { |
packets_acked_[sequence_number] = it->second; |
} |
it = MarkPacketHandled(it, delta_largest_observed); |
@@ -217,26 +217,24 @@ bool QuicSentPacketManager::HasRetransmittableFrames( |
void QuicSentPacketManager::RetransmitUnackedPackets( |
RetransmissionType retransmission_type) { |
- QuicUnackedPacketMap::const_iterator unacked_it = unacked_packets_.begin(); |
- while (unacked_it != unacked_packets_.end()) { |
- const RetransmittableFrames* frames = |
- unacked_it->second.retransmittable_frames; |
+ QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin(); |
+ while (it != unacked_packets_.end()) { |
+ const RetransmittableFrames* frames = it->second.retransmittable_frames; |
// TODO(ianswett): Consider adding a new retransmission type which removes |
// all these old packets from unacked and retransmits them as new sequence |
// numbers with no connection to the previous ones. |
if (frames != NULL && (retransmission_type == ALL_PACKETS || |
frames->encryption_level() == ENCRYPTION_INITIAL)) { |
- MarkForRetransmission(unacked_it->first, ALL_UNACKED_RETRANSMISSION); |
+ MarkForRetransmission(it->first, ALL_UNACKED_RETRANSMISSION); |
} |
- ++unacked_it; |
+ ++it; |
} |
} |
void QuicSentPacketManager::NeuterUnencryptedPackets() { |
QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin(); |
while (it != unacked_packets_.end()) { |
- const RetransmittableFrames* frames = |
- it->second.retransmittable_frames; |
+ const RetransmittableFrames* frames = it->second.retransmittable_frames; |
QuicPacketSequenceNumber sequence_number = it->first; |
++it; |
if (frames != NULL && frames->encryption_level() == ENCRYPTION_NONE) { |
@@ -245,7 +243,7 @@ void QuicSentPacketManager::NeuterUnencryptedPackets() { |
// they are not retransmitted or considered lost from a congestion control |
// perspective. |
pending_retransmissions_.erase(sequence_number); |
- unacked_packets_.SetNotPending(sequence_number); |
+ unacked_packets_.RemoveFromInFlight(sequence_number); |
// RemoveRetransmittibility is safe because only the newest sequence |
// number can have frames. |
unacked_packets_.RemoveRetransmittability(sequence_number); |
@@ -260,7 +258,7 @@ void QuicSentPacketManager::MarkForRetransmission( |
unacked_packets_.GetTransmissionInfo(sequence_number); |
LOG_IF(DFATAL, transmission_info.retransmittable_frames == NULL); |
if (transmission_type != TLP_RETRANSMISSION) { |
- unacked_packets_.SetNotPending(sequence_number); |
+ unacked_packets_.RemoveFromInFlight(sequence_number); |
} |
// TODO(ianswett): Currently the RTO can fire while there are pending NACK |
// retransmissions for the same data, which is not ideal. |
@@ -363,9 +361,9 @@ QuicUnackedPacketMap::const_iterator QuicSentPacketManager::MarkPacketHandled( |
// only handle NULL encrypted packets in a special way. |
if (HasCryptoHandshake( |
unacked_packets_.GetTransmissionInfo(newest_transmission))) { |
- unacked_packets_.SetNotPending(newest_transmission); |
+ unacked_packets_.RemoveFromInFlight(newest_transmission); |
} |
- unacked_packets_.SetNotPending(sequence_number); |
+ unacked_packets_.RemoveFromInFlight(sequence_number); |
unacked_packets_.RemoveRetransmittability(sequence_number); |
QuicUnackedPacketMap::const_iterator next_unacked = unacked_packets_.begin(); |
@@ -412,21 +410,21 @@ bool QuicSentPacketManager::OnPacketSent( |
rtt_stats_.SampleNewRecentMinRtt(kNumMinRttSamplesAfterQuiescence); |
} |
- // Only track packets as pending that the send algorithm wants us to track. |
- const bool pending = |
+ // Only track packets as in flight that the send algorithm wants us to track. |
+ const bool in_flight = |
send_algorithm_->OnPacketSent(sent_time, |
unacked_packets_.bytes_in_flight(), |
sequence_number, |
bytes, |
has_retransmittable_data); |
- unacked_packets_.SetSent(sequence_number, sent_time, bytes, pending); |
+ unacked_packets_.SetSent(sequence_number, sent_time, bytes, in_flight); |
// Reset the retransmission timer anytime a pending packet is sent. |
- return pending; |
+ return in_flight; |
} |
void QuicSentPacketManager::OnRetransmissionTimeout() { |
- DCHECK(unacked_packets_.HasPendingPackets()); |
+ DCHECK(unacked_packets_.HasInFlightPackets()); |
// Handshake retransmission, timer based loss detection, TLP, and RTO are |
// implemented with a single alarm. The handshake alarm is set when the |
// handshake has not completed, the loss alarm is set when the loss detection |
@@ -468,8 +466,8 @@ void QuicSentPacketManager::RetransmitCryptoPackets() { |
it != unacked_packets_.end(); ++it) { |
QuicPacketSequenceNumber sequence_number = it->first; |
const RetransmittableFrames* frames = it->second.retransmittable_frames; |
- // Only retransmit frames which are pending, and therefore have been sent. |
- if (!it->second.pending || frames == NULL || |
+ // Only retransmit frames which are in flight, and therefore have been sent. |
+ if (!it->second.in_flight || frames == NULL || |
frames->HasCryptoHandshake() != IS_HANDSHAKE) { |
continue; |
} |
@@ -486,8 +484,8 @@ void QuicSentPacketManager::RetransmitOldestPacket() { |
it != unacked_packets_.end(); ++it) { |
QuicPacketSequenceNumber sequence_number = it->first; |
const RetransmittableFrames* frames = it->second.retransmittable_frames; |
- // Only retransmit frames which are pending, and therefore have been sent. |
- if (!it->second.pending || frames == NULL) { |
+ // Only retransmit frames which are in flight, and therefore have been sent. |
+ if (!it->second.in_flight || frames == NULL) { |
continue; |
} |
DCHECK_NE(IS_HANDSHAKE, frames->HasCryptoHandshake()); |
@@ -512,15 +510,14 @@ void QuicSentPacketManager::RetransmitAllPackets() { |
bool packets_retransmitted = false; |
QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin(); |
while (it != unacked_packets_.end()) { |
- const RetransmittableFrames* frames = |
- it->second.retransmittable_frames; |
+ const RetransmittableFrames* frames = it->second.retransmittable_frames; |
QuicPacketSequenceNumber sequence_number = it->first; |
++it; |
if (frames != NULL) { |
packets_retransmitted = true; |
MarkForRetransmission(sequence_number, RTO_RETRANSMISSION); |
} else { |
- unacked_packets_.SetNotPending(sequence_number); |
+ unacked_packets_.RemoveFromInFlight(sequence_number); |
} |
} |
@@ -532,7 +529,7 @@ void QuicSentPacketManager::RetransmitAllPackets() { |
QuicSentPacketManager::RetransmissionTimeoutMode |
QuicSentPacketManager::GetRetransmissionMode() const { |
- DCHECK(unacked_packets_.HasPendingPackets()); |
+ DCHECK(unacked_packets_.HasInFlightPackets()); |
if (unacked_packets_.HasPendingCryptoPackets()) { |
return HANDSHAKE_MODE; |
} |
@@ -579,7 +576,7 @@ void QuicSentPacketManager::InvokeLossDetection(QuicTime time) { |
// unacked_packets_. This is either the current transmission of |
// a packet whose previous transmission has been acked, a packet that has |
// been TLP retransmitted, or an FEC packet. |
- unacked_packets_.SetNotPending(sequence_number); |
+ unacked_packets_.RemoveFromInFlight(sequence_number); |
} |
} |
} |
@@ -636,8 +633,8 @@ const QuicTime::Delta QuicSentPacketManager::DelayedAckTime() const { |
} |
const QuicTime QuicSentPacketManager::GetRetransmissionTime() const { |
- // Don't set the timer if there are no pending packets. |
- if (!unacked_packets_.HasPendingPackets()) { |
+ // Don't set the timer if there are no packets in flight. |
+ if (!unacked_packets_.HasInFlightPackets()) { |
return QuicTime::Zero(); |
} |
switch (GetRetransmissionMode()) { |
@@ -655,9 +652,9 @@ const QuicTime QuicSentPacketManager::GetRetransmissionTime() const { |
return QuicTime::Max(clock_->ApproximateNow(), tlp_time); |
} |
case RTO_MODE: { |
- // The RTO is based on the first pending packet. |
+ // The RTO is based on the first outstanding packet. |
const QuicTime sent_time = |
- unacked_packets_.GetFirstPendingPacketSentTime(); |
+ unacked_packets_.GetFirstInFlightPacketSentTime(); |
QuicTime rto_timeout = sent_time.Add(GetRetransmissionDelay()); |
// Always wait at least 1.5 * RTT from now. |
QuicTime min_timeout = clock_->ApproximateNow().Add( |
@@ -682,7 +679,7 @@ const QuicTime::Delta QuicSentPacketManager::GetCryptoRetransmissionDelay() |
const QuicTime::Delta QuicSentPacketManager::GetTailLossProbeDelay() const { |
QuicTime::Delta srtt = rtt_stats_.SmoothedRtt(); |
- if (!unacked_packets_.HasMultiplePendingPackets()) { |
+ if (!unacked_packets_.HasMultipleInFlightPackets()) { |
return QuicTime::Delta::Max( |
srtt.Multiply(1.5).Add(DelayedAckTime()), srtt.Multiply(2)); |
} |