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

Side by Side Diff: net/quic/congestion_control/tcp_cubic_sender_bytes.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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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_bytes.h" 5 #include "net/quic/congestion_control/tcp_cubic_sender_bytes.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "net/quic/congestion_control/prr_sender.h" 9 #include "net/quic/congestion_control/prr_sender.h"
10 #include "net/quic/congestion_control/rtt_stats.h" 10 #include "net/quic/congestion_control/rtt_stats.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 TcpCubicSenderBytes::~TcpCubicSenderBytes() {} 48 TcpCubicSenderBytes::~TcpCubicSenderBytes() {}
49 49
50 void TcpCubicSenderBytes::SetCongestionWindowFromBandwidthAndRtt( 50 void TcpCubicSenderBytes::SetCongestionWindowFromBandwidthAndRtt(
51 QuicBandwidth bandwidth, 51 QuicBandwidth bandwidth,
52 QuicTime::Delta rtt) { 52 QuicTime::Delta rtt) {
53 QuicByteCount new_congestion_window = bandwidth.ToBytesPerPeriod(rtt); 53 QuicByteCount new_congestion_window = bandwidth.ToBytesPerPeriod(rtt);
54 if (FLAGS_quic_no_lower_bw_resumption_limit) { 54 if (FLAGS_quic_no_lower_bw_resumption_limit) {
55 // Limit new CWND if needed. 55 // Limit new CWND if needed.
56 congestion_window_ = 56 congestion_window_ =
57 max(min_congestion_window_, 57 max(min_congestion_window_,
58 min(new_congestion_window, kMaxCongestionWindow * kDefaultTCPMSS)); 58 min(new_congestion_window,
59 kMaxResumptionCongestionWindow * kDefaultTCPMSS));
59 } else { 60 } else {
60 congestion_window_ = 61 congestion_window_ =
61 max(min(new_congestion_window, kMaxCongestionWindow * kDefaultTCPMSS), 62 max(min(new_congestion_window,
63 kMaxResumptionCongestionWindow * kDefaultTCPMSS),
62 kMinCongestionWindowForBandwidthResumption * kDefaultTCPMSS); 64 kMinCongestionWindowForBandwidthResumption * kDefaultTCPMSS);
63 } 65 }
64 } 66 }
65 67
66 void TcpCubicSenderBytes::SetCongestionWindowInPackets( 68 void TcpCubicSenderBytes::SetCongestionWindowInPackets(
67 QuicPacketCount congestion_window) { 69 QuicPacketCount congestion_window) {
68 congestion_window_ = congestion_window * kDefaultTCPMSS; 70 congestion_window_ = congestion_window * kDefaultTCPMSS;
69 } 71 }
70 72
71 void TcpCubicSenderBytes::SetMinCongestionWindowInPackets( 73 void TcpCubicSenderBytes::SetMinCongestionWindowInPackets(
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 congestion_window_ = initial_tcp_congestion_window_; 212 congestion_window_ = initial_tcp_congestion_window_;
211 max_congestion_window_ = initial_max_tcp_congestion_window_; 213 max_congestion_window_ = initial_max_tcp_congestion_window_;
212 slowstart_threshold_ = initial_max_tcp_congestion_window_; 214 slowstart_threshold_ = initial_max_tcp_congestion_window_;
213 } 215 }
214 216
215 CongestionControlType TcpCubicSenderBytes::GetCongestionControlType() const { 217 CongestionControlType TcpCubicSenderBytes::GetCongestionControlType() const {
216 return reno_ ? kRenoBytes : kCubicBytes; 218 return reno_ ? kRenoBytes : kCubicBytes;
217 } 219 }
218 220
219 } // namespace net 221 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender_base.h ('k') | net/quic/congestion_control/tcp_cubic_sender_bytes_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698