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

Unified Diff: net/quic/quic_ack_notifier_manager.cc

Issue 880403006: Further cleanup to QuicAckNotifier and QuicAckNotifierManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Remove_unneeded_hash_set_84637544
Patch Set: Created 5 years, 10 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_ack_notifier.cc ('k') | net/quic/quic_ack_notifier_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_ack_notifier_manager.cc
diff --git a/net/quic/quic_ack_notifier_manager.cc b/net/quic/quic_ack_notifier_manager.cc
index 357c5469133e19d50abc9fe4133a159143c3609a..73e3c8e1c2ac87692fb8dc1e4256d95c67d7d9f8 100644
--- a/net/quic/quic_ack_notifier_manager.cc
+++ b/net/quic/quic_ack_notifier_manager.cc
@@ -40,12 +40,9 @@ void AckNotifierManager::OnPacketAcked(QuicPacketSequenceNumber sequence_number,
// One or more AckNotifiers are registered as interested in this sequence
// number. Iterate through them and call OnAck on each.
- AckNotifierList& ack_notifier_list = map_it->second;
- for (QuicAckNotifier* ack_notifier : ack_notifier_list) {
- ack_notifier->OnAck(sequence_number, delta_largest_observed);
-
- // If this has resulted in an empty AckNotifer, erase it.
- if (!ack_notifier->HasUnackedPackets()) {
+ for (QuicAckNotifier* ack_notifier : map_it->second) {
+ if (ack_notifier->OnAck(delta_largest_observed)) {
+ // If this has resulted in an empty AckNotifer, erase it.
delete ack_notifier;
}
}
@@ -80,7 +77,9 @@ void AckNotifierManager::OnPacketRetransmitted(
void AckNotifierManager::OnSerializedPacket(
const SerializedPacket& serialized_packet) {
if (FLAGS_quic_attach_ack_notifiers_to_packets) {
- // Inform each attached AckNotifier of the packet's sequence number.
+ // Inform each attached AckNotifier of the packet's serialization.
+ AckNotifierList& notifier_list =
+ ack_notifier_map_[serialized_packet.sequence_number];
for (QuicAckNotifier* notifier : serialized_packet.notifiers) {
if (notifier == nullptr) {
LOG(DFATAL) << "AckNotifier should not be nullptr.";
@@ -90,7 +89,7 @@ void AckNotifierManager::OnSerializedPacket(
// Update the mapping in the other direction, from sequence number to
// AckNotifier.
- ack_notifier_map_[serialized_packet.sequence_number].push_back(notifier);
+ notifier_list.push_back(notifier);
}
} else {
// AckNotifiers can only be attached to retransmittable frames.
« no previous file with comments | « net/quic/quic_ack_notifier.cc ('k') | net/quic/quic_ack_notifier_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698