OLD | NEW |
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_bytes_sender.h" | 5 #include "net/quic/congestion_control/tcp_cubic_bytes_sender.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 30 matching lines...) Expand all Loading... |
41 num_connections_(kDefaultNumConnections), | 41 num_connections_(kDefaultNumConnections), |
42 num_acked_packets_(0), | 42 num_acked_packets_(0), |
43 largest_sent_packet_number_(0), | 43 largest_sent_packet_number_(0), |
44 largest_acked_packet_number_(0), | 44 largest_acked_packet_number_(0), |
45 largest_sent_at_last_cutback_(0), | 45 largest_sent_at_last_cutback_(0), |
46 congestion_window_(initial_tcp_congestion_window * kDefaultTCPMSS), | 46 congestion_window_(initial_tcp_congestion_window * kDefaultTCPMSS), |
47 min_congestion_window_(kDefaultMinimumCongestionWindow), | 47 min_congestion_window_(kDefaultMinimumCongestionWindow), |
48 min4_mode_(false), | 48 min4_mode_(false), |
49 max_congestion_window_(max_congestion_window * kDefaultTCPMSS), | 49 max_congestion_window_(max_congestion_window * kDefaultTCPMSS), |
50 slowstart_threshold_(max_congestion_window * kDefaultTCPMSS), | 50 slowstart_threshold_(max_congestion_window * kDefaultTCPMSS), |
51 last_cutback_exited_slowstart_(false), | 51 last_cutback_exited_slowstart_(false) {} |
52 clock_(clock) {} | |
53 | 52 |
54 TcpCubicBytesSender::~TcpCubicBytesSender() { | 53 TcpCubicBytesSender::~TcpCubicBytesSender() { |
55 } | 54 } |
56 | 55 |
57 void TcpCubicBytesSender::SetFromConfig(const QuicConfig& config, | 56 void TcpCubicBytesSender::SetFromConfig(const QuicConfig& config, |
58 Perspective perspective) { | 57 Perspective perspective) { |
59 if (perspective == Perspective::IS_SERVER) { | 58 if (perspective == Perspective::IS_SERVER) { |
60 if (config.HasReceivedConnectionOptions() && | 59 if (config.HasReceivedConnectionOptions() && |
61 ContainsQuicTag(config.ReceivedConnectionOptions(), kIW10)) { | 60 ContainsQuicTag(config.ReceivedConnectionOptions(), kIW10)) { |
62 // Initial window experiment. | 61 // Initial window experiment. |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 hybrid_slow_start_.Restart(); | 347 hybrid_slow_start_.Restart(); |
349 slowstart_threshold_ = congestion_window_ / 2; | 348 slowstart_threshold_ = congestion_window_ / 2; |
350 congestion_window_ = min_congestion_window_; | 349 congestion_window_ = min_congestion_window_; |
351 } | 350 } |
352 | 351 |
353 CongestionControlType TcpCubicBytesSender::GetCongestionControlType() const { | 352 CongestionControlType TcpCubicBytesSender::GetCongestionControlType() const { |
354 return reno_ ? kRenoBytes : kCubicBytes; | 353 return reno_ ? kRenoBytes : kCubicBytes; |
355 } | 354 } |
356 | 355 |
357 } // namespace net | 356 } // namespace net |
OLD | NEW |