Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: net/quic/quic_sent_packet_manager.cc

Issue 1037633002: Add a QUIC connection option(BWMX) to resume to the max bandwidth (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Populate_RTT_info_89043159
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_sent_packet_manager.h ('k') | net/quic/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 } 178 }
179 } 179 }
180 send_algorithm_->SetFromConfig(config, perspective_, using_pacing_); 180 send_algorithm_->SetFromConfig(config, perspective_, using_pacing_);
181 181
182 if (network_change_visitor_ != nullptr) { 182 if (network_change_visitor_ != nullptr) {
183 network_change_visitor_->OnCongestionWindowChange(); 183 network_change_visitor_->OnCongestionWindowChange();
184 } 184 }
185 } 185 }
186 186
187 bool QuicSentPacketManager::ResumeConnectionState( 187 bool QuicSentPacketManager::ResumeConnectionState(
188 const CachedNetworkParameters& cached_network_params) { 188 const CachedNetworkParameters& cached_network_params,
189 bool max_bandwidth_resumption) {
189 if (cached_network_params.has_min_rtt_ms()) { 190 if (cached_network_params.has_min_rtt_ms()) {
190 uint32 initial_rtt_us = 191 uint32 initial_rtt_us =
191 kNumMicrosPerMilli * cached_network_params.min_rtt_ms(); 192 kNumMicrosPerMilli * cached_network_params.min_rtt_ms();
192 rtt_stats_.set_initial_rtt_us( 193 rtt_stats_.set_initial_rtt_us(
193 max(kMinInitialRoundTripTimeUs, 194 max(kMinInitialRoundTripTimeUs,
194 min(kMaxInitialRoundTripTimeUs, initial_rtt_us))); 195 min(kMaxInitialRoundTripTimeUs, initial_rtt_us)));
195 } 196 }
196 return send_algorithm_->ResumeConnectionState(cached_network_params); 197 return send_algorithm_->ResumeConnectionState(cached_network_params,
198 max_bandwidth_resumption);
197 } 199 }
198 200
199 void QuicSentPacketManager::SetNumOpenStreams(size_t num_streams) { 201 void QuicSentPacketManager::SetNumOpenStreams(size_t num_streams) {
200 if (n_connection_simulation_) { 202 if (n_connection_simulation_) {
201 // Ensure the number of connections is between 1 and 5. 203 // Ensure the number of connections is between 1 and 5.
202 send_algorithm_->SetNumEmulatedConnections( 204 send_algorithm_->SetNumEmulatedConnections(
203 min<size_t>(5, max<size_t>(1, num_streams))); 205 min<size_t>(5, max<size_t>(1, num_streams)));
204 } 206 }
205 } 207 }
206 208
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as 971 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as
970 // the default granularity of the Linux kernel's FQ qdisc. 972 // the default granularity of the Linux kernel's FQ qdisc.
971 using_pacing_ = true; 973 using_pacing_ = true;
972 send_algorithm_.reset( 974 send_algorithm_.reset(
973 new PacingSender(send_algorithm_.release(), 975 new PacingSender(send_algorithm_.release(),
974 QuicTime::Delta::FromMilliseconds(1), 976 QuicTime::Delta::FromMilliseconds(1),
975 kInitialUnpacedBurst)); 977 kInitialUnpacedBurst));
976 } 978 }
977 979
978 } // namespace net 980 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_sent_packet_manager.h ('k') | net/quic/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698