| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 QuicSentPacketManager::~QuicSentPacketManager() { | 76 QuicSentPacketManager::~QuicSentPacketManager() { |
| 77 } | 77 } |
| 78 | 78 |
| 79 void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) { | 79 void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) { |
| 80 if (config.HasReceivedInitialRoundTripTimeUs() && | 80 if (config.HasReceivedInitialRoundTripTimeUs() && |
| 81 config.ReceivedInitialRoundTripTimeUs() > 0) { | 81 config.ReceivedInitialRoundTripTimeUs() > 0) { |
| 82 rtt_stats_.set_initial_rtt_us(min(kMaxInitialRoundTripTimeUs, | 82 rtt_stats_.set_initial_rtt_us(min(kMaxInitialRoundTripTimeUs, |
| 83 config.ReceivedInitialRoundTripTimeUs())); | 83 config.ReceivedInitialRoundTripTimeUs())); |
| 84 } | 84 } |
| 85 if (config.congestion_control() == kPACE) { | 85 // TODO(ianswett): BBR is currently a server only feature. |
| 86 if (config.HasReceivedCongestionOptions() && |
| 87 ContainsQuicTag(config.ReceivedCongestionOptions(), kTBBR)) { |
| 88 send_algorithm_.reset( |
| 89 SendAlgorithmInterface::Create(clock_, &rtt_stats_, kTCPBBR, stats_)); |
| 90 } |
| 91 if (config.congestion_feedback() == kPACE) { |
| 86 MaybeEnablePacing(); | 92 MaybeEnablePacing(); |
| 87 } | 93 } |
| 88 if (config.HasReceivedLossDetection() && | 94 if (config.HasReceivedLossDetection() && |
| 89 config.ReceivedLossDetection() == kTIME) { | 95 config.ReceivedLossDetection() == kTIME) { |
| 90 loss_algorithm_.reset(LossDetectionInterface::Create(kTime)); | 96 loss_algorithm_.reset(LossDetectionInterface::Create(kTime)); |
| 91 } | 97 } |
| 92 send_algorithm_->SetFromConfig(config, is_server_); | 98 send_algorithm_->SetFromConfig(config, is_server_); |
| 93 } | 99 } |
| 94 | 100 |
| 95 // TODO(ianswett): Combine this method with OnPacketSent once packets are always | 101 // TODO(ianswett): Combine this method with OnPacketSent once packets are always |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 return; | 737 return; |
| 732 } | 738 } |
| 733 | 739 |
| 734 using_pacing_ = true; | 740 using_pacing_ = true; |
| 735 send_algorithm_.reset( | 741 send_algorithm_.reset( |
| 736 new PacingSender(send_algorithm_.release(), | 742 new PacingSender(send_algorithm_.release(), |
| 737 QuicTime::Delta::FromMicroseconds(1))); | 743 QuicTime::Delta::FromMicroseconds(1))); |
| 738 } | 744 } |
| 739 | 745 |
| 740 } // namespace net | 746 } // namespace net |
| OLD | NEW |