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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 if (config.HasReceivedConnectionOptions() && | 166 if (config.HasReceivedConnectionOptions() && |
167 ContainsQuicTag(config.ReceivedConnectionOptions(), kTIME)) { | 167 ContainsQuicTag(config.ReceivedConnectionOptions(), kTIME)) { |
168 loss_algorithm_.reset(LossDetectionInterface::Create(kTime)); | 168 loss_algorithm_.reset(LossDetectionInterface::Create(kTime)); |
169 } | 169 } |
170 if (config.HasReceivedSocketReceiveBuffer()) { | 170 if (config.HasReceivedSocketReceiveBuffer()) { |
171 receive_buffer_bytes_ = | 171 receive_buffer_bytes_ = |
172 max(kMinSocketReceiveBuffer, | 172 max(kMinSocketReceiveBuffer, |
173 static_cast<QuicByteCount>(config.ReceivedSocketReceiveBuffer())); | 173 static_cast<QuicByteCount>(config.ReceivedSocketReceiveBuffer())); |
174 QuicByteCount max_cwnd_bytes = static_cast<QuicByteCount>( | 174 QuicByteCount max_cwnd_bytes = static_cast<QuicByteCount>( |
175 receive_buffer_bytes_ * kConservativeReceiveBufferFraction); | 175 receive_buffer_bytes_ * kConservativeReceiveBufferFraction); |
176 max_cwnd_bytes = min(max_cwnd_bytes, kMaxCongestionWindow * kDefaultTCPMSS); | 176 if (!FLAGS_quic_dont_limit_max_cwnd) { |
| 177 // TODO(ianswett): Remove kMaxCongestionWindow once deprecated. |
| 178 max_cwnd_bytes = |
| 179 min(max_cwnd_bytes, kMaxCongestionWindow * kDefaultTCPMSS); |
| 180 } |
177 send_algorithm_->SetMaxCongestionWindow(max_cwnd_bytes); | 181 send_algorithm_->SetMaxCongestionWindow(max_cwnd_bytes); |
178 } | 182 } |
179 send_algorithm_->SetFromConfig(config, perspective_); | 183 send_algorithm_->SetFromConfig(config, perspective_); |
180 | 184 |
181 if (network_change_visitor_ != nullptr) { | 185 if (network_change_visitor_ != nullptr) { |
182 network_change_visitor_->OnCongestionWindowChange(); | 186 network_change_visitor_->OnCongestionWindowChange(); |
183 } | 187 } |
184 } | 188 } |
185 | 189 |
186 void QuicSentPacketManager::ResumeConnectionState( | 190 void QuicSentPacketManager::ResumeConnectionState( |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 TransmissionInfo* QuicSentPacketManager::GetMutableTransmissionInfo( | 961 TransmissionInfo* QuicSentPacketManager::GetMutableTransmissionInfo( |
958 QuicPacketNumber packet_number) { | 962 QuicPacketNumber packet_number) { |
959 return unacked_packets_.GetMutableTransmissionInfo(packet_number); | 963 return unacked_packets_.GetMutableTransmissionInfo(packet_number); |
960 } | 964 } |
961 | 965 |
962 void QuicSentPacketManager::RemoveObsoletePackets() { | 966 void QuicSentPacketManager::RemoveObsoletePackets() { |
963 unacked_packets_.RemoveObsoletePackets(); | 967 unacked_packets_.RemoveObsoletePackets(); |
964 } | 968 } |
965 | 969 |
966 } // namespace net | 970 } // namespace net |
OLD | NEW |