Rewrite AndroidSyncSettings to be significantly simpler.
[chromium-blink-merge.git] / net / quic / congestion_control / send_algorithm_interface.cc
blob82f113582a689fd8823f2338a80731832647a285
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
3 // found in the LICENSE file.
5 #include "net/quic/congestion_control/send_algorithm_interface.h"
7 #include "net/quic/congestion_control/tcp_cubic_sender.h"
8 #include "net/quic/quic_protocol.h"
10 namespace net {
12 class RttStats;
14 // Factory for send side congestion control algorithm.
15 SendAlgorithmInterface* SendAlgorithmInterface::Create(
16 const QuicClock* clock,
17 const RttStats* rtt_stats,
18 CongestionControlType congestion_control_type,
19 QuicConnectionStats* stats,
20 QuicPacketCount initial_congestion_window) {
21 switch (congestion_control_type) {
22 case kCubic:
23 return new TcpCubicSender(clock, rtt_stats, false /* don't use Reno */,
24 initial_congestion_window,
25 kMaxTcpCongestionWindow, stats);
26 case kReno:
27 return new TcpCubicSender(clock, rtt_stats, true /* use Reno */,
28 initial_congestion_window,
29 kMaxTcpCongestionWindow, stats);
30 case kBBR:
31 // TODO(rtenneti): Enable BbrTcpSender.
32 #if 0
33 return new BbrTcpSender(clock, rtt_stats, initial_congestion_window,
34 kMaxTcpCongestionWindow, stats);
35 #endif
36 LOG(DFATAL) << "BbrTcpSender is not supported.";
37 return nullptr;
39 return nullptr;
42 } // namespace net