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

Side by Side 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 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 18 matching lines...) Expand all
29 QuicAckNotifier::~QuicAckNotifier() { 29 QuicAckNotifier::~QuicAckNotifier() {
30 } 30 }
31 31
32 void QuicAckNotifier::OnSerializedPacket() { 32 void QuicAckNotifier::OnSerializedPacket() {
33 ++unacked_packets_; 33 ++unacked_packets_;
34 } 34 }
35 35
36 bool QuicAckNotifier::OnAck(QuicPacketSequenceNumber sequence_number, 36 bool QuicAckNotifier::OnAck(QuicPacketSequenceNumber sequence_number,
37 QuicTime::Delta delta_largest_observed) { 37 QuicTime::Delta delta_largest_observed) {
38 if (unacked_packets_ <= 0) { 38 if (unacked_packets_ <= 0) {
39 LOG(DFATAL) << "Acked more packets than were tracked."; 39 LOG(DFATAL) << "Acked more packets than were tracked."
40 << " unacked_packets:" << unacked_packets_;
40 return true; 41 return true;
41 } 42 }
42 --unacked_packets_; 43 --unacked_packets_;
43 if (IsEmpty()) { 44 if (!HasUnackedPackets()) {
44 // We have seen all the sequence numbers we were waiting for, trigger 45 // We have seen all the sequence numbers we were waiting for, trigger
45 // callback notification. 46 // callback notification.
46 delegate_->OnAckNotification(retransmitted_packet_count_, 47 delegate_->OnAckNotification(retransmitted_packet_count_,
47 retransmitted_byte_count_, 48 retransmitted_byte_count_,
48 delta_largest_observed); 49 delta_largest_observed);
49 return true; 50 return true;
50 } 51 }
51 return false; 52 return false;
52 } 53 }
53 54
55 bool QuicAckNotifier::OnPacketAbandoned() {
56 if (unacked_packets_ <= 0) {
57 LOG(DFATAL) << "Abandoned more packets than were tracked."
58 << " unacked_packets:" << unacked_packets_;
59 return true;
60 }
61 --unacked_packets_;
62 return unacked_packets_ == 0;
63 }
64
54 void QuicAckNotifier::OnPacketRetransmitted(int packet_payload_size) { 65 void QuicAckNotifier::OnPacketRetransmitted(int packet_payload_size) {
55 ++retransmitted_packet_count_; 66 ++retransmitted_packet_count_;
56 retransmitted_byte_count_ += packet_payload_size; 67 retransmitted_byte_count_ += packet_payload_size;
57 } 68 }
58 69
59 }; // namespace net 70 }; // 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