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

Unified Diff: net/quic/quic_unacked_packet_map.cc

Issue 302783003: Rename QUIC's TransmissionInfo pending to in_flight and the associated (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_unacked_packet_map.h ('k') | net/quic/quic_unacked_packet_map_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_unacked_packet_map.cc
diff --git a/net/quic/quic_unacked_packet_map.cc b/net/quic/quic_unacked_packet_map.cc
index c84ab1109e9b7b9272b917263f6e8c9a46d86713..b230485a9288548893637ee9153fe8be1db89408 100644
--- a/net/quic/quic_unacked_packet_map.cc
+++ b/net/quic/quic_unacked_packet_map.cc
@@ -84,10 +84,10 @@ void QuicUnackedPacketMap::ClearPreviousRetransmissions(size_t num_to_clear) {
UnackedPacketMap::iterator it = unacked_packets_.begin();
while (it != unacked_packets_.end() && num_to_clear > 0) {
QuicPacketSequenceNumber sequence_number = it->first;
- // If this is a pending packet, or has retransmittable data, then there is
+ // If this packet is in flight, or has retransmittable data, then there is
// no point in clearing out any further packets, because they would not
// affect the high water mark.
- if (it->second.pending || it->second.retransmittable_frames != NULL) {
+ if (it->second.in_flight || it->second.retransmittable_frames != NULL) {
break;
}
@@ -143,7 +143,7 @@ void QuicUnackedPacketMap::RemoveRetransmittability(
continue;
}
MaybeRemoveRetransmittableFrames(transmission_info);
- if (*it <= largest_observed_ && !transmission_info->pending) {
+ if (*it <= largest_observed_ && !transmission_info->in_flight) {
unacked_packets_.erase(*it);
} else {
transmission_info->all_transmissions = new SequenceNumberSet();
@@ -184,9 +184,9 @@ void QuicUnackedPacketMap::IncreaseLargestObserved(
}
bool QuicUnackedPacketMap::IsPacketUseless(
- UnackedPacketMap::const_iterator it) {
+ UnackedPacketMap::const_iterator it) const {
return it->first <= largest_observed_ &&
- !it->second.pending &&
+ !it->second.in_flight &&
it->second.retransmittable_frames == NULL &&
it->second.all_transmissions->size() == 1;
}
@@ -196,18 +196,18 @@ bool QuicUnackedPacketMap::IsUnacked(
return ContainsKey(unacked_packets_, sequence_number);
}
-void QuicUnackedPacketMap::SetNotPending(
+void QuicUnackedPacketMap::RemoveFromInFlight(
QuicPacketSequenceNumber sequence_number) {
UnackedPacketMap::iterator it = unacked_packets_.find(sequence_number);
if (it == unacked_packets_.end()) {
- LOG(DFATAL) << "SetNotPending called for packet that is not unacked: "
+ LOG(DFATAL) << "RemoveFromFlight called for packet that is not unacked: "
<< sequence_number;
return;
}
- if (it->second.pending) {
+ if (it->second.in_flight) {
LOG_IF(DFATAL, bytes_in_flight_ < it->second.bytes_sent);
bytes_in_flight_ -= it->second.bytes_sent;
- it->second.pending = false;
+ it->second.in_flight = false;
}
if (IsPacketUseless(it)) {
delete it->second.all_transmissions;
@@ -219,7 +219,7 @@ bool QuicUnackedPacketMap::HasUnackedPackets() const {
return !unacked_packets_.empty();
}
-bool QuicUnackedPacketMap::HasPendingPackets() const {
+bool QuicUnackedPacketMap::HasInFlightPackets() const {
return bytes_in_flight_ > 0;
}
@@ -231,25 +231,24 @@ const TransmissionInfo& QuicUnackedPacketMap::GetTransmissionInfo(
QuicTime QuicUnackedPacketMap::GetLastPacketSentTime() const {
UnackedPacketMap::const_reverse_iterator it = unacked_packets_.rbegin();
while (it != unacked_packets_.rend()) {
- if (it->second.pending) {
+ if (it->second.in_flight) {
LOG_IF(DFATAL, it->second.sent_time == QuicTime::Zero())
- << "Sent time can never be zero for a pending packet.";
+ << "Sent time can never be zero for a packet in flight.";
return it->second.sent_time;
}
++it;
}
- LOG(DFATAL) << "Unable to find sent time. "
- << "This method is only intended when there are pending packets.";
+ LOG(DFATAL) << "GetLastPacketSentTime requires in flight packets.";
return QuicTime::Zero();
}
-QuicTime QuicUnackedPacketMap::GetFirstPendingPacketSentTime() const {
+QuicTime QuicUnackedPacketMap::GetFirstInFlightPacketSentTime() const {
UnackedPacketMap::const_iterator it = unacked_packets_.begin();
- while (it != unacked_packets_.end() && !it->second.pending) {
+ while (it != unacked_packets_.end() && !it->second.in_flight) {
++it;
}
if (it == unacked_packets_.end()) {
- LOG(DFATAL) << "No pending packets";
+ LOG(DFATAL) << "GetFirstInFlightPacketSentTime requires in flight packets.";
return QuicTime::Zero();
}
return it->second.sent_time;
@@ -259,14 +258,14 @@ size_t QuicUnackedPacketMap::GetNumUnackedPackets() const {
return unacked_packets_.size();
}
-bool QuicUnackedPacketMap::HasMultiplePendingPackets() const {
- size_t num_pending = 0;
+bool QuicUnackedPacketMap::HasMultipleInFlightPackets() const {
+ size_t num_in_flight = 0;
for (UnackedPacketMap::const_reverse_iterator it = unacked_packets_.rbegin();
it != unacked_packets_.rend(); ++it) {
- if (it->second.pending) {
- ++num_pending;
+ if (it->second.in_flight) {
+ ++num_in_flight;
}
- if (num_pending > 1) {
+ if (num_in_flight > 1) {
return true;
}
}
@@ -280,7 +279,7 @@ bool QuicUnackedPacketMap::HasPendingCryptoPackets() const {
bool QuicUnackedPacketMap::HasUnackedRetransmittableFrames() const {
for (UnackedPacketMap::const_reverse_iterator it =
unacked_packets_.rbegin(); it != unacked_packets_.rend(); ++it) {
- if (it->second.pending && it->second.retransmittable_frames) {
+ if (it->second.in_flight && it->second.retransmittable_frames) {
return true;
}
}
@@ -300,7 +299,7 @@ QuicUnackedPacketMap::GetLeastUnackedSentPacket() const {
void QuicUnackedPacketMap::SetSent(QuicPacketSequenceNumber sequence_number,
QuicTime sent_time,
QuicByteCount bytes_sent,
- bool set_pending) {
+ bool set_in_flight) {
DCHECK_LT(0u, sequence_number);
UnackedPacketMap::iterator it = unacked_packets_.find(sequence_number);
if (it == unacked_packets_.end()) {
@@ -308,14 +307,14 @@ void QuicUnackedPacketMap::SetSent(QuicPacketSequenceNumber sequence_number,
<< sequence_number;
return;
}
- DCHECK(!it->second.pending);
+ DCHECK(!it->second.in_flight);
largest_sent_packet_ = max(sequence_number, largest_sent_packet_);
it->second.sent_time = sent_time;
- if (set_pending) {
+ if (set_in_flight) {
bytes_in_flight_ += bytes_sent;
it->second.bytes_sent = bytes_sent;
- it->second.pending = true;
+ it->second.in_flight = true;
}
}
« no previous file with comments | « net/quic/quic_unacked_packet_map.h ('k') | net/quic/quic_unacked_packet_map_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698