| 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/core/quic_sent_packet_manager.h" | 5 #include "net/quic/core/quic_sent_packet_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 SetSendAlgorithm(kBBR); | 116 SetSendAlgorithm(kBBR); |
| 117 } | 117 } |
| 118 if (config.HasClientRequestedIndependentOption(kRENO, perspective_)) { | 118 if (config.HasClientRequestedIndependentOption(kRENO, perspective_)) { |
| 119 if (config.HasClientRequestedIndependentOption(kBYTE, perspective_)) { | 119 if (config.HasClientRequestedIndependentOption(kBYTE, perspective_)) { |
| 120 SetSendAlgorithm(kRenoBytes); | 120 SetSendAlgorithm(kRenoBytes); |
| 121 } else { | 121 } else { |
| 122 SetSendAlgorithm(kReno); | 122 SetSendAlgorithm(kReno); |
| 123 } | 123 } |
| 124 } else if (config.HasClientRequestedIndependentOption(kBYTE, | 124 } else if (config.HasClientRequestedIndependentOption(kBYTE, |
| 125 perspective_)) { | 125 perspective_)) { |
| 126 if (FLAGS_quic_default_enable_cubic_bytes) { | 126 SetSendAlgorithm(kCubic); |
| 127 SetSendAlgorithm(kCubic); | |
| 128 } else { | |
| 129 SetSendAlgorithm(kCubicBytes); | |
| 130 } | |
| 131 } | 127 } |
| 132 } else { | 128 } else { |
| 133 if (FLAGS_quic_allow_new_bbr && config.HasReceivedConnectionOptions() && | 129 if (FLAGS_quic_allow_new_bbr && config.HasReceivedConnectionOptions() && |
| 134 ContainsQuicTag(config.ReceivedConnectionOptions(), kTBBR)) { | 130 ContainsQuicTag(config.ReceivedConnectionOptions(), kTBBR)) { |
| 135 SetSendAlgorithm(kBBR); | 131 SetSendAlgorithm(kBBR); |
| 136 } | 132 } |
| 137 if (config.HasReceivedConnectionOptions() && | 133 if (config.HasReceivedConnectionOptions() && |
| 138 ContainsQuicTag(config.ReceivedConnectionOptions(), kRENO)) { | 134 ContainsQuicTag(config.ReceivedConnectionOptions(), kRENO)) { |
| 139 if (ContainsQuicTag(config.ReceivedConnectionOptions(), kBYTE)) { | 135 if (ContainsQuicTag(config.ReceivedConnectionOptions(), kBYTE)) { |
| 140 SetSendAlgorithm(kRenoBytes); | 136 SetSendAlgorithm(kRenoBytes); |
| 141 } else { | 137 } else { |
| 142 SetSendAlgorithm(kReno); | 138 SetSendAlgorithm(kReno); |
| 143 } | 139 } |
| 144 } else if (config.HasReceivedConnectionOptions() && | 140 } else if (config.HasReceivedConnectionOptions() && |
| 145 ContainsQuicTag(config.ReceivedConnectionOptions(), kBYTE)) { | 141 ContainsQuicTag(config.ReceivedConnectionOptions(), kBYTE)) { |
| 146 if (FLAGS_quic_default_enable_cubic_bytes) { | 142 SetSendAlgorithm(kCubic); |
| 147 SetSendAlgorithm(kCubic); | |
| 148 } else { | |
| 149 SetSendAlgorithm(kCubicBytes); | |
| 150 } | |
| 151 } | 143 } |
| 152 } | 144 } |
| 153 using_pacing_ = !FLAGS_quic_disable_pacing_for_perf_tests; | 145 using_pacing_ = !FLAGS_quic_disable_pacing_for_perf_tests; |
| 154 | 146 |
| 155 if (config.HasClientSentConnectionOption(k1CON, perspective_)) { | 147 if (config.HasClientSentConnectionOption(k1CON, perspective_)) { |
| 156 send_algorithm_->SetNumEmulatedConnections(1); | 148 send_algorithm_->SetNumEmulatedConnections(1); |
| 157 } | 149 } |
| 158 if (config.HasClientSentConnectionOption(kNCON, perspective_)) { | 150 if (config.HasClientSentConnectionOption(kNCON, perspective_)) { |
| 159 n_connection_simulation_ = true; | 151 n_connection_simulation_ = true; |
| 160 } | 152 } |
| (...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1024 | 1016 |
| 1025 void QuicSentPacketManager::OnApplicationLimited() { | 1017 void QuicSentPacketManager::OnApplicationLimited() { |
| 1026 send_algorithm_->OnApplicationLimited(unacked_packets_.bytes_in_flight()); | 1018 send_algorithm_->OnApplicationLimited(unacked_packets_.bytes_in_flight()); |
| 1027 } | 1019 } |
| 1028 | 1020 |
| 1029 const SendAlgorithmInterface* QuicSentPacketManager::GetSendAlgorithm() const { | 1021 const SendAlgorithmInterface* QuicSentPacketManager::GetSendAlgorithm() const { |
| 1030 return send_algorithm_.get(); | 1022 return send_algorithm_.get(); |
| 1031 } | 1023 } |
| 1032 | 1024 |
| 1033 } // namespace net | 1025 } // namespace net |
| OLD | NEW |