| 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_connection_stats.h" | 9 #include "net/quic/quic_connection_stats.h" |
| 10 #include "net/quic/quic_utils_chromium.h" | 10 #include "net/quic/quic_utils_chromium.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 const TransmissionInfo& info) const { | 266 const TransmissionInfo& info) const { |
| 267 return !IsPacketUsefulForMeasuringRtt(sequence_number, info) && | 267 return !IsPacketUsefulForMeasuringRtt(sequence_number, info) && |
| 268 !IsPacketUsefulForCongestionControl(info) && | 268 !IsPacketUsefulForCongestionControl(info) && |
| 269 !IsPacketUsefulForRetransmittableData(info); | 269 !IsPacketUsefulForRetransmittableData(info); |
| 270 } | 270 } |
| 271 | 271 |
| 272 bool QuicUnackedPacketMap::IsPacketRemovable( | 272 bool QuicUnackedPacketMap::IsPacketRemovable( |
| 273 QuicPacketSequenceNumber sequence_number, | 273 QuicPacketSequenceNumber sequence_number, |
| 274 const TransmissionInfo& info) const { | 274 const TransmissionInfo& info) const { |
| 275 return (!IsPacketUsefulForMeasuringRtt(sequence_number, info) || | 275 return (!IsPacketUsefulForMeasuringRtt(sequence_number, info) || |
| 276 unacked_packets_.size() > kMaxTrackedPackets / 2) && | 276 unacked_packets_.size() > kMaxTcpCongestionWindow) && |
| 277 !IsPacketUsefulForCongestionControl(info) && | 277 !IsPacketUsefulForCongestionControl(info) && |
| 278 !IsPacketUsefulForRetransmittableData(info); | 278 !IsPacketUsefulForRetransmittableData(info); |
| 279 } | 279 } |
| 280 | 280 |
| 281 bool QuicUnackedPacketMap::IsUnacked( | 281 bool QuicUnackedPacketMap::IsUnacked( |
| 282 QuicPacketSequenceNumber sequence_number) const { | 282 QuicPacketSequenceNumber sequence_number) const { |
| 283 if (sequence_number < least_unacked_ || | 283 if (sequence_number < least_unacked_ || |
| 284 sequence_number >= least_unacked_ + unacked_packets_.size()) { | 284 sequence_number >= least_unacked_ + unacked_packets_.size()) { |
| 285 return false; | 285 return false; |
| 286 } | 286 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 } | 385 } |
| 386 } | 386 } |
| 387 return false; | 387 return false; |
| 388 } | 388 } |
| 389 | 389 |
| 390 QuicPacketSequenceNumber QuicUnackedPacketMap::GetLeastUnacked() const { | 390 QuicPacketSequenceNumber QuicUnackedPacketMap::GetLeastUnacked() const { |
| 391 return least_unacked_; | 391 return least_unacked_; |
| 392 } | 392 } |
| 393 | 393 |
| 394 } // namespace net | 394 } // namespace net |
| OLD | NEW |