Index: net/quic/quic_sent_entropy_manager.cc |
diff --git a/net/quic/quic_sent_entropy_manager.cc b/net/quic/quic_sent_entropy_manager.cc |
index 0f33e2d56e9b26c43a3339e3ee5759d998a53a32..9472a880a52e19e8919d5760d99e292f0ea6b79d 100644 |
--- a/net/quic/quic_sent_entropy_manager.cc |
+++ b/net/quic/quic_sent_entropy_manager.cc |
@@ -21,8 +21,12 @@ QuicSentEntropyManager::~QuicSentEntropyManager() {} |
void QuicSentEntropyManager::RecordPacketEntropyHash( |
QuicPacketSequenceNumber sequence_number, |
QuicPacketEntropyHash entropy_hash) { |
- // TODO(satyamshekhar): Check this logic again when/if we enable packet |
- // reordering. |
+ if (!packets_entropy_.empty()) { |
+ // Ensure packets always are recorded in order. |
+ // Every packet's entropy is recorded, even if it's not sent, so there |
+ // are not sequence number gaps. |
+ DCHECK_LT(packets_entropy_.back().first, sequence_number); |
+ } |
packets_entropy_hash_ ^= entropy_hash; |
packets_entropy_.insert( |
make_pair(sequence_number, |