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

Unified Diff: net/quic/quic_sent_entropy_manager.cc

Issue 2192633002: Switch to PacketNumberQueue interval iteration and avoid allocations in new ACK frame generation. G… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@128431128
Patch Set: Rebase Created 4 years, 5 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_protocol_test.cc ('k') | no next file » | 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 7c76c5d8d72f2703b032ad56736aa80f2cd61d20..ca387b944563f5a3f360b00cdc7d305489ff4250 100644
--- a/net/quic/quic_sent_entropy_manager.cc
+++ b/net/quic/quic_sent_entropy_manager.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "net/base/linked_hash_map.h"
+#include "net/quic/quic_flags.h"
using std::make_pair;
using std::max;
@@ -80,8 +81,19 @@ bool QuicSentEntropyManager::IsValidEntropy(
// Now XOR out all the missing entropies.
QuicPacketEntropyHash expected_entropy_hash = last_valid_entropy_.entropy;
- for (QuicPacketNumber packet : missing_packets) {
- expected_entropy_hash ^= GetPacketEntropy(packet);
+ if (FLAGS_quic_use_packet_number_queue_intervals) {
+ for (auto itr = missing_packets.begin_intervals();
+ itr != missing_packets.end_intervals(); ++itr) {
+ const auto& interval = *itr;
+ for (QuicPacketNumber packet_number = interval.min();
+ packet_number < interval.max(); ++packet_number) {
+ expected_entropy_hash ^= GetPacketEntropy(packet_number);
+ }
+ }
+ } else {
+ 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_protocol_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698