Index: net/quic/quic_unacked_packet_map.h |
diff --git a/net/quic/quic_unacked_packet_map.h b/net/quic/quic_unacked_packet_map.h |
index ec3480a502b4d2e5e8f6816aa25db8069014647b..02634226e9d6926592abbc46a3497bc18f22b6b9 100644 |
--- a/net/quic/quic_unacked_packet_map.h |
+++ b/net/quic/quic_unacked_packet_map.h |
@@ -10,15 +10,16 @@ |
namespace net { |
-// Class which tracks unacked packets, including those packets which are |
-// currently pending, and the relationship between packets which |
-// contain the same data (via retransmissions) |
+// Class which tracks unacked packets for three purposes: |
+// 1) Track retransmittable data, including multiple transmissions of frames. |
+// 2) Track packets and bytes in flight for congestion control. |
+// 3) Track sent time of packets to provide RTT measurements from acks. |
class NET_EXPORT_PRIVATE QuicUnackedPacketMap { |
public: |
QuicUnackedPacketMap(); |
~QuicUnackedPacketMap(); |
- // Adds |serialized_packet| to the map. Does not mark it pending. |
+ // Adds |serialized_packet| to the map. Does not mark it in flight. |
void AddPacket(const SerializedPacket& serialized_packet); |
// Called when a packet is retransmitted with a new sequence number. |
@@ -35,8 +36,8 @@ class NET_EXPORT_PRIVATE QuicUnackedPacketMap { |
void NackPacket(QuicPacketSequenceNumber sequence_number, |
size_t min_nacks); |
- // Marks |sequence_number| as no longer pending. |
- void SetNotPending(QuicPacketSequenceNumber sequence_number); |
+ // Marks |sequence_number| as no longer in flight. |
+ void RemoveFromInFlight(QuicPacketSequenceNumber sequence_number); |
// Returns true if the unacked packet |sequence_number| has retransmittable |
// frames. This will return false if the packet has been acked, if a |
@@ -57,7 +58,7 @@ class NET_EXPORT_PRIVATE QuicUnackedPacketMap { |
return largest_sent_packet_; |
} |
- // Returns the sum of the bytes in all pending packets. |
+ // Returns the sum of bytes from all packets in flight. |
QuicByteCount bytes_in_flight() const { |
return bytes_in_flight_; |
} |
@@ -67,13 +68,13 @@ class NET_EXPORT_PRIVATE QuicUnackedPacketMap { |
QuicPacketSequenceNumber GetLeastUnackedSentPacket() const; |
// Sets a packet as sent with the sent time |sent_time|. Marks the packet |
- // as pending and tracks the |bytes_sent| if |set_pending| is true. |
- // Packets marked as pending are expected to be marked as missing when they |
+ // as in flight if |set_in_flight| is true. |
+ // Packets marked as in flight are expected to be marked as missing when they |
// don't arrive, indicating the need for retransmission. |
void SetSent(QuicPacketSequenceNumber sequence_number, |
QuicTime sent_time, |
QuicByteCount bytes_sent, |
- bool set_pending); |
+ bool set_in_flight); |
// Clears up to |num_to_clear| previous transmissions in order to make room |
// in the ack frame for new acks. |
@@ -87,8 +88,8 @@ class NET_EXPORT_PRIVATE QuicUnackedPacketMap { |
const_iterator begin() const { return unacked_packets_.begin(); } |
const_iterator end() const { return unacked_packets_.end(); } |
- // Returns true if there are unacked packets that are pending. |
- bool HasPendingPackets() const; |
+ // Returns true if there are unacked packets that are in flight. |
+ bool HasInFlightPackets() const; |
// Returns the TransmissionInfo associated with |sequence_number|, which |
// must be unacked. |
@@ -98,20 +99,19 @@ class NET_EXPORT_PRIVATE QuicUnackedPacketMap { |
// Returns the time that the last unacked packet was sent. |
QuicTime GetLastPacketSentTime() const; |
- // Returns the time that the first pending packet was sent. |
- QuicTime GetFirstPendingPacketSentTime() const; |
+ // Returns the time that the first in flight packet was sent. |
+ QuicTime GetFirstInFlightPacketSentTime() const; |
// Returns the number of unacked packets. |
size_t GetNumUnackedPackets() const; |
- // Returns true if there are multiple packet pending. |
- bool HasMultiplePendingPackets() const; |
+ // Returns true if there are multiple packets in flight. |
+ bool HasMultipleInFlightPackets() const; |
// Returns true if there are any pending crypto packets. |
bool HasPendingCryptoPackets() const; |
// Removes any retransmittable frames from this transmission or an associated |
- |
// transmission. It removes now useless transmissions, and disconnects any |
// other packets from other transmissions. |
void RemoveRetransmittability(QuicPacketSequenceNumber sequence_number); |
@@ -124,7 +124,7 @@ class NET_EXPORT_PRIVATE QuicUnackedPacketMap { |
void MaybeRemoveRetransmittableFrames(TransmissionInfo* transmission_info); |
// Returns true if the packet no longer has a purpose in the map. |
- bool IsPacketUseless(UnackedPacketMap::const_iterator it); |
+ bool IsPacketUseless(UnackedPacketMap::const_iterator it) const; |
QuicPacketSequenceNumber largest_sent_packet_; |
QuicPacketSequenceNumber largest_observed_; |
@@ -140,7 +140,7 @@ class NET_EXPORT_PRIVATE QuicUnackedPacketMap { |
UnackedPacketMap unacked_packets_; |
size_t bytes_in_flight_; |
- // Number of outstanding crypto handshake packets. |
+ // Number of retransmittable crypto handshake packets. |
size_t pending_crypto_packet_count_; |
DISALLOW_COPY_AND_ASSIGN(QuicUnackedPacketMap); |