send_algorithm_interface.cc revision 2a99a7e74a7f215066514fe81d2bfa6639d9eddd
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.
4
5#include "net/quic/congestion_control/send_algorithm_interface.h"
6
7#include "net/quic/congestion_control/fix_rate_sender.h"
8#include "net/quic/congestion_control/tcp_cubic_sender.h"
9
10namespace net {
11
12const bool kUseReno = false;
13
14// Factory for send side congestion control algorithm.
15SendAlgorithmInterface* SendAlgorithmInterface::Create(
16    const QuicClock* clock,
17    CongestionFeedbackType type) {
18  switch (type) {
19    case kTCP:
20      return new TcpCubicSender(clock, kUseReno);
21    case kInterArrival:
22      break;  // TODO(pwestin) Implement.
23    case kFixRate:
24      return new FixRateSender(clock);
25  }
26  return NULL;
27}
28
29}  // namespace net
30