Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Side by Side Diff: net/quic/quic_sent_packet_manager.cc

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_stream_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
90 using_pacing_(false), 90 using_pacing_(false),
91 handshake_confirmed_(false) { 91 handshake_confirmed_(false) {
92 } 92 }
93 93
94 QuicSentPacketManager::~QuicSentPacketManager() { 94 QuicSentPacketManager::~QuicSentPacketManager() {
95 } 95 }
96 96
97 void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) { 97 void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) {
98 if (config.HasReceivedInitialRoundTripTimeUs() && 98 if (config.HasReceivedInitialRoundTripTimeUs() &&
99 config.ReceivedInitialRoundTripTimeUs() > 0) { 99 config.ReceivedInitialRoundTripTimeUs() > 0) {
100 rtt_stats_.set_initial_rtt_us(min(kMaxInitialRoundTripTimeUs,
101 config.ReceivedInitialRoundTripTimeUs()));
102 } else if (config.HasInitialRoundTripTimeUsToSend()) {
103 rtt_stats_.set_initial_rtt_us( 100 rtt_stats_.set_initial_rtt_us(
104 min(kMaxInitialRoundTripTimeUs, 101 max(kMinInitialRoundTripTimeUs,
105 config.GetInitialRoundTripTimeUsToSend())); 102 min(kMaxInitialRoundTripTimeUs,
103 config.ReceivedInitialRoundTripTimeUs())));
104 } else if (config.HasInitialRoundTripTimeUsToSend() &&
105 config.GetInitialRoundTripTimeUsToSend() > 0) {
106 rtt_stats_.set_initial_rtt_us(
107 max(kMinInitialRoundTripTimeUs,
108 min(kMaxInitialRoundTripTimeUs,
109 config.GetInitialRoundTripTimeUsToSend())));
106 } 110 }
107 // TODO(ianswett): BBR is currently a server only feature. 111 // TODO(ianswett): BBR is currently a server only feature.
108 if (FLAGS_quic_allow_bbr && 112 if (FLAGS_quic_allow_bbr &&
109 config.HasReceivedConnectionOptions() && 113 config.HasReceivedConnectionOptions() &&
110 ContainsQuicTag(config.ReceivedConnectionOptions(), kTBBR)) { 114 ContainsQuicTag(config.ReceivedConnectionOptions(), kTBBR)) {
111 if (FLAGS_quic_recent_min_rtt_window_s > 0) { 115 if (FLAGS_quic_recent_min_rtt_window_s > 0) {
112 rtt_stats_.set_recent_min_rtt_window( 116 rtt_stats_.set_recent_min_rtt_window(
113 QuicTime::Delta::FromSeconds(FLAGS_quic_recent_min_rtt_window_s)); 117 QuicTime::Delta::FromSeconds(FLAGS_quic_recent_min_rtt_window_s));
114 } 118 }
115 send_algorithm_.reset( 119 send_algorithm_.reset(
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as 910 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as
907 // the default granularity of the Linux kernel's FQ qdisc. 911 // the default granularity of the Linux kernel's FQ qdisc.
908 using_pacing_ = true; 912 using_pacing_ = true;
909 send_algorithm_.reset( 913 send_algorithm_.reset(
910 new PacingSender(send_algorithm_.release(), 914 new PacingSender(send_algorithm_.release(),
911 QuicTime::Delta::FromMilliseconds(1), 915 QuicTime::Delta::FromMilliseconds(1),
912 kInitialUnpacedBurst)); 916 kInitialUnpacedBurst));
913 } 917 }
914 918
915 } // namespace net 919 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_stream_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698