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

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

Issue 357573004: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase with TOT Created 6 years, 5 months 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_headers_stream_test.cc ('k') | net/quic/quic_sent_packet_manager_test.cc » ('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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 QuicSentPacketManager::~QuicSentPacketManager() { 78 QuicSentPacketManager::~QuicSentPacketManager() {
79 } 79 }
80 80
81 void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) { 81 void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) {
82 if (config.HasReceivedInitialRoundTripTimeUs() && 82 if (config.HasReceivedInitialRoundTripTimeUs() &&
83 config.ReceivedInitialRoundTripTimeUs() > 0) { 83 config.ReceivedInitialRoundTripTimeUs() > 0) {
84 rtt_stats_.set_initial_rtt_us(min(kMaxInitialRoundTripTimeUs, 84 rtt_stats_.set_initial_rtt_us(min(kMaxInitialRoundTripTimeUs,
85 config.ReceivedInitialRoundTripTimeUs())); 85 config.ReceivedInitialRoundTripTimeUs()));
86 } 86 }
87 // TODO(ianswett): BBR is currently a server only feature. 87 // TODO(ianswett): BBR is currently a server only feature.
88 if (config.HasReceivedCongestionOptions() && 88 if (config.HasReceivedConnectionOptions() &&
89 ContainsQuicTag(config.ReceivedCongestionOptions(), kTBBR)) { 89 ContainsQuicTag(config.ReceivedConnectionOptions(), kTBBR)) {
90 send_algorithm_.reset( 90 send_algorithm_.reset(
91 SendAlgorithmInterface::Create(clock_, &rtt_stats_, kTCPBBR, stats_)); 91 SendAlgorithmInterface::Create(clock_, &rtt_stats_, kTCPBBR, stats_));
92 } 92 }
93 if (config.congestion_feedback() == kPACE) { 93 if (config.congestion_feedback() == kPACE ||
94 (config.HasReceivedConnectionOptions() &&
95 ContainsQuicTag(config.ReceivedConnectionOptions(), kPACE))) {
94 MaybeEnablePacing(); 96 MaybeEnablePacing();
95 } 97 }
96 if (config.HasReceivedLossDetection() && 98 // TODO(ianswett): Remove the "HasReceivedLossDetection" branch once
97 config.ReceivedLossDetection() == kTIME) { 99 // the ConnectionOptions code is live everywhere.
100 if ((config.HasReceivedLossDetection() &&
101 config.ReceivedLossDetection() == kTIME) ||
102 (config.HasReceivedConnectionOptions() &&
103 ContainsQuicTag(config.ReceivedConnectionOptions(), kTIME))) {
98 loss_algorithm_.reset(LossDetectionInterface::Create(kTime)); 104 loss_algorithm_.reset(LossDetectionInterface::Create(kTime));
99 } 105 }
100 send_algorithm_->SetFromConfig(config, is_server_); 106 send_algorithm_->SetFromConfig(config, is_server_);
101 } 107 }
102 108
103 // TODO(ianswett): Combine this method with OnPacketSent once packets are always 109 // TODO(ianswett): Combine this method with OnPacketSent once packets are always
104 // sent in order and the connection tracks RetransmittableFrames for longer. 110 // sent in order and the connection tracks RetransmittableFrames for longer.
105 void QuicSentPacketManager::OnSerializedPacket( 111 void QuicSentPacketManager::OnSerializedPacket(
106 const SerializedPacket& serialized_packet) { 112 const SerializedPacket& serialized_packet) {
107 if (serialized_packet.retransmittable_frames) { 113 if (serialized_packet.retransmittable_frames) {
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 } 782 }
777 783
778 // Set up a pacing sender with a 5 millisecond alarm granularity. 784 // Set up a pacing sender with a 5 millisecond alarm granularity.
779 using_pacing_ = true; 785 using_pacing_ = true;
780 send_algorithm_.reset( 786 send_algorithm_.reset(
781 new PacingSender(send_algorithm_.release(), 787 new PacingSender(send_algorithm_.release(),
782 QuicTime::Delta::FromMilliseconds(5))); 788 QuicTime::Delta::FromMilliseconds(5)));
783 } 789 }
784 790
785 } // namespace net 791 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_headers_stream_test.cc ('k') | net/quic/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698