OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/congestion_control/cubic.h" | 5 #include "net/quic/congestion_control/cubic.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 estimated_tcp_congestion_window_ = 0; | 75 estimated_tcp_congestion_window_ = 0; |
76 origin_point_congestion_window_ = 0; | 76 origin_point_congestion_window_ = 0; |
77 time_to_origin_point_ = 0; | 77 time_to_origin_point_ = 0; |
78 last_target_congestion_window_ = 0; | 78 last_target_congestion_window_ = 0; |
79 } | 79 } |
80 | 80 |
81 void Cubic::UpdateCongestionControlStats( | 81 void Cubic::UpdateCongestionControlStats( |
82 QuicTcpCongestionWindow new_cubic_mode_cwnd, | 82 QuicTcpCongestionWindow new_cubic_mode_cwnd, |
83 QuicTcpCongestionWindow new_reno_mode_cwnd) { | 83 QuicTcpCongestionWindow new_reno_mode_cwnd) { |
84 | 84 |
85 QuicTcpCongestionWindow highest_new_cwnd = std::max(new_cubic_mode_cwnd, | 85 QuicTcpCongestionWindow highest_new_cwnd = max(new_cubic_mode_cwnd, |
86 new_reno_mode_cwnd); | 86 new_reno_mode_cwnd); |
87 if (last_congestion_window_ < highest_new_cwnd) { | 87 if (last_congestion_window_ < highest_new_cwnd) { |
88 // cwnd will increase to highest_new_cwnd. | 88 // cwnd will increase to highest_new_cwnd. |
89 stats_->cwnd_increase_congestion_avoidance += | 89 stats_->cwnd_increase_congestion_avoidance += |
90 highest_new_cwnd - last_congestion_window_; | 90 highest_new_cwnd - last_congestion_window_; |
91 if (new_cubic_mode_cwnd > new_reno_mode_cwnd) { | 91 if (new_cubic_mode_cwnd > new_reno_mode_cwnd) { |
92 // This cwnd increase is due to cubic mode. | 92 // This cwnd increase is due to cubic mode. |
93 stats_->cwnd_increase_cubic_mode += | 93 stats_->cwnd_increase_cubic_mode += |
94 new_cubic_mode_cwnd - last_congestion_window_; | 94 new_cubic_mode_cwnd - last_congestion_window_; |
95 } | 95 } |
96 } | 96 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // congestion_window, use highest (fastest). | 182 // congestion_window, use highest (fastest). |
183 if (target_congestion_window < estimated_tcp_congestion_window_) { | 183 if (target_congestion_window < estimated_tcp_congestion_window_) { |
184 target_congestion_window = estimated_tcp_congestion_window_; | 184 target_congestion_window = estimated_tcp_congestion_window_; |
185 } | 185 } |
186 | 186 |
187 DVLOG(1) << "Target congestion_window: " << target_congestion_window; | 187 DVLOG(1) << "Target congestion_window: " << target_congestion_window; |
188 return target_congestion_window; | 188 return target_congestion_window; |
189 } | 189 } |
190 | 190 |
191 } // namespace net | 191 } // namespace net |
OLD | NEW |