OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_unacked_packet_map.h" | 5 #include "net/quic/quic_unacked_packet_map.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "net/quic/quic_ack_notifier_manager.h" | 9 #include "net/quic/quic_ack_notifier_manager.h" |
10 #include "net/quic/quic_connection_stats.h" | 10 #include "net/quic/quic_connection_stats.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 178 |
179 bool QuicUnackedPacketMap::HasRetransmittableFrames( | 179 bool QuicUnackedPacketMap::HasRetransmittableFrames( |
180 QuicPacketNumber packet_number) const { | 180 QuicPacketNumber packet_number) const { |
181 DCHECK_GE(packet_number, least_unacked_); | 181 DCHECK_GE(packet_number, least_unacked_); |
182 DCHECK_LT(packet_number, least_unacked_ + unacked_packets_.size()); | 182 DCHECK_LT(packet_number, least_unacked_ + unacked_packets_.size()); |
183 return unacked_packets_[packet_number - least_unacked_] | 183 return unacked_packets_[packet_number - least_unacked_] |
184 .retransmittable_frames != nullptr; | 184 .retransmittable_frames != nullptr; |
185 } | 185 } |
186 | 186 |
187 void QuicUnackedPacketMap::NackPacket(QuicPacketNumber packet_number, | 187 void QuicUnackedPacketMap::NackPacket(QuicPacketNumber packet_number, |
188 QuicPacketCount min_nacks) { | 188 uint16 min_nacks) { |
189 DCHECK_GE(packet_number, least_unacked_); | 189 DCHECK_GE(packet_number, least_unacked_); |
190 DCHECK_LT(packet_number, least_unacked_ + unacked_packets_.size()); | 190 DCHECK_LT(packet_number, least_unacked_ + unacked_packets_.size()); |
191 unacked_packets_[packet_number - least_unacked_].nack_count = max( | 191 unacked_packets_[packet_number - least_unacked_].nack_count = max( |
192 min_nacks, unacked_packets_[packet_number - least_unacked_].nack_count); | 192 min_nacks, unacked_packets_[packet_number - least_unacked_].nack_count); |
193 } | 193 } |
194 | 194 |
195 void QuicUnackedPacketMap::RemoveRetransmittability( | 195 void QuicUnackedPacketMap::RemoveRetransmittability( |
196 QuicPacketNumber packet_number) { | 196 QuicPacketNumber packet_number) { |
197 DCHECK_GE(packet_number, least_unacked_); | 197 DCHECK_GE(packet_number, least_unacked_); |
198 DCHECK_LT(packet_number, least_unacked_ + unacked_packets_.size()); | 198 DCHECK_LT(packet_number, least_unacked_ + unacked_packets_.size()); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 } | 385 } |
386 | 386 |
387 void QuicUnackedPacketMap::PopLeastUnacked() { | 387 void QuicUnackedPacketMap::PopLeastUnacked() { |
388 ack_notifier_manager_->OnPacketRemoved(least_unacked_); | 388 ack_notifier_manager_->OnPacketRemoved(least_unacked_); |
389 | 389 |
390 unacked_packets_.pop_front(); | 390 unacked_packets_.pop_front(); |
391 ++least_unacked_; | 391 ++least_unacked_; |
392 } | 392 } |
393 | 393 |
394 } // namespace net | 394 } // namespace net |
OLD | NEW |