| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 } | 90 } |
| 91 | 91 |
| 92 QuicSentPacketManager::~QuicSentPacketManager() { | 92 QuicSentPacketManager::~QuicSentPacketManager() { |
| 93 } | 93 } |
| 94 | 94 |
| 95 void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) { | 95 void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) { |
| 96 if (config.HasReceivedInitialRoundTripTimeUs() && | 96 if (config.HasReceivedInitialRoundTripTimeUs() && |
| 97 config.ReceivedInitialRoundTripTimeUs() > 0) { | 97 config.ReceivedInitialRoundTripTimeUs() > 0) { |
| 98 rtt_stats_.set_initial_rtt_us(min(kMaxInitialRoundTripTimeUs, | 98 rtt_stats_.set_initial_rtt_us(min(kMaxInitialRoundTripTimeUs, |
| 99 config.ReceivedInitialRoundTripTimeUs())); | 99 config.ReceivedInitialRoundTripTimeUs())); |
| 100 } else if (config.HasInitialRoundTripTimeUsToSend()) { |
| 101 rtt_stats_.set_initial_rtt_us( |
| 102 min(kMaxInitialRoundTripTimeUs, |
| 103 config.GetInitialRoundTripTimeUsToSend())); |
| 100 } | 104 } |
| 101 // TODO(ianswett): BBR is currently a server only feature. | 105 // TODO(ianswett): BBR is currently a server only feature. |
| 102 if (config.HasReceivedConnectionOptions() && | 106 if (config.HasReceivedConnectionOptions() && |
| 103 ContainsQuicTag(config.ReceivedConnectionOptions(), kTBBR)) { | 107 ContainsQuicTag(config.ReceivedConnectionOptions(), kTBBR)) { |
| 104 if (FLAGS_quic_recent_min_rtt_window_s > 0) { | 108 if (FLAGS_quic_recent_min_rtt_window_s > 0) { |
| 105 rtt_stats_.set_recent_min_rtt_window( | 109 rtt_stats_.set_recent_min_rtt_window( |
| 106 QuicTime::Delta::FromSeconds(FLAGS_quic_recent_min_rtt_window_s)); | 110 QuicTime::Delta::FromSeconds(FLAGS_quic_recent_min_rtt_window_s)); |
| 107 } | 111 } |
| 108 send_algorithm_.reset( | 112 send_algorithm_.reset( |
| 109 SendAlgorithmInterface::Create(clock_, &rtt_stats_, kBBR, stats_)); | 113 SendAlgorithmInterface::Create(clock_, &rtt_stats_, kBBR, stats_)); |
| (...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 | 875 |
| 872 // Set up a pacing sender with a 5 millisecond alarm granularity. | 876 // Set up a pacing sender with a 5 millisecond alarm granularity. |
| 873 using_pacing_ = true; | 877 using_pacing_ = true; |
| 874 send_algorithm_.reset( | 878 send_algorithm_.reset( |
| 875 new PacingSender(send_algorithm_.release(), | 879 new PacingSender(send_algorithm_.release(), |
| 876 QuicTime::Delta::FromMilliseconds(5), | 880 QuicTime::Delta::FromMilliseconds(5), |
| 877 kInitialUnpacedBurst)); | 881 kInitialUnpacedBurst)); |
| 878 } | 882 } |
| 879 | 883 |
| 880 } // namespace net | 884 } // namespace net |
| OLD | NEW |