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

Side by Side Diff: net/quic/congestion_control/send_algorithm_interface.h

Issue 684043002: Protect against the divide by zero error in QuicBandwidth::TransferTime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Add_QUIC_connection_option_NTLP_78465187
Patch Set: Created 6 years, 1 month 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/quic_bandwidth.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 (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 // The pure virtual class for send side congestion control algorithm. 5 // The pure virtual class for send side congestion control algorithm.
6 6
7 #ifndef NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ 7 #ifndef NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_
8 #define NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ 8 #define NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 // Called when the last retransmission timeout was spurious. 76 // Called when the last retransmission timeout was spurious.
77 virtual void RevertRetransmissionTimeout() = 0; 77 virtual void RevertRetransmissionTimeout() = 0;
78 78
79 // Calculate the time until we can send the next packet. 79 // Calculate the time until we can send the next packet.
80 virtual QuicTime::Delta TimeUntilSend( 80 virtual QuicTime::Delta TimeUntilSend(
81 QuicTime now, 81 QuicTime now,
82 QuicByteCount bytes_in_flight, 82 QuicByteCount bytes_in_flight,
83 HasRetransmittableData has_retransmittable_data) const = 0; 83 HasRetransmittableData has_retransmittable_data) const = 0;
84 84
85 // The pacing rate of the send algorithm. May be zero if the rate is unknown.
85 virtual QuicBandwidth PacingRate() const = 0; 86 virtual QuicBandwidth PacingRate() const = 0;
86 87
87 // What's the current estimated bandwidth in bytes per second. 88 // What's the current estimated bandwidth in bytes per second.
88 // Returns 0 when it does not have an estimate. 89 // Returns 0 when it does not have an estimate.
89 virtual QuicBandwidth BandwidthEstimate() const = 0; 90 virtual QuicBandwidth BandwidthEstimate() const = 0;
90 91
91 // Returns true if the current bandwidth estimate is reliable. 92 // Returns true if the current bandwidth estimate is reliable.
92 virtual bool HasReliableBandwidthEstimate() const = 0; 93 virtual bool HasReliableBandwidthEstimate() const = 0;
93 94
94 // Get the send algorithm specific retransmission delay, called RTO in TCP, 95 // Get the send algorithm specific retransmission delay, called RTO in TCP,
(...skipping 17 matching lines...) Expand all
112 // aka ssthresh. Some send algorithms do not define a slow start 113 // aka ssthresh. Some send algorithms do not define a slow start
113 // threshold and will return 0. 114 // threshold and will return 0.
114 virtual QuicByteCount GetSlowStartThreshold() const = 0; 115 virtual QuicByteCount GetSlowStartThreshold() const = 0;
115 116
116 virtual CongestionControlType GetCongestionControlType() const = 0; 117 virtual CongestionControlType GetCongestionControlType() const = 0;
117 }; 118 };
118 119
119 } // namespace net 120 } // namespace net
120 121
121 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_ 122 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_INTERFACE_H_
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_bandwidth.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698