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

Unified Diff: net/quic/quic_ack_notifier.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
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 b399a61bcc173541f22d65d49fe653caa6baa023..48ee23df1a45bac5c7ce4876489feb930fabfc36 100644
--- a/net/quic/quic_ack_notifier.cc
+++ b/net/quic/quic_ack_notifier.cc
@@ -29,21 +29,18 @@ QuicAckNotifier::QuicAckNotifier(DelegateInterface* delegate)
QuicAckNotifier::~QuicAckNotifier() {
}
-void QuicAckNotifier::AddSequenceNumber(
- const QuicPacketSequenceNumber& sequence_number,
- int packet_payload_size) {
+void QuicAckNotifier::OnSerializedPacket() {
++unacked_packets_;
- DVLOG(1) << "AckNotifier waiting for packet: " << sequence_number;
}
-bool QuicAckNotifier::OnAck(QuicPacketSequenceNumber sequence_number,
- QuicTime::Delta delta_largest_observed) {
+bool QuicAckNotifier::OnAck(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_,
@@ -54,6 +51,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