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

Unified Diff: net/quic/quic_sent_packet_manager.cc

Issue 398873003: Adds dynamic setting of FEC group size based on the connection's current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 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 b5ca9fe9e51f08f7f93e6fe3aeb4ce2a9643c3d7..9bc0f87f2ac906c371828d8f5c1d1940562ad8fe 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -73,6 +73,7 @@ QuicSentPacketManager::QuicSentPacketManager(bool is_server,
clock_(clock),
stats_(stats),
debug_delegate_(NULL),
+ network_change_visitor_(NULL),
send_algorithm_(
SendAlgorithmInterface::Create(clock, &rtt_stats_, type, stats)),
loss_algorithm_(LossDetectionInterface::Create(loss_type)),
@@ -119,6 +120,10 @@ void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) {
loss_algorithm_.reset(LossDetectionInterface::Create(kTime));
}
send_algorithm_->SetFromConfig(config, is_server_);
+
+ if (network_change_visitor_ != NULL) {
+ network_change_visitor_->OnCongestionWindowChange(GetCongestionWindow());
+ }
}
// TODO(ianswett): Combine this method with OnPacketSent once packets are always
@@ -207,12 +212,15 @@ void QuicSentPacketManager::OnIncomingAck(
void QuicSentPacketManager::MaybeInvokeCongestionEvent(
bool rtt_updated, QuicByteCount bytes_in_flight) {
- if (rtt_updated || !packets_acked_.empty() ||
- !packets_lost_.empty()) {
- send_algorithm_->OnCongestionEvent(
- rtt_updated, bytes_in_flight, packets_acked_, packets_lost_);
- packets_acked_.clear();
- packets_lost_.clear();
+ if (!rtt_updated && packets_acked_.empty() && packets_lost_.empty()) {
+ return;
+ }
+ send_algorithm_->OnCongestionEvent(rtt_updated, bytes_in_flight,
+ packets_acked_, packets_lost_);
+ packets_acked_.clear();
+ packets_lost_.clear();
+ if (network_change_visitor_ != NULL) {
+ network_change_visitor_->OnCongestionWindowChange(GetCongestionWindow());
}
}
@@ -628,6 +636,10 @@ void QuicSentPacketManager::RetransmitAllPackets() {
}
++consecutive_rto_count_;
}
+
+ if (network_change_visitor_ != NULL) {
+ network_change_visitor_->OnCongestionWindowChange(GetCongestionWindow());
+ }
}
QuicSentPacketManager::RetransmissionTimeoutMode
« 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