OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/congestion_control/loss_detection_interface.h" | 5 #include "net/quic/congestion_control/loss_detection_interface.h" |
6 | 6 |
7 #include "net/quic/congestion_control/general_loss_algorithm.h" | 7 #include "net/quic/congestion_control/general_loss_algorithm.h" |
8 #include "net/quic/congestion_control/tcp_loss_algorithm.h" | |
9 #include "net/quic/congestion_control/time_loss_algorithm.h" | |
10 #include "net/quic/quic_bug_tracker.h" | 8 #include "net/quic/quic_bug_tracker.h" |
11 #include "net/quic/quic_flags.h" | 9 #include "net/quic/quic_flags.h" |
12 | 10 |
13 namespace net { | 11 namespace net { |
14 | 12 |
15 // Factory for loss detection algorithm. | 13 // Factory for loss detection algorithm. |
16 LossDetectionInterface* LossDetectionInterface::Create( | 14 LossDetectionInterface* LossDetectionInterface::Create( |
17 LossDetectionType loss_type) { | 15 LossDetectionType loss_type) { |
18 if (FLAGS_quic_general_loss_algorithm) { | 16 return new GeneralLossAlgorithm(loss_type); |
19 return new GeneralLossAlgorithm(loss_type); | |
20 } | |
21 switch (loss_type) { | |
22 case kNack: | |
23 return new TCPLossAlgorithm(); | |
24 case kTime: | |
25 return new TimeLossAlgorithm(); | |
26 } | |
27 QUIC_BUG << "Unknown loss detection algorithm:" << loss_type; | |
28 return nullptr; | |
29 } | 17 } |
30 | 18 |
31 } // namespace net | 19 } // namespace net |
OLD | NEW |