| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 max(kMinSocketReceiveBuffer, | 156 max(kMinSocketReceiveBuffer, |
| 157 static_cast<QuicByteCount>(config.ReceivedSocketReceiveBuffer())); | 157 static_cast<QuicByteCount>(config.ReceivedSocketReceiveBuffer())); |
| 158 } | 158 } |
| 159 send_algorithm_->SetFromConfig(config, is_server_, using_pacing_); | 159 send_algorithm_->SetFromConfig(config, is_server_, using_pacing_); |
| 160 | 160 |
| 161 if (network_change_visitor_ != nullptr) { | 161 if (network_change_visitor_ != nullptr) { |
| 162 network_change_visitor_->OnCongestionWindowChange(); | 162 network_change_visitor_->OnCongestionWindowChange(); |
| 163 } | 163 } |
| 164 } | 164 } |
| 165 | 165 |
| 166 void QuicSentPacketManager::ResumeConnectionState( |
| 167 const CachedNetworkParameters& cached_network_params) { |
| 168 send_algorithm_->ResumeConnectionState(cached_network_params); |
| 169 } |
| 170 |
| 166 void QuicSentPacketManager::SetNumOpenStreams(size_t num_streams) { | 171 void QuicSentPacketManager::SetNumOpenStreams(size_t num_streams) { |
| 167 if (n_connection_simulation_) { | 172 if (n_connection_simulation_) { |
| 168 // Ensure the number of connections is between 1 and 5. | 173 // Ensure the number of connections is between 1 and 5. |
| 169 send_algorithm_->SetNumEmulatedConnections( | 174 send_algorithm_->SetNumEmulatedConnections( |
| 170 min<size_t>(5, max<size_t>(1, num_streams))); | 175 min<size_t>(5, max<size_t>(1, num_streams))); |
| 171 } | 176 } |
| 172 } | 177 } |
| 173 | 178 |
| 174 bool QuicSentPacketManager::HasClientSentConnectionOption( | 179 bool QuicSentPacketManager::HasClientSentConnectionOption( |
| 175 const QuicConfig& config, QuicTag tag) const { | 180 const QuicConfig& config, QuicTag tag) const { |
| (...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as | 933 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as |
| 929 // the default granularity of the Linux kernel's FQ qdisc. | 934 // the default granularity of the Linux kernel's FQ qdisc. |
| 930 using_pacing_ = true; | 935 using_pacing_ = true; |
| 931 send_algorithm_.reset( | 936 send_algorithm_.reset( |
| 932 new PacingSender(send_algorithm_.release(), | 937 new PacingSender(send_algorithm_.release(), |
| 933 QuicTime::Delta::FromMilliseconds(1), | 938 QuicTime::Delta::FromMilliseconds(1), |
| 934 kInitialUnpacedBurst)); | 939 kInitialUnpacedBurst)); |
| 935 } | 940 } |
| 936 | 941 |
| 937 } // namespace net | 942 } // namespace net |
| OLD | NEW |