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

Unified Diff: net/quic/quic_sent_packet_manager.cc

Issue 693943003: Update from https://crrev.com/302630 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_sent_packet_manager.cc
diff --git a/net/quic/quic_sent_packet_manager.cc b/net/quic/quic_sent_packet_manager.cc
index 553e7e2f69a188ed7a7c2bb78c34323ab5741cf7..6370d9fe623b34373ff443579d87fee1987c267a 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -78,6 +78,7 @@ QuicSentPacketManager::QuicSentPacketManager(
congestion_control_type,
stats)),
loss_algorithm_(LossDetectionInterface::Create(loss_type)),
+ n_connection_simulation_(false),
receive_buffer_bytes_(kDefaultSocketReceiveBuffer),
least_packet_awaited_by_peer_(1),
first_rto_transmission_(0),
@@ -125,6 +126,9 @@ void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) {
if (HasClientSentConnectionOption(config, k1CON)) {
send_algorithm_->SetNumEmulatedConnections(1);
}
+ if (HasClientSentConnectionOption(config, kNCON)) {
+ n_connection_simulation_ = true;
+ }
if (HasClientSentConnectionOption(config, kNTLP)) {
max_tail_loss_probes_ = 0;
}
@@ -140,7 +144,15 @@ void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) {
send_algorithm_->SetFromConfig(config, is_server_);
if (network_change_visitor_ != nullptr) {
- network_change_visitor_->OnCongestionWindowChange(GetCongestionWindow());
+ network_change_visitor_->OnCongestionWindowChange();
+ }
+}
+
+void QuicSentPacketManager::SetNumOpenStreams(size_t num_streams) {
+ if (n_connection_simulation_) {
+ // Ensure the number of connections is between 1 and 5.
+ send_algorithm_->SetNumEmulatedConnections(
+ min<size_t>(5, max<size_t>(1, num_streams)));
}
}
@@ -225,7 +237,7 @@ void QuicSentPacketManager::MaybeInvokeCongestionEvent(
packets_acked_.clear();
packets_lost_.clear();
if (network_change_visitor_ != nullptr) {
- network_change_visitor_->OnCongestionWindowChange(GetCongestionWindow());
+ network_change_visitor_->OnCongestionWindowChange();
}
}
@@ -650,7 +662,7 @@ void QuicSentPacketManager::RetransmitAllPackets() {
}
if (network_change_visitor_ != nullptr) {
- network_change_visitor_->OnCongestionWindowChange(GetCongestionWindow());
+ network_change_visitor_->OnCongestionWindowChange();
}
}
@@ -818,8 +830,7 @@ const QuicTime::Delta QuicSentPacketManager::GetTailLossProbeDelay() const {
QuicTime::Delta srtt = rtt_stats_.SmoothedRtt();
if (!unacked_packets_.HasMultipleInFlightPackets()) {
return QuicTime::Delta::Max(
- srtt.Multiply(2),
- srtt.Multiply(1.5).Add(
+ srtt.Multiply(2), srtt.Multiply(1.5).Add(
QuicTime::Delta::FromMilliseconds(kMinRetransmissionTimeMs / 2)));
}
return QuicTime::Delta::FromMilliseconds(
« 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