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

Side by Side Diff: net/quic/congestion_control/cubic.cc

Issue 651513002: QUIC - Minor formatting changes to keep in sync with internal source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Remove_QuicSentPacketManager_DebugVisitor_76595983
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/quic/congestion_control/tcp_cubic_sender_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | net/quic/congestion_control/tcp_cubic_sender_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698