Snap pinch zoom gestures near the screen edge.
[chromium-blink-merge.git] / net / quic / congestion_control / send_algorithm_interface.cc
blob77d8900f4c6ef699129e310725e3b8575e5d4fb6
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_bytes_sender.h"
8 #include "net/quic/congestion_control/tcp_cubic_sender.h"
9 #include "net/quic/quic_flags.h"
10 #include "net/quic/quic_protocol.h"
12 namespace net {
14 class RttStats;
16 // Factory for send side congestion control algorithm.
17 SendAlgorithmInterface* SendAlgorithmInterface::Create(
18 const QuicClock* clock,
19 const RttStats* rtt_stats,
20 CongestionControlType congestion_control_type,
21 QuicConnectionStats* stats,
22 QuicPacketCount initial_congestion_window) {
23 const QuicPacketCount max_congestion_window =
24 (kDefaultSocketReceiveBuffer * kUsableRecieveBufferFraction) /
25 kDefaultTCPMSS;
26 switch (congestion_control_type) {
27 case kCubic:
28 return new TcpCubicSender(clock, rtt_stats, false /* don't use Reno */,
29 initial_congestion_window,
30 max_congestion_window, stats);
31 case kCubicBytes:
32 return new TcpCubicBytesSender(
33 clock, rtt_stats, false /* don't use Reno */,
34 initial_congestion_window, max_congestion_window, stats);
35 case kReno:
36 return new TcpCubicSender(clock, rtt_stats, true /* use Reno */,
37 initial_congestion_window,
38 max_congestion_window, stats);
39 case kRenoBytes:
40 return new TcpCubicBytesSender(clock, rtt_stats, true /* use Reno */,
41 initial_congestion_window,
42 max_congestion_window, stats);
43 case kBBR:
44 // TODO(rtenneti): Enable BbrTcpSender.
45 #if 0
46 return new BbrTcpSender(clock, rtt_stats, initial_congestion_window,
47 max_congestion_window, stats, true);
48 #endif
49 LOG(DFATAL) << "BbrTcpSender is not supported.";
50 return nullptr;
52 return nullptr;
55 } // namespace net