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

Unified Diff: net/quic/quic_sent_entropy_manager.cc

Issue 1331053003: Landing Recent QUIC changes until 8/28/2015 18:03 UTC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0909_1
Patch Set: use iterator for begin and end methods of PacketNumberQueue 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
« no previous file with comments | « net/quic/quic_sent_entropy_manager.h ('k') | net/quic/quic_sent_entropy_manager_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « net/quic/quic_sent_entropy_manager.h ('k') | net/quic/quic_sent_entropy_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698