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/fix_rate_sender.h" | |
8 #include "net/quic/congestion_control/tcp_cubic_sender.h" | 7 #include "net/quic/congestion_control/tcp_cubic_sender.h" |
9 #include "net/quic/quic_protocol.h" | 8 #include "net/quic/quic_protocol.h" |
10 | 9 |
11 namespace net { | 10 namespace net { |
12 | 11 |
13 class RttStats; | 12 class RttStats; |
14 | 13 |
15 // Factory for send side congestion control algorithm. | 14 // Factory for send side congestion control algorithm. |
16 SendAlgorithmInterface* SendAlgorithmInterface::Create( | 15 SendAlgorithmInterface* SendAlgorithmInterface::Create( |
17 const QuicClock* clock, | 16 const QuicClock* clock, |
18 const RttStats* rtt_stats, | 17 const RttStats* rtt_stats, |
19 CongestionControlType congestion_control_type, | 18 CongestionControlType congestion_control_type, |
20 QuicConnectionStats* stats) { | 19 QuicConnectionStats* stats) { |
21 switch (congestion_control_type) { | 20 switch (congestion_control_type) { |
22 case kCubic: | 21 case kCubic: |
23 return new TcpCubicSender(clock, rtt_stats, | 22 return new TcpCubicSender(clock, rtt_stats, |
24 false /* don't use Reno */, | 23 false /* don't use Reno */, |
25 kMaxTcpCongestionWindow, stats); | 24 kMaxTcpCongestionWindow, stats); |
26 case kReno: | 25 case kReno: |
27 return new TcpCubicSender(clock, rtt_stats, | 26 return new TcpCubicSender(clock, rtt_stats, |
28 true /* use Reno */, | 27 true /* use Reno */, |
29 kMaxTcpCongestionWindow, stats); | 28 kMaxTcpCongestionWindow, stats); |
30 case kFixRateCongestionControl: | |
31 return new FixRateSender(rtt_stats); | |
32 case kBBR: | 29 case kBBR: |
33 LOG(DFATAL) << "BbrTcpSender is not supported."; | 30 LOG(DFATAL) << "BbrTcpSender is not supported."; |
34 return NULL; | 31 return NULL; |
35 } | 32 } |
36 return NULL; | 33 return NULL; |
37 } | 34 } |
38 | 35 |
39 } // namespace net | 36 } // namespace net |
OLD | NEW |