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 |