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

Unified Diff: net/quic/congestion_control/cubic.cc

Issue 198353003: Land Recent QUIC Changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/net_log_event_type_list.h ('k') | net/quic/congestion_control/cubic_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/cubic.cc
diff --git a/net/quic/congestion_control/cubic.cc b/net/quic/congestion_control/cubic.cc
index 301512c894fb28d0569e11a9736443a669a14b84..f64e58b05b949eb16618fa27a0b741497d1cc269 100644
--- a/net/quic/congestion_control/cubic.cc
+++ b/net/quic/congestion_control/cubic.cc
@@ -73,20 +73,18 @@ void Cubic::Reset() {
void Cubic::UpdateCongestionControlStats(
QuicTcpCongestionWindow new_cubic_mode_cwnd,
QuicTcpCongestionWindow new_reno_mode_cwnd) {
- if (last_congestion_window_ < new_cubic_mode_cwnd) {
- // Congestion window will increase in cubic mode.
- stats_->cwnd_increase_cubic_mode += new_cubic_mode_cwnd -
- last_congestion_window_;
- if (new_cubic_mode_cwnd <= new_reno_mode_cwnd) {
- // Congestion window increase in reno mode is higher or equal to cubic
- // mode's increase.
- stats_->cwnd_increase_reno_mode += new_reno_mode_cwnd -
- last_congestion_window_;
+
+ QuicTcpCongestionWindow highest_new_cwnd = std::max(new_cubic_mode_cwnd,
+ new_reno_mode_cwnd);
+ if (last_congestion_window_ < highest_new_cwnd) {
+ // cwnd will increase to highest_new_cwnd.
+ stats_->cwnd_increase_congestion_avoidance +=
+ highest_new_cwnd - last_congestion_window_;
+ if (new_cubic_mode_cwnd > new_reno_mode_cwnd) {
+ // This cwnd increase is due to cubic mode.
+ stats_->cwnd_increase_cubic_mode +=
+ new_cubic_mode_cwnd - last_congestion_window_;
}
- } else if (last_congestion_window_ < new_reno_mode_cwnd) {
- // No cwnd increase in cubic mode, but cwnd will increase in reno mode.
- stats_->cwnd_increase_reno_mode += new_reno_mode_cwnd -
- last_congestion_window_;
}
}
« no previous file with comments | « net/base/net_log_event_type_list.h ('k') | net/quic/congestion_control/cubic_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698