OLD | NEW |
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_sent_packet_manager.h" | 5 #include "net/quic/quic_sent_packet_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 consecutive_rto_count_ = 0; | 221 consecutive_rto_count_ = 0; |
222 consecutive_tlp_count_ = 0; | 222 consecutive_tlp_count_ = 0; |
223 consecutive_crypto_retransmission_count_ = 0; | 223 consecutive_crypto_retransmission_count_ = 0; |
224 } | 224 } |
225 | 225 |
226 if (debug_delegate_ != NULL) { | 226 if (debug_delegate_ != NULL) { |
227 debug_delegate_->OnIncomingAck(ack_frame, | 227 debug_delegate_->OnIncomingAck(ack_frame, |
228 ack_receive_time, | 228 ack_receive_time, |
229 unacked_packets_.largest_observed(), | 229 unacked_packets_.largest_observed(), |
230 largest_observed_acked, | 230 largest_observed_acked, |
231 GetLeastUnackedSentPacket()); | 231 GetLeastUnacked()); |
232 } | 232 } |
233 } | 233 } |
234 | 234 |
235 void QuicSentPacketManager::UpdatePacketInformationReceivedByPeer( | 235 void QuicSentPacketManager::UpdatePacketInformationReceivedByPeer( |
236 const QuicAckFrame& ack_frame) { | 236 const QuicAckFrame& ack_frame) { |
237 if (ack_frame.missing_packets.empty()) { | 237 if (ack_frame.missing_packets.empty()) { |
238 least_packet_awaited_by_peer_ = ack_frame.largest_observed + 1; | 238 least_packet_awaited_by_peer_ = ack_frame.largest_observed + 1; |
239 } else { | 239 } else { |
240 least_packet_awaited_by_peer_ = *(ack_frame.missing_packets.begin()); | 240 least_packet_awaited_by_peer_ = *(ack_frame.missing_packets.begin()); |
241 } | 241 } |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 bool QuicSentPacketManager::IsUnacked( | 491 bool QuicSentPacketManager::IsUnacked( |
492 QuicPacketSequenceNumber sequence_number) const { | 492 QuicPacketSequenceNumber sequence_number) const { |
493 return unacked_packets_.IsUnacked(sequence_number); | 493 return unacked_packets_.IsUnacked(sequence_number); |
494 } | 494 } |
495 | 495 |
496 bool QuicSentPacketManager::HasUnackedPackets() const { | 496 bool QuicSentPacketManager::HasUnackedPackets() const { |
497 return unacked_packets_.HasUnackedPackets(); | 497 return unacked_packets_.HasUnackedPackets(); |
498 } | 498 } |
499 | 499 |
500 QuicPacketSequenceNumber | 500 QuicPacketSequenceNumber |
501 QuicSentPacketManager::GetLeastUnackedSentPacket() const { | 501 QuicSentPacketManager::GetLeastUnacked() const { |
502 return unacked_packets_.GetLeastUnacked(); | 502 return unacked_packets_.GetLeastUnacked(); |
503 } | 503 } |
504 | 504 |
505 bool QuicSentPacketManager::OnPacketSent( | 505 bool QuicSentPacketManager::OnPacketSent( |
506 QuicPacketSequenceNumber sequence_number, | 506 QuicPacketSequenceNumber sequence_number, |
507 QuicTime sent_time, | 507 QuicTime sent_time, |
508 QuicByteCount bytes, | 508 QuicByteCount bytes, |
509 TransmissionType transmission_type, | 509 TransmissionType transmission_type, |
510 HasRetransmittableData has_retransmittable_data) { | 510 HasRetransmittableData has_retransmittable_data) { |
511 DCHECK_LT(0u, sequence_number); | 511 DCHECK_LT(0u, sequence_number); |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 | 873 |
874 // Set up a pacing sender with a 5 millisecond alarm granularity. | 874 // Set up a pacing sender with a 5 millisecond alarm granularity. |
875 using_pacing_ = true; | 875 using_pacing_ = true; |
876 send_algorithm_.reset( | 876 send_algorithm_.reset( |
877 new PacingSender(send_algorithm_.release(), | 877 new PacingSender(send_algorithm_.release(), |
878 QuicTime::Delta::FromMilliseconds(5), | 878 QuicTime::Delta::FromMilliseconds(5), |
879 kInitialUnpacedBurst)); | 879 kInitialUnpacedBurst)); |
880 } | 880 } |
881 | 881 |
882 } // namespace net | 882 } // namespace net |
OLD | NEW |