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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 consecutive_rto_count_(0), | 86 consecutive_rto_count_(0), |
87 consecutive_tlp_count_(0), | 87 consecutive_tlp_count_(0), |
88 consecutive_crypto_retransmission_count_(0), | 88 consecutive_crypto_retransmission_count_(0), |
89 pending_timer_transmission_count_(0), | 89 pending_timer_transmission_count_(0), |
90 max_tail_loss_probes_(kDefaultMaxTailLossProbes), | 90 max_tail_loss_probes_(kDefaultMaxTailLossProbes), |
91 enable_half_rtt_tail_loss_probe_(false), | 91 enable_half_rtt_tail_loss_probe_(false), |
92 using_pacing_(false), | 92 using_pacing_(false), |
93 use_new_rto_(false), | 93 use_new_rto_(false), |
94 undo_pending_retransmits_(false), | 94 undo_pending_retransmits_(false), |
95 largest_newly_acked_(0), | 95 largest_newly_acked_(0), |
| 96 largest_mtu_acked_(0), |
96 handshake_confirmed_(false) {} | 97 handshake_confirmed_(false) {} |
97 | 98 |
98 QuicSentPacketManager::~QuicSentPacketManager() {} | 99 QuicSentPacketManager::~QuicSentPacketManager() {} |
99 | 100 |
100 void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) { | 101 void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) { |
101 if (config.HasReceivedInitialRoundTripTimeUs() && | 102 if (config.HasReceivedInitialRoundTripTimeUs() && |
102 config.ReceivedInitialRoundTripTimeUs() > 0) { | 103 config.ReceivedInitialRoundTripTimeUs() > 0) { |
103 rtt_stats_.set_initial_rtt_us( | 104 rtt_stats_.set_initial_rtt_us( |
104 max(kMinInitialRoundTripTimeUs, | 105 max(kMinInitialRoundTripTimeUs, |
105 min(kMaxInitialRoundTripTimeUs, | 106 min(kMaxInitialRoundTripTimeUs, |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 // transmission of a crypto packet is in flight at once. | 523 // transmission of a crypto packet is in flight at once. |
523 // TODO(ianswett): Instead of handling all crypto packets special, | 524 // TODO(ianswett): Instead of handling all crypto packets special, |
524 // only handle nullptr encrypted packets in a special way. | 525 // only handle nullptr encrypted packets in a special way. |
525 const TransmissionInfo& newest_transmission_info = | 526 const TransmissionInfo& newest_transmission_info = |
526 unacked_packets_.GetTransmissionInfo(newest_transmission); | 527 unacked_packets_.GetTransmissionInfo(newest_transmission); |
527 if (HasCryptoHandshake(newest_transmission_info)) { | 528 if (HasCryptoHandshake(newest_transmission_info)) { |
528 unacked_packets_.RemoveFromInFlight(newest_transmission); | 529 unacked_packets_.RemoveFromInFlight(newest_transmission); |
529 } | 530 } |
530 } | 531 } |
531 | 532 |
| 533 if (FLAGS_quic_no_mtu_discovery_ack_listener && |
| 534 network_change_visitor_ != nullptr && |
| 535 info->bytes_sent > largest_mtu_acked_) { |
| 536 largest_mtu_acked_ = info->bytes_sent; |
| 537 network_change_visitor_->OnPathMtuIncreased(largest_mtu_acked_); |
| 538 } |
532 unacked_packets_.RemoveFromInFlight(info); | 539 unacked_packets_.RemoveFromInFlight(info); |
533 unacked_packets_.RemoveRetransmittability(info); | 540 unacked_packets_.RemoveRetransmittability(info); |
534 if (FLAGS_quic_loss_recovery_use_largest_acked) { | 541 if (FLAGS_quic_loss_recovery_use_largest_acked) { |
535 info->is_unackable = true; | 542 info->is_unackable = true; |
536 } | 543 } |
537 } | 544 } |
538 | 545 |
539 bool QuicSentPacketManager::IsUnacked(QuicPathId, | 546 bool QuicSentPacketManager::IsUnacked(QuicPathId, |
540 QuicPacketNumber packet_number) const { | 547 QuicPacketNumber packet_number) const { |
541 return unacked_packets_.IsUnacked(packet_number); | 548 return unacked_packets_.IsUnacked(packet_number); |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 TransmissionInfo* QuicSentPacketManager::GetMutableTransmissionInfo( | 1016 TransmissionInfo* QuicSentPacketManager::GetMutableTransmissionInfo( |
1010 QuicPacketNumber packet_number) { | 1017 QuicPacketNumber packet_number) { |
1011 return unacked_packets_.GetMutableTransmissionInfo(packet_number); | 1018 return unacked_packets_.GetMutableTransmissionInfo(packet_number); |
1012 } | 1019 } |
1013 | 1020 |
1014 void QuicSentPacketManager::RemoveObsoletePackets() { | 1021 void QuicSentPacketManager::RemoveObsoletePackets() { |
1015 unacked_packets_.RemoveObsoletePackets(); | 1022 unacked_packets_.RemoveObsoletePackets(); |
1016 } | 1023 } |
1017 | 1024 |
1018 } // namespace net | 1025 } // namespace net |
OLD | NEW |