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

Unified Diff: net/quic/quic_unacked_packet_map.h

Issue 300683008: Land Recent QUIC Changes. (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_session_test.cc ('k') | net/quic/quic_unacked_packet_map.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.h
diff --git a/net/quic/quic_unacked_packet_map.h b/net/quic/quic_unacked_packet_map.h
index 610639c68d865488cedf94ceff8c24f73b0261cf..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,42 +99,35 @@ 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 any nnon-pending transmissions less than or
- // equal to |largest_observed|, and disconnects any other packets from other
- // transmissions.
- // TODO(ianswett): Remove largest_observed_ once the map tracks whether a
- // transmission is useful for RTT purposes internally.
- void RemoveRetransmittability(QuicPacketSequenceNumber sequence_number,
- QuicPacketSequenceNumber largest_observed_);
-
- // Removes an entry from the unacked packet map which is not pending, has
- // no retransmittable frames, and no associated transmissions.
- // TODO(ianswett): Remove or make this method private once the map tracks
- // the three reasons for tracking a packet correctly.
- void RemoveRttOnlyPacket(QuicPacketSequenceNumber sequence_number);
-
- // Returns true if the packet's only purpose is to measure RTT. It must not
- // be pending, have retransmittable frames, or be linked to transmissions
- // with retransmittable frames.
- static bool IsForRttOnly(const TransmissionInfo& transmission_info);
+ // transmission. It removes now useless transmissions, and disconnects any
+ // other packets from other transmissions.
+ void RemoveRetransmittability(QuicPacketSequenceNumber sequence_number);
+
+ // Increases the largest observed. Any packets less or equal to
+ // |largest_acked_packet| are discarded if they are only for the RTT purposes.
+ void IncreaseLargestObserved(QuicPacketSequenceNumber largest_observed);
private:
void MaybeRemoveRetransmittableFrames(TransmissionInfo* transmission_info);
+ // Returns true if the packet no longer has a purpose in the map.
+ bool IsPacketUseless(UnackedPacketMap::const_iterator it) const;
+
QuicPacketSequenceNumber largest_sent_packet_;
+ QuicPacketSequenceNumber largest_observed_;
// Newly serialized retransmittable and fec packets are added to this map,
// which contains owning pointers to any contained frames. If a packet is
@@ -146,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);
« no previous file with comments | « net/quic/quic_session_test.cc ('k') | net/quic/quic_unacked_packet_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698