| Index: net/quic/congestion_control/cubic_bytes.h
|
| diff --git a/net/quic/congestion_control/cubic.h b/net/quic/congestion_control/cubic_bytes.h
|
| similarity index 61%
|
| copy from net/quic/congestion_control/cubic.h
|
| copy to net/quic/congestion_control/cubic_bytes.h
|
| index c0adad4431e74c6b375959b909979533a7cb5e68..1df9f374c0ac89819b9bb8e151f3502095447d3b 100644
|
| --- a/net/quic/congestion_control/cubic.h
|
| +++ b/net/quic/congestion_control/cubic_bytes.h
|
| @@ -1,12 +1,12 @@
|
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2015 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.
|
| -//
|
| +
|
| // Cubic algorithm, helper class to TCP cubic.
|
| // For details see http://netsrv.csc.ncsu.edu/export/cubic_a_new_tcp_2008.pdf.
|
|
|
| -#ifndef NET_QUIC_CONGESTION_CONTROL_CUBIC_H_
|
| -#define NET_QUIC_CONGESTION_CONTROL_CUBIC_H_
|
| +#ifndef NET_QUIC_CONGESTION_CONTROL_CUBIC_BYTES_H_
|
| +#define NET_QUIC_CONGESTION_CONTROL_CUBIC_BYTES_H_
|
|
|
| #include "base/basictypes.h"
|
| #include "net/base/net_export.h"
|
| @@ -17,9 +17,9 @@
|
|
|
| namespace net {
|
|
|
| -class NET_EXPORT_PRIVATE Cubic {
|
| +class NET_EXPORT_PRIVATE CubicBytes {
|
| public:
|
| - explicit Cubic(const QuicClock* clock);
|
| + explicit CubicBytes(const QuicClock* clock);
|
|
|
| void SetNumConnections(int num_connections);
|
|
|
| @@ -29,14 +29,15 @@ class NET_EXPORT_PRIVATE Cubic {
|
| // Compute a new congestion window to use after a loss event.
|
| // Returns the new congestion window in packets. The new congestion window is
|
| // a multiplicative decrease of our current window.
|
| - QuicPacketCount CongestionWindowAfterPacketLoss(QuicPacketCount current);
|
| + QuicByteCount CongestionWindowAfterPacketLoss(QuicPacketCount current);
|
|
|
| // Compute a new congestion window to use after a received ACK.
|
| - // Returns the new congestion window in packets. The new congestion window
|
| - // follows a cubic function that depends on the time passed since last
|
| - // packet loss.
|
| - QuicPacketCount CongestionWindowAfterAck(QuicPacketCount current,
|
| - QuicTime::Delta delay_min);
|
| + // Returns the new congestion window in bytes. The new congestion window
|
| + // follows a cubic function that depends on the time passed since last packet
|
| + // loss.
|
| + QuicByteCount CongestionWindowAfterAck(QuicByteCount acked_bytes,
|
| + QuicByteCount current,
|
| + QuicTime::Delta delay_min);
|
|
|
| private:
|
| static const QuicTime::Delta MaxCubicTimeInterval() {
|
| @@ -59,32 +60,32 @@ class NET_EXPORT_PRIVATE Cubic {
|
| // Time when we updated last_congestion_window.
|
| QuicTime last_update_time_;
|
|
|
| - // Last congestion window (in packets) used.
|
| - QuicPacketCount last_congestion_window_;
|
| + // Last congestion window used.
|
| + QuicByteCount last_congestion_window_;
|
|
|
| - // Max congestion window (in packets) used just before last loss event.
|
| + // Max congestion window used just before last loss event.
|
| // Note: to improve fairness to other streams an additional back off is
|
| // applied to this value if the new value is below our latest value.
|
| - QuicPacketCount last_max_congestion_window_;
|
| + QuicByteCount last_max_congestion_window_;
|
|
|
| - // Number of acked packets since the cycle started (epoch).
|
| - QuicPacketCount acked_packets_count_;
|
| + // Number of acked bytes since the cycle started (epoch).
|
| + QuicByteCount acked_bytes_count_;
|
|
|
| // TCP Reno equivalent congestion window in packets.
|
| - QuicPacketCount estimated_tcp_congestion_window_;
|
| + QuicByteCount estimated_tcp_congestion_window_;
|
|
|
| // Origin point of cubic function.
|
| - QuicPacketCount origin_point_congestion_window_;
|
| + QuicByteCount origin_point_congestion_window_;
|
|
|
| // Time to origin point of cubic function in 2^10 fractions of a second.
|
| uint32 time_to_origin_point_;
|
|
|
| // Last congestion window in packets computed by cubic function.
|
| - QuicPacketCount last_target_congestion_window_;
|
| + QuicByteCount last_target_congestion_window_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(Cubic);
|
| + DISALLOW_COPY_AND_ASSIGN(CubicBytes);
|
| };
|
|
|
| } // namespace net
|
|
|
| -#endif // NET_QUIC_CONGESTION_CONTROL_CUBIC_H_
|
| +#endif // NET_QUIC_CONGESTION_CONTROL_CUBIC_BYTES_H_
|
|
|