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

Unified Diff: net/quic/quic_unacked_packet_map.h

Issue 515303003: Landing Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix for 409191 Created 6 years, 3 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_sent_packet_manager_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 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.
« no previous file with comments | « net/quic/quic_sent_packet_manager_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