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

Unified Diff: net/quic/quic_ack_notifier.cc

Issue 872403007: Remove an unneeded hash_set from QuicAckNotifierManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Minor_cleanup_84624803
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.h ('k') | net/quic/quic_ack_notifier_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_ack_notifier.cc
diff --git a/net/quic/quic_ack_notifier.cc b/net/quic/quic_ack_notifier.cc
index ad76aafa4dfd6299928a33aa9923c5330d51f5dd..6236321bf52bb79d0613bcb3a71e96deb774c182 100644
--- a/net/quic/quic_ack_notifier.cc
+++ b/net/quic/quic_ack_notifier.cc
@@ -36,11 +36,12 @@ void QuicAckNotifier::OnSerializedPacket() {
bool QuicAckNotifier::OnAck(QuicPacketSequenceNumber sequence_number,
QuicTime::Delta delta_largest_observed) {
if (unacked_packets_ <= 0) {
- LOG(DFATAL) << "Acked more packets than were tracked.";
+ LOG(DFATAL) << "Acked more packets than were tracked."
+ << " unacked_packets:" << unacked_packets_;
return true;
}
--unacked_packets_;
- if (IsEmpty()) {
+ if (!HasUnackedPackets()) {
// We have seen all the sequence numbers we were waiting for, trigger
// callback notification.
delegate_->OnAckNotification(retransmitted_packet_count_,
@@ -51,6 +52,16 @@ bool QuicAckNotifier::OnAck(QuicPacketSequenceNumber sequence_number,
return false;
}
+bool QuicAckNotifier::OnPacketAbandoned() {
+ if (unacked_packets_ <= 0) {
+ LOG(DFATAL) << "Abandoned more packets than were tracked."
+ << " unacked_packets:" << unacked_packets_;
+ return true;
+ }
+ --unacked_packets_;
+ return unacked_packets_ == 0;
+}
+
void QuicAckNotifier::OnPacketRetransmitted(int packet_payload_size) {
++retransmitted_packet_count_;
retransmitted_byte_count_ += packet_payload_size;
« no previous file with comments | « net/quic/quic_ack_notifier.h ('k') | net/quic/quic_ack_notifier_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698