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

Unified Diff: net/quic/quic_sent_entropy_manager.cc

Issue 1330973002: relnote: Refactor QuicAckFrame::missing_packets to support a change to a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Tidy_up_DLOG_messages_101773586
Patch Set: Created 5 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
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 5c64d26a744803d81eff502ccf7968c6a498b265..7c76c5d8d72f2703b032ad56736aa80f2cd61d20 100644
--- a/net/quic/quic_sent_entropy_manager.cc
+++ b/net/quic/quic_sent_entropy_manager.cc
@@ -64,15 +64,15 @@ QuicPacketEntropyHash QuicSentEntropyManager::GetCumulativeEntropy(
bool QuicSentEntropyManager::IsValidEntropy(
QuicPacketNumber largest_observed,
- const PacketNumberSet& missing_packets,
+ const PacketNumberQueue& missing_packets,
QuicPacketEntropyHash entropy_hash) {
DCHECK_GE(largest_observed, last_valid_entropy_.packet_number);
// Ensure the largest and smallest packet numbers are in range.
if (largest_observed > GetLargestPacketWithEntropy()) {
return false;
}
- if (!missing_packets.empty() &&
- *missing_packets.begin() < GetSmallestPacketWithEntropy()) {
+ if (!missing_packets.Empty() &&
+ missing_packets.Min() < GetSmallestPacketWithEntropy()) {
return false;
}
// First the entropy for largest_observed packet number should be updated.
@@ -80,9 +80,8 @@ bool QuicSentEntropyManager::IsValidEntropy(
// Now XOR out all the missing entropies.
QuicPacketEntropyHash expected_entropy_hash = last_valid_entropy_.entropy;
- for (PacketNumberSet::const_iterator it = missing_packets.begin();
- it != missing_packets.end(); ++it) {
- expected_entropy_hash ^= GetPacketEntropy(*it);
+ for (QuicPacketNumber packet : missing_packets) {
+ expected_entropy_hash ^= GetPacketEntropy(packet);
}
DLOG_IF(WARNING, entropy_hash != expected_entropy_hash)
<< "Invalid entropy hash: " << static_cast<int>(entropy_hash)

Powered by Google App Engine
This is Rietveld 408576698