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

Side by Side Diff: net/quic/quic_ack_notifier.cc

Issue 908623002: Revert of Landing Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_ack_notifier.h" 5 #include "net/quic/quic_ack_notifier.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 11 matching lines...) Expand all
22 : delegate_(delegate), 22 : delegate_(delegate),
23 unacked_packets_(0), 23 unacked_packets_(0),
24 retransmitted_packet_count_(0), 24 retransmitted_packet_count_(0),
25 retransmitted_byte_count_(0) { 25 retransmitted_byte_count_(0) {
26 DCHECK(delegate); 26 DCHECK(delegate);
27 } 27 }
28 28
29 QuicAckNotifier::~QuicAckNotifier() { 29 QuicAckNotifier::~QuicAckNotifier() {
30 } 30 }
31 31
32 void QuicAckNotifier::OnSerializedPacket() { 32 void QuicAckNotifier::AddSequenceNumber(
33 const QuicPacketSequenceNumber& sequence_number,
34 int packet_payload_size) {
33 ++unacked_packets_; 35 ++unacked_packets_;
36 DVLOG(1) << "AckNotifier waiting for packet: " << sequence_number;
34 } 37 }
35 38
36 bool QuicAckNotifier::OnAck(QuicTime::Delta delta_largest_observed) { 39 bool QuicAckNotifier::OnAck(QuicPacketSequenceNumber sequence_number,
40 QuicTime::Delta delta_largest_observed) {
37 if (unacked_packets_ <= 0) { 41 if (unacked_packets_ <= 0) {
38 LOG(DFATAL) << "Acked more packets than were tracked." 42 LOG(DFATAL) << "Acked more packets than were tracked.";
39 << " unacked_packets:" << unacked_packets_;
40 return true; 43 return true;
41 } 44 }
42 --unacked_packets_; 45 --unacked_packets_;
43 if (!HasUnackedPackets()) { 46 if (IsEmpty()) {
44 // We have seen all the sequence numbers we were waiting for, trigger 47 // We have seen all the sequence numbers we were waiting for, trigger
45 // callback notification. 48 // callback notification.
46 delegate_->OnAckNotification(retransmitted_packet_count_, 49 delegate_->OnAckNotification(retransmitted_packet_count_,
47 retransmitted_byte_count_, 50 retransmitted_byte_count_,
48 delta_largest_observed); 51 delta_largest_observed);
49 return true; 52 return true;
50 } 53 }
51 return false; 54 return false;
52 } 55 }
53 56
54 bool QuicAckNotifier::OnPacketAbandoned() {
55 if (unacked_packets_ <= 0) {
56 LOG(DFATAL) << "Abandoned more packets than were tracked."
57 << " unacked_packets:" << unacked_packets_;
58 return true;
59 }
60 --unacked_packets_;
61 return unacked_packets_ == 0;
62 }
63
64 void QuicAckNotifier::OnPacketRetransmitted(int packet_payload_size) { 57 void QuicAckNotifier::OnPacketRetransmitted(int packet_payload_size) {
65 ++retransmitted_packet_count_; 58 ++retransmitted_packet_count_;
66 retransmitted_byte_count_ += packet_payload_size; 59 retransmitted_byte_count_ += packet_payload_size;
67 } 60 }
68 61
69 }; // namespace net 62 }; // namespace net
OLDNEW
« 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