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 3c367f6e670c61892f5c9fc6270bf8f7de24df44..293c7b6a16586adf715e9addec43ad505a45eafa 100644 |
--- a/net/quic/quic_unacked_packet_map.h |
+++ b/net/quic/quic_unacked_packet_map.h |
@@ -5,7 +5,8 @@ |
#ifndef NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ |
#define NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ |
-#include "net/base/linked_hash_map.h" |
+#include <deque> |
+ |
#include "net/quic/quic_protocol.h" |
namespace net { |
@@ -71,7 +72,7 @@ class NET_EXPORT_PRIVATE QuicUnackedPacketMap { |
// Returns the smallest sequence number of a serialized packet which has not |
// been acked by the peer. If there are no unacked packets, returns 0. |
- QuicPacketSequenceNumber GetLeastUnackedSentPacket() const; |
+ QuicPacketSequenceNumber GetLeastUnacked() const; |
// Sets a packet as sent with the sent time |sent_time|. Marks the packet |
// as in flight if |set_in_flight| is true. |
@@ -89,8 +90,7 @@ class NET_EXPORT_PRIVATE QuicUnackedPacketMap { |
// in the ack frame for new acks. |
void ClearPreviousRetransmissions(size_t num_to_clear); |
- typedef linked_hash_map<QuicPacketSequenceNumber, |
- TransmissionInfo> UnackedPacketMap; |
+ typedef std::deque<TransmissionInfo> UnackedPacketMap; |
typedef UnackedPacketMap::const_iterator const_iterator; |
@@ -112,7 +112,7 @@ class NET_EXPORT_PRIVATE QuicUnackedPacketMap { |
QuicTime GetFirstInFlightPacketSentTime() const; |
// Returns the number of unacked packets. |
- size_t GetNumUnackedPackets() const; |
+ size_t GetNumUnackedPacketsDebugOnly() const; |
// Returns true if there are multiple packets in flight. |
bool HasMultipleInFlightPackets() const; |
@@ -129,11 +129,16 @@ class NET_EXPORT_PRIVATE QuicUnackedPacketMap { |
// |largest_acked_packet| are discarded if they are only for the RTT purposes. |
void IncreaseLargestObserved(QuicPacketSequenceNumber largest_observed); |
+ // Remove any packets no longer needed for retransmission, congestion, or |
+ // RTT measurement purposes. |
+ void RemoveObsoletePackets(); |
+ |
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; |
+ bool IsPacketUseless(QuicPacketSequenceNumber sequence_number, |
+ const TransmissionInfo& info) const; |
QuicPacketSequenceNumber largest_sent_packet_; |
QuicPacketSequenceNumber largest_observed_; |
@@ -147,6 +152,8 @@ class NET_EXPORT_PRIVATE QuicUnackedPacketMap { |
// be removed from the map and the new entry's retransmittable frames will be |
// set to NULL. |
UnackedPacketMap unacked_packets_; |
+ // The packet at the 0th index of unacked_packets_. |
+ QuicPacketSequenceNumber least_unacked_; |
size_t bytes_in_flight_; |
// Number of retransmittable crypto handshake packets. |