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

Side by Side Diff: net/quic/congestion_control/tcp_cubic_sender.cc

Issue 606503004: Add a QUIC tag to connection options to allow negotiating 1 connection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Allow_number_of_connections_76297032
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | net/quic/crypto/crypto_protocol.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/congestion_control/tcp_cubic_sender.h" 5 #include "net/quic/congestion_control/tcp_cubic_sender.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "net/quic/congestion_control/rtt_stats.h" 10 #include "net/quic/congestion_control/rtt_stats.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 config.ReceivedInitialCongestionWindow()); 72 config.ReceivedInitialCongestionWindow());
73 } 73 }
74 } 74 }
75 if (config.HasReceivedSocketReceiveBuffer()) { 75 if (config.HasReceivedSocketReceiveBuffer()) {
76 // Set the initial socket receive buffer size in bytes. 76 // Set the initial socket receive buffer size in bytes.
77 receive_window_ = config.ReceivedSocketReceiveBuffer(); 77 receive_window_ = config.ReceivedSocketReceiveBuffer();
78 } 78 }
79 } 79 }
80 80
81 void TcpCubicSender::SetNumEmulatedConnections(int num_connections) { 81 void TcpCubicSender::SetNumEmulatedConnections(int num_connections) {
82 num_connections_ = num_connections; 82 num_connections_ = max(1, num_connections);
83 cubic_.SetNumConnections(num_connections); 83 cubic_.SetNumConnections(num_connections_);
84 } 84 }
85 85
86 void TcpCubicSender::OnIncomingQuicCongestionFeedbackFrame( 86 void TcpCubicSender::OnIncomingQuicCongestionFeedbackFrame(
87 const QuicCongestionFeedbackFrame& feedback, 87 const QuicCongestionFeedbackFrame& feedback,
88 QuicTime feedback_receive_time) { 88 QuicTime feedback_receive_time) {
89 if (feedback.type == kTCP) { 89 if (feedback.type == kTCP) {
90 receive_window_ = feedback.tcp.receive_window; 90 receive_window_ = feedback.tcp.receive_window;
91 } 91 }
92 } 92 }
93 93
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 return QuicTime::Delta::Zero(); 361 return QuicTime::Delta::Zero();
362 } 362 }
363 return QuicTime::Delta::Infinite(); 363 return QuicTime::Delta::Infinite();
364 } 364 }
365 365
366 CongestionControlType TcpCubicSender::GetCongestionControlType() const { 366 CongestionControlType TcpCubicSender::GetCongestionControlType() const {
367 return reno_ ? kReno : kCubic; 367 return reno_ ? kReno : kCubic;
368 } 368 }
369 369
370 } // namespace net 370 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/crypto/crypto_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698