| 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/tcp_cubic_sender.h" | 5 #include "net/quic/congestion_control/tcp_cubic_sender.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.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 Loading... |
| 46 slowstart_threshold_(std::numeric_limits<uint64>::max()), | 46 slowstart_threshold_(std::numeric_limits<uint64>::max()), |
| 47 last_cutback_exited_slowstart_(false), | 47 last_cutback_exited_slowstart_(false), |
| 48 clock_(clock) { | 48 clock_(clock) { |
| 49 } | 49 } |
| 50 | 50 |
| 51 TcpCubicSender::~TcpCubicSender() { | 51 TcpCubicSender::~TcpCubicSender() { |
| 52 UMA_HISTOGRAM_COUNTS("Net.QuicSession.FinalTcpCwnd", congestion_window_); | 52 UMA_HISTOGRAM_COUNTS("Net.QuicSession.FinalTcpCwnd", congestion_window_); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void TcpCubicSender::SetFromConfig(const QuicConfig& config, | 55 void TcpCubicSender::SetFromConfig(const QuicConfig& config, |
| 56 bool is_server, | 56 Perspective perspective, |
| 57 bool using_pacing) { | 57 bool using_pacing) { |
| 58 if (is_server) { | 58 if (perspective == Perspective::IS_SERVER) { |
| 59 if (config.HasReceivedConnectionOptions() && | 59 if (config.HasReceivedConnectionOptions() && |
| 60 ContainsQuicTag(config.ReceivedConnectionOptions(), kIW10)) { | 60 ContainsQuicTag(config.ReceivedConnectionOptions(), kIW10)) { |
| 61 // Initial window experiment. | 61 // Initial window experiment. |
| 62 congestion_window_ = 10; | 62 congestion_window_ = 10; |
| 63 } | 63 } |
| 64 if (using_pacing) { | 64 if (using_pacing) { |
| 65 // Disable the ack train mode in hystart when pacing is enabled, since it | 65 // Disable the ack train mode in hystart when pacing is enabled, since it |
| 66 // may be falsely triggered. | 66 // may be falsely triggered. |
| 67 hybrid_slow_start_.set_ack_train_detection(false); | 67 hybrid_slow_start_.set_ack_train_detection(false); |
| 68 } | 68 } |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 hybrid_slow_start_.Restart(); | 338 hybrid_slow_start_.Restart(); |
| 339 slowstart_threshold_ = congestion_window_ / 2; | 339 slowstart_threshold_ = congestion_window_ / 2; |
| 340 congestion_window_ = kMinimumCongestionWindow; | 340 congestion_window_ = kMinimumCongestionWindow; |
| 341 } | 341 } |
| 342 | 342 |
| 343 CongestionControlType TcpCubicSender::GetCongestionControlType() const { | 343 CongestionControlType TcpCubicSender::GetCongestionControlType() const { |
| 344 return reno_ ? kReno : kCubic; | 344 return reno_ ? kReno : kCubic; |
| 345 } | 345 } |
| 346 | 346 |
| 347 } // namespace net | 347 } // namespace net |
| OLD | NEW |