MacViews: Get c/b/ui/views/tabs to build on Mac
[chromium-blink-merge.git] / net / quic / congestion_control / send_algorithm_interface.cc
blob7245e33770d4127dd4fda1e8e1b3c755b44ca031
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 switch (congestion_control_type) {
21 case kCubic:
22 return new TcpCubicSender(clock, rtt_stats,
23 false /* don't use Reno */,
24 kMaxTcpCongestionWindow, stats);
25 case kReno:
26 return new TcpCubicSender(clock, rtt_stats,
27 true /* use Reno */,
28 kMaxTcpCongestionWindow, stats);
29 case kBBR:
30 LOG(DFATAL) << "BbrTcpSender is not supported.";
31 return nullptr;
33 return nullptr;
36 } // namespace net