summaryrefslogtreecommitdiffstats
path: root/net/quic/congestion_control/receive_algorithm_interface.cc
blob: f5672f804156fe3c61fef3b9ba77a1934529e24c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "net/quic/congestion_control/receive_algorithm_interface.h"

#include "net/quic/congestion_control/fix_rate_receiver.h"
#include "net/quic/congestion_control/tcp_receiver.h"

namespace net {

// Factory for receive side congestion control algorithm.
ReceiveAlgorithmInterface* ReceiveAlgorithmInterface::Create(
    CongestionFeedbackType type) {
  switch (type) {
    case kTCP:
      return new TcpReceiver();
    case kInterArrival:
      LOG(DFATAL) << "InterArrivalSendAlgorithm no longer supported.";
      return NULL;
    case kFixRate:
      return new FixRateReceiver();
  }
  return NULL;
}

}  // namespace net