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

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

Issue 2193073003: Move shared files in net/quic/ into net/quic/core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: io_thread_unittest.cc Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/congestion_control/prr_sender.h ('k') | net/quic/congestion_control/prr_sender_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/congestion_control/prr_sender.cc
diff --git a/net/quic/congestion_control/prr_sender.cc b/net/quic/congestion_control/prr_sender.cc
deleted file mode 100644
index b3f5f8b0337920e73e16a65a7e5093cea007cbab..0000000000000000000000000000000000000000
--- a/net/quic/congestion_control/prr_sender.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/quic/congestion_control/prr_sender.h"
-
-#include "net/quic/quic_protocol.h"
-
-namespace net {
-
-namespace {
-// Constant based on TCP defaults.
-const QuicByteCount kMaxSegmentSize = kDefaultTCPMSS;
-} // namespace
-
-PrrSender::PrrSender()
- : bytes_sent_since_loss_(0),
- bytes_delivered_since_loss_(0),
- ack_count_since_loss_(0),
- bytes_in_flight_before_loss_(0) {}
-
-void PrrSender::OnPacketSent(QuicByteCount sent_bytes) {
- bytes_sent_since_loss_ += sent_bytes;
-}
-
-void PrrSender::OnPacketLost(QuicByteCount bytes_in_flight) {
- bytes_sent_since_loss_ = 0;
- bytes_in_flight_before_loss_ = bytes_in_flight;
- bytes_delivered_since_loss_ = 0;
- ack_count_since_loss_ = 0;
-}
-
-void PrrSender::OnPacketAcked(QuicByteCount acked_bytes) {
- bytes_delivered_since_loss_ += acked_bytes;
- ++ack_count_since_loss_;
-}
-
-QuicTime::Delta PrrSender::TimeUntilSend(
- QuicByteCount congestion_window,
- QuicByteCount bytes_in_flight,
- QuicByteCount slowstart_threshold) const {
- // if (FLAGS_?? && bytes_in_flight < congestion_window) {
- // return QuicTime::Delta::Zero();
- // }
- // Return QuicTime::Zero In order to ensure limited transmit always works.
- if (bytes_sent_since_loss_ == 0 || bytes_in_flight < kMaxSegmentSize) {
- return QuicTime::Delta::Zero();
- }
- if (congestion_window > bytes_in_flight) {
- // During PRR-SSRB, limit outgoing packets to 1 extra MSS per ack, instead
- // of sending the entire available window. This prevents burst retransmits
- // when more packets are lost than the CWND reduction.
- // limit = MAX(prr_delivered - prr_out, DeliveredData) + MSS
- if (bytes_delivered_since_loss_ + ack_count_since_loss_ * kMaxSegmentSize <=
- bytes_sent_since_loss_) {
- return QuicTime::Delta::Infinite();
- }
- return QuicTime::Delta::Zero();
- }
- // Implement Proportional Rate Reduction (RFC6937).
- // Checks a simplified version of the PRR formula that doesn't use division:
- // AvailableSendWindow =
- // CEIL(prr_delivered * ssthresh / BytesInFlightAtLoss) - prr_sent
- if (bytes_delivered_since_loss_ * slowstart_threshold >
- bytes_sent_since_loss_ * bytes_in_flight_before_loss_) {
- return QuicTime::Delta::Zero();
- }
- return QuicTime::Delta::Infinite();
-}
-
-} // namespace net
« no previous file with comments | « net/quic/congestion_control/prr_sender.h ('k') | net/quic/congestion_control/prr_sender_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698