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/send_algorithm_interface.h" | 5 #include "net/quic/congestion_control/send_algorithm_interface.h" |
6 | 6 |
7 #include "net/quic/congestion_control/tcp_cubic_bytes_sender.h" | 7 #include "net/quic/congestion_control/tcp_cubic_bytes_sender.h" |
8 #include "net/quic/congestion_control/tcp_cubic_sender.h" | 8 #include "net/quic/congestion_control/tcp_cubic_sender.h" |
9 #include "net/quic/quic_protocol.h" | 9 #include "net/quic/quic_protocol.h" |
10 | 10 |
11 namespace net { | 11 namespace net { |
12 | 12 |
13 class RttStats; | 13 class RttStats; |
14 | 14 |
15 // Factory for send side congestion control algorithm. | 15 // Factory for send side congestion control algorithm. |
16 SendAlgorithmInterface* SendAlgorithmInterface::Create( | 16 SendAlgorithmInterface* SendAlgorithmInterface::Create( |
17 const QuicClock* clock, | 17 const QuicClock* clock, |
18 const RttStats* rtt_stats, | 18 const RttStats* rtt_stats, |
19 CongestionControlType congestion_control_type, | 19 CongestionControlType congestion_control_type, |
20 QuicConnectionStats* stats, | 20 QuicConnectionStats* stats, |
21 QuicPacketCount initial_congestion_window) { | 21 QuicPacketCount initial_congestion_window) { |
22 switch (congestion_control_type) { | 22 switch (congestion_control_type) { |
23 case kCubic: | 23 case kCubic: |
24 return new TcpCubicSender(clock, rtt_stats, false /* don't use Reno */, | 24 return new TcpCubicSender(clock, rtt_stats, false /* don't use Reno */, |
25 initial_congestion_window, stats); | 25 initial_congestion_window, |
| 26 kMaxTcpCongestionWindow, stats); |
26 case kCubicBytes: | 27 case kCubicBytes: |
27 return new TcpCubicBytesSender(clock, rtt_stats, | 28 return new TcpCubicBytesSender( |
28 false /* don't use Reno */, | 29 clock, rtt_stats, false /* don't use Reno */, |
29 initial_congestion_window, stats); | 30 initial_congestion_window, kMaxTcpCongestionWindow, stats); |
30 case kReno: | 31 case kReno: |
31 return new TcpCubicSender(clock, rtt_stats, true /* use Reno */, | 32 return new TcpCubicSender(clock, rtt_stats, true /* use Reno */, |
32 initial_congestion_window, stats); | 33 initial_congestion_window, |
| 34 kMaxTcpCongestionWindow, stats); |
33 case kRenoBytes: | 35 case kRenoBytes: |
34 return new TcpCubicBytesSender(clock, rtt_stats, true /* use Reno */, | 36 return new TcpCubicBytesSender(clock, rtt_stats, true /* use Reno */, |
35 initial_congestion_window, stats); | 37 initial_congestion_window, |
| 38 kMaxTcpCongestionWindow, stats); |
36 case kBBR: | 39 case kBBR: |
37 // TODO(rtenneti): Enable BbrTcpSender. | 40 // TODO(rtenneti): Enable BbrTcpSender. |
38 #if 0 | 41 #if 0 |
39 return new BbrTcpSender(clock, rtt_stats, initial_congestion_window, | 42 return new BbrTcpSender(clock, rtt_stats, initial_congestion_window, |
40 stats); | 43 kMaxTcpCongestionWindow, stats); |
41 #endif | 44 #endif |
42 LOG(DFATAL) << "BbrTcpSender is not supported."; | 45 LOG(DFATAL) << "BbrTcpSender is not supported."; |
43 return nullptr; | 46 return nullptr; |
44 } | 47 } |
45 return nullptr; | 48 return nullptr; |
46 } | 49 } |
47 | 50 |
48 } // namespace net | 51 } // namespace net |
OLD | NEW |