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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 // recent_min_rtt, likely by not discarding a relatively new sample. | 591 // recent_min_rtt, likely by not discarding a relatively new sample. |
592 DVLOG(1) << "Sampling a new recent min rtt within 2 samples. currently:" | 592 DVLOG(1) << "Sampling a new recent min rtt within 2 samples. currently:" |
593 << rtt_stats_.recent_min_rtt().ToMilliseconds() << "ms"; | 593 << rtt_stats_.recent_min_rtt().ToMilliseconds() << "ms"; |
594 rtt_stats_.SampleNewRecentMinRtt(kNumMinRttSamplesAfterQuiescence); | 594 rtt_stats_.SampleNewRecentMinRtt(kNumMinRttSamplesAfterQuiescence); |
595 } | 595 } |
596 | 596 |
597 // Only track packets as in flight that the send algorithm wants us to track. | 597 // Only track packets as in flight that the send algorithm wants us to track. |
598 // Since FEC packets should also be counted towards the congestion window, | 598 // Since FEC packets should also be counted towards the congestion window, |
599 // consider them as retransmittable for the purposes of congestion control. | 599 // consider them as retransmittable for the purposes of congestion control. |
600 HasRetransmittableData has_congestion_controlled_data = | 600 HasRetransmittableData has_congestion_controlled_data = |
601 serialized_packet->packet->is_fec_packet() ? | 601 serialized_packet->is_fec_packet ? HAS_RETRANSMITTABLE_DATA |
602 HAS_RETRANSMITTABLE_DATA : has_retransmittable_data; | 602 : has_retransmittable_data; |
603 const bool in_flight = | 603 const bool in_flight = |
604 send_algorithm_->OnPacketSent(sent_time, | 604 send_algorithm_->OnPacketSent(sent_time, |
605 unacked_packets_.bytes_in_flight(), | 605 unacked_packets_.bytes_in_flight(), |
606 sequence_number, | 606 sequence_number, |
607 bytes, | 607 bytes, |
608 has_congestion_controlled_data); | 608 has_congestion_controlled_data); |
609 | 609 |
610 unacked_packets_.AddSentPacket(*serialized_packet, | 610 unacked_packets_.AddSentPacket(*serialized_packet, |
611 original_sequence_number, | 611 original_sequence_number, |
612 transmission_type, | 612 transmission_type, |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as | 1010 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as |
1011 // the default granularity of the Linux kernel's FQ qdisc. | 1011 // the default granularity of the Linux kernel's FQ qdisc. |
1012 using_pacing_ = true; | 1012 using_pacing_ = true; |
1013 send_algorithm_.reset( | 1013 send_algorithm_.reset( |
1014 new PacingSender(send_algorithm_.release(), | 1014 new PacingSender(send_algorithm_.release(), |
1015 QuicTime::Delta::FromMilliseconds(1), | 1015 QuicTime::Delta::FromMilliseconds(1), |
1016 kInitialUnpacedBurst)); | 1016 kInitialUnpacedBurst)); |
1017 } | 1017 } |
1018 | 1018 |
1019 } // namespace net | 1019 } // namespace net |
OLD | NEW |