OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/quic_sent_packet_manager.h" | 5 #include "net/quic/quic_sent_packet_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 QuicTime::Delta::FromSeconds(FLAGS_quic_recent_min_rtt_window_s)); | 106 QuicTime::Delta::FromSeconds(FLAGS_quic_recent_min_rtt_window_s)); |
107 } | 107 } |
108 send_algorithm_.reset( | 108 send_algorithm_.reset( |
109 SendAlgorithmInterface::Create(clock_, &rtt_stats_, kBBR, stats_)); | 109 SendAlgorithmInterface::Create(clock_, &rtt_stats_, kBBR, stats_)); |
110 } | 110 } |
111 if (config.HasReceivedConnectionOptions() && | 111 if (config.HasReceivedConnectionOptions() && |
112 ContainsQuicTag(config.ReceivedConnectionOptions(), kRENO)) { | 112 ContainsQuicTag(config.ReceivedConnectionOptions(), kRENO)) { |
113 send_algorithm_.reset( | 113 send_algorithm_.reset( |
114 SendAlgorithmInterface::Create(clock_, &rtt_stats_, kReno, stats_)); | 114 SendAlgorithmInterface::Create(clock_, &rtt_stats_, kReno, stats_)); |
115 } | 115 } |
116 if (config.congestion_feedback() == kPACE || | 116 if (config.HasReceivedConnectionOptions() && |
117 (config.HasReceivedConnectionOptions() && | 117 ContainsQuicTag(config.ReceivedConnectionOptions(), kPACE)) { |
118 ContainsQuicTag(config.ReceivedConnectionOptions(), kPACE))) { | |
119 MaybeEnablePacing(); | 118 MaybeEnablePacing(); |
120 } | 119 } |
121 // TODO(ianswett): Remove the "HasReceivedLossDetection" branch once | 120 // TODO(ianswett): Remove the "HasReceivedLossDetection" branch once |
122 // the ConnectionOptions code is live everywhere. | 121 // the ConnectionOptions code is live everywhere. |
123 if ((config.HasReceivedLossDetection() && | 122 if ((config.HasReceivedLossDetection() && |
124 config.ReceivedLossDetection() == kTIME) || | 123 config.ReceivedLossDetection() == kTIME) || |
125 (config.HasReceivedConnectionOptions() && | 124 (config.HasReceivedConnectionOptions() && |
126 ContainsQuicTag(config.ReceivedConnectionOptions(), kTIME))) { | 125 ContainsQuicTag(config.ReceivedConnectionOptions(), kTIME))) { |
127 loss_algorithm_.reset(LossDetectionInterface::Create(kTime)); | 126 loss_algorithm_.reset(LossDetectionInterface::Create(kTime)); |
128 } | 127 } |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 | 866 |
868 // Set up a pacing sender with a 5 millisecond alarm granularity. | 867 // Set up a pacing sender with a 5 millisecond alarm granularity. |
869 using_pacing_ = true; | 868 using_pacing_ = true; |
870 send_algorithm_.reset( | 869 send_algorithm_.reset( |
871 new PacingSender(send_algorithm_.release(), | 870 new PacingSender(send_algorithm_.release(), |
872 QuicTime::Delta::FromMilliseconds(5), | 871 QuicTime::Delta::FromMilliseconds(5), |
873 kInitialUnpacedBurst)); | 872 kInitialUnpacedBurst)); |
874 } | 873 } |
875 | 874 |
876 } // namespace net | 875 } // namespace net |
OLD | NEW |