| 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/core/quic_sent_packet_manager.h" | 5 #include "net/quic/core/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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 delegate_(delegate), | 68 delegate_(delegate), |
| 69 debug_delegate_(nullptr), | 69 debug_delegate_(nullptr), |
| 70 network_change_visitor_(nullptr), | 70 network_change_visitor_(nullptr), |
| 71 initial_congestion_window_(kInitialCongestionWindow), | 71 initial_congestion_window_(kInitialCongestionWindow), |
| 72 send_algorithm_( | 72 send_algorithm_( |
| 73 SendAlgorithmInterface::Create(clock, | 73 SendAlgorithmInterface::Create(clock, |
| 74 &rtt_stats_, | 74 &rtt_stats_, |
| 75 congestion_control_type, | 75 congestion_control_type, |
| 76 stats, | 76 stats, |
| 77 initial_congestion_window_)), | 77 initial_congestion_window_)), |
| 78 loss_algorithm_(new GeneralLossAlgorithm(loss_type)), | 78 loss_algorithm_(&general_loss_algorithm_), |
| 79 general_loss_algorithm_(loss_type), |
| 79 n_connection_simulation_(false), | 80 n_connection_simulation_(false), |
| 80 receive_buffer_bytes_(kDefaultSocketReceiveBuffer), | 81 receive_buffer_bytes_(kDefaultSocketReceiveBuffer), |
| 81 least_packet_awaited_by_peer_(1), | 82 least_packet_awaited_by_peer_(1), |
| 82 first_rto_transmission_(0), | 83 first_rto_transmission_(0), |
| 83 consecutive_rto_count_(0), | 84 consecutive_rto_count_(0), |
| 84 consecutive_tlp_count_(0), | 85 consecutive_tlp_count_(0), |
| 85 consecutive_crypto_retransmission_count_(0), | 86 consecutive_crypto_retransmission_count_(0), |
| 86 pending_timer_transmission_count_(0), | 87 pending_timer_transmission_count_(0), |
| 87 max_tail_loss_probes_(kDefaultMaxTailLossProbes), | 88 max_tail_loss_probes_(kDefaultMaxTailLossProbes), |
| 88 enable_half_rtt_tail_loss_probe_(false), | 89 enable_half_rtt_tail_loss_probe_(false), |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 max_tail_loss_probes_ = 0; | 145 max_tail_loss_probes_ = 0; |
| 145 } | 146 } |
| 146 if (config.HasClientSentConnectionOption(kTLPR, perspective_)) { | 147 if (config.HasClientSentConnectionOption(kTLPR, perspective_)) { |
| 147 enable_half_rtt_tail_loss_probe_ = true; | 148 enable_half_rtt_tail_loss_probe_ = true; |
| 148 } | 149 } |
| 149 if (config.HasClientSentConnectionOption(kNRTO, perspective_)) { | 150 if (config.HasClientSentConnectionOption(kNRTO, perspective_)) { |
| 150 use_new_rto_ = true; | 151 use_new_rto_ = true; |
| 151 } | 152 } |
| 152 if (config.HasReceivedConnectionOptions() && | 153 if (config.HasReceivedConnectionOptions() && |
| 153 ContainsQuicTag(config.ReceivedConnectionOptions(), kTIME)) { | 154 ContainsQuicTag(config.ReceivedConnectionOptions(), kTIME)) { |
| 154 loss_algorithm_.reset(new GeneralLossAlgorithm(kTime)); | 155 general_loss_algorithm_.SetLossDetectionType(kTime); |
| 155 } | 156 } |
| 156 if (config.HasReceivedConnectionOptions() && | 157 if (config.HasReceivedConnectionOptions() && |
| 157 ContainsQuicTag(config.ReceivedConnectionOptions(), kATIM)) { | 158 ContainsQuicTag(config.ReceivedConnectionOptions(), kATIM)) { |
| 158 loss_algorithm_.reset(new GeneralLossAlgorithm(kAdaptiveTime)); | 159 general_loss_algorithm_.SetLossDetectionType(kAdaptiveTime); |
| 159 } | 160 } |
| 160 if (FLAGS_quic_loss_recovery_use_largest_acked && | 161 if (FLAGS_quic_loss_recovery_use_largest_acked && |
| 161 config.HasClientSentConnectionOption(kUNDO, perspective_)) { | 162 config.HasClientSentConnectionOption(kUNDO, perspective_)) { |
| 162 undo_pending_retransmits_ = true; | 163 undo_pending_retransmits_ = true; |
| 163 } | 164 } |
| 164 send_algorithm_->SetFromConfig(config, perspective_); | 165 send_algorithm_->SetFromConfig(config, perspective_); |
| 165 | 166 |
| 166 if (network_change_visitor_ != nullptr) { | 167 if (network_change_visitor_ != nullptr) { |
| 167 network_change_visitor_->OnCongestionChange(); | 168 network_change_visitor_->OnCongestionChange(); |
| 168 } | 169 } |
| (...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1014 TransmissionInfo* QuicSentPacketManager::GetMutableTransmissionInfo( | 1015 TransmissionInfo* QuicSentPacketManager::GetMutableTransmissionInfo( |
| 1015 QuicPacketNumber packet_number) { | 1016 QuicPacketNumber packet_number) { |
| 1016 return unacked_packets_.GetMutableTransmissionInfo(packet_number); | 1017 return unacked_packets_.GetMutableTransmissionInfo(packet_number); |
| 1017 } | 1018 } |
| 1018 | 1019 |
| 1019 void QuicSentPacketManager::RemoveObsoletePackets() { | 1020 void QuicSentPacketManager::RemoveObsoletePackets() { |
| 1020 unacked_packets_.RemoveObsoletePackets(); | 1021 unacked_packets_.RemoveObsoletePackets(); |
| 1021 } | 1022 } |
| 1022 | 1023 |
| 1023 } // namespace net | 1024 } // namespace net |
| OLD | NEW |