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. |