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/tcp_cubic_sender_packets.cc

Issue 1983183002: Landing Recent QUIC changes until 5/14/2016 02:25:25 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: "first try to fix link error for win_clang build" Created 4 years, 7 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
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/tcp_cubic_sender_packets.h" 5 #include "net/quic/congestion_control/tcp_cubic_sender_packets.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "net/quic/congestion_control/prr_sender.h" 10 #include "net/quic/congestion_control/prr_sender.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 TcpCubicSenderPackets::~TcpCubicSenderPackets() {} 47 TcpCubicSenderPackets::~TcpCubicSenderPackets() {}
48 48
49 void TcpCubicSenderPackets::SetCongestionWindowFromBandwidthAndRtt( 49 void TcpCubicSenderPackets::SetCongestionWindowFromBandwidthAndRtt(
50 QuicBandwidth bandwidth, 50 QuicBandwidth bandwidth,
51 QuicTime::Delta rtt) { 51 QuicTime::Delta rtt) {
52 QuicPacketCount new_congestion_window = 52 QuicPacketCount new_congestion_window =
53 bandwidth.ToBytesPerPeriod(rtt) / kDefaultTCPMSS; 53 bandwidth.ToBytesPerPeriod(rtt) / kDefaultTCPMSS;
54 if (FLAGS_quic_no_lower_bw_resumption_limit) { 54 if (FLAGS_quic_no_lower_bw_resumption_limit) {
55 // Limit new CWND to be in the range [1, kMaxCongestionWindow]. 55 // Limit new CWND to be in the range [1, kMaxCongestionWindow].
56 congestion_window_ = max(min_congestion_window_, 56 congestion_window_ =
57 min(new_congestion_window, kMaxCongestionWindow)); 57 max(min_congestion_window_,
58 min(new_congestion_window, kMaxResumptionCongestionWindow));
58 } else { 59 } else {
59 congestion_window_ = max(min(new_congestion_window, kMaxCongestionWindow), 60 congestion_window_ =
60 kMinCongestionWindowForBandwidthResumption); 61 max(min(new_congestion_window, kMaxResumptionCongestionWindow),
62 kMinCongestionWindowForBandwidthResumption);
61 } 63 }
62 } 64 }
63 65
64 void TcpCubicSenderPackets::SetCongestionWindowInPackets( 66 void TcpCubicSenderPackets::SetCongestionWindowInPackets(
65 QuicPacketCount congestion_window) { 67 QuicPacketCount congestion_window) {
66 congestion_window_ = congestion_window; 68 congestion_window_ = congestion_window;
67 } 69 }
68 70
69 void TcpCubicSenderPackets::SetMinCongestionWindowInPackets( 71 void TcpCubicSenderPackets::SetMinCongestionWindowInPackets(
70 QuicPacketCount congestion_window) { 72 QuicPacketCount congestion_window) {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 congestion_window_ = initial_tcp_congestion_window_; 213 congestion_window_ = initial_tcp_congestion_window_;
212 slowstart_threshold_ = initial_max_tcp_congestion_window_; 214 slowstart_threshold_ = initial_max_tcp_congestion_window_;
213 max_tcp_congestion_window_ = initial_max_tcp_congestion_window_; 215 max_tcp_congestion_window_ = initial_max_tcp_congestion_window_;
214 } 216 }
215 217
216 CongestionControlType TcpCubicSenderPackets::GetCongestionControlType() const { 218 CongestionControlType TcpCubicSenderPackets::GetCongestionControlType() const {
217 return reno_ ? kReno : kCubic; 219 return reno_ ? kReno : kCubic;
218 } 220 }
219 221
220 } // namespace net 222 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698