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

Unified Diff: net/quic/congestion_control/tcp_cubic_sender.cc

Issue 47283002: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compilation error Created 7 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/congestion_control/tcp_cubic_sender.cc
diff --git a/net/quic/congestion_control/tcp_cubic_sender.cc b/net/quic/congestion_control/tcp_cubic_sender.cc
index 14804a993f18b8479357abd600f71b825e42cb44..0a7a89743dc3b8bf992dc9c4a3ad5a044dc0c003 100644
--- a/net/quic/congestion_control/tcp_cubic_sender.cc
+++ b/net/quic/congestion_control/tcp_cubic_sender.cc
@@ -12,6 +12,8 @@ namespace net {
namespace {
// Constants based on TCP defaults.
+//TODO(rch): set to 2.
+const QuicTcpCongestionWindow kMinimumCongestionWindow = 1;
const int64 kHybridStartLowWindow = 16;
const QuicByteCount kMaxSegmentSize = kDefaultTCPMSS;
const QuicByteCount kDefaultReceiveWindow = 64000;
@@ -94,7 +96,7 @@ void TcpCubicSender::OnIncomingLoss(QuicTime /*ack_receive_time*/) {
}
// Sanity, make sure that we don't end up with an empty window.
if (congestion_window_ == 0) {
- congestion_window_ = 1;
+ congestion_window_ = kMinimumCongestionWindow;
}
DLOG(INFO) << "Incoming loss; congestion window:" << congestion_window_;
}
@@ -155,8 +157,7 @@ QuicByteCount TcpCubicSender::AvailableSendWindow() {
QuicByteCount TcpCubicSender::SendWindow() {
// What's the current send window in bytes.
- return std::min(receive_window_,
- congestion_window_ * kMaxSegmentSize);
+ return std::min(receive_window_, GetCongestionWindow());
}
QuicBandwidth TcpCubicSender::BandwidthEstimate() {
@@ -178,6 +179,17 @@ QuicTime::Delta TcpCubicSender::RetransmissionDelay() {
smoothed_rtt_.ToMicroseconds() + 4 * mean_deviation_.ToMicroseconds());
}
+QuicByteCount TcpCubicSender::GetCongestionWindow() {
+ return congestion_window_ * kMaxSegmentSize;
+}
+
+void TcpCubicSender::SetCongestionWindow(QuicByteCount window) {
+ congestion_window_ = window / kMaxSegmentSize;
+ if (congestion_window_ < kMinimumCongestionWindow) {
+ congestion_window_ = kMinimumCongestionWindow;
+ }
+}
+
void TcpCubicSender::Reset() {
delay_min_ = QuicTime::Delta::Zero();
hybrid_slow_start_.Restart();
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender.h ('k') | net/quic/congestion_control/tcp_cubic_sender_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698