OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 5 #ifndef NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
6 #define NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 6 #define NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // Returns the current delay for the retransmission timer, which may send | 158 // Returns the current delay for the retransmission timer, which may send |
159 // either a tail loss probe or do a full RTO. Returns QuicTime::Zero() if | 159 // either a tail loss probe or do a full RTO. Returns QuicTime::Zero() if |
160 // there are no retransmittable packets. | 160 // there are no retransmittable packets. |
161 const QuicTime GetRetransmissionTime() const; | 161 const QuicTime GetRetransmissionTime() const; |
162 | 162 |
163 const RttStats* GetRttStats() const; | 163 const RttStats* GetRttStats() const; |
164 | 164 |
165 // Returns the estimated bandwidth calculated by the congestion algorithm. | 165 // Returns the estimated bandwidth calculated by the congestion algorithm. |
166 QuicBandwidth BandwidthEstimate() const; | 166 QuicBandwidth BandwidthEstimate() const; |
167 | 167 |
| 168 // Returns true if the current bandwidth estimate is reliable. |
| 169 bool HasReliableBandwidthEstimate() const; |
| 170 |
168 // Returns the size of the current congestion window in bytes. Note, this is | 171 // Returns the size of the current congestion window in bytes. Note, this is |
169 // not the *available* window. Some send algorithms may not use a congestion | 172 // not the *available* window. Some send algorithms may not use a congestion |
170 // window and will return 0. | 173 // window and will return 0. |
171 QuicByteCount GetCongestionWindow() const; | 174 QuicByteCount GetCongestionWindow() const; |
172 | 175 |
173 // Enables pacing if it has not already been enabled, and if | 176 // Enables pacing if it has not already been enabled, and if |
174 // FLAGS_enable_quic_pacing is set. | 177 // FLAGS_enable_quic_pacing is set. |
175 void MaybeEnablePacing(); | 178 void MaybeEnablePacing(); |
176 | 179 |
177 bool using_pacing() const { return using_pacing_; } | 180 bool using_pacing() const { return using_pacing_; } |
178 | 181 |
179 void set_debug_delegate(DebugDelegate* debug_delegate) { | 182 void set_debug_delegate(DebugDelegate* debug_delegate) { |
180 debug_delegate_ = debug_delegate; | 183 debug_delegate_ = debug_delegate; |
181 } | 184 } |
182 | 185 |
| 186 QuicPacketSequenceNumber largest_observed() const { |
| 187 return largest_observed_; |
| 188 } |
| 189 |
183 private: | 190 private: |
184 friend class test::QuicConnectionPeer; | 191 friend class test::QuicConnectionPeer; |
185 friend class test::QuicSentPacketManagerPeer; | 192 friend class test::QuicSentPacketManagerPeer; |
186 | 193 |
187 // The retransmission timer is a single timer which switches modes depending | 194 // The retransmission timer is a single timer which switches modes depending |
188 // upon connection state. | 195 // upon connection state. |
189 enum RetransmissionTimeoutMode { | 196 enum RetransmissionTimeoutMode { |
190 // A conventional TCP style RTO. | 197 // A conventional TCP style RTO. |
191 RTO_MODE, | 198 RTO_MODE, |
192 // A tail loss probe. By default, QUIC sends up to two before RTOing. | 199 // A tail loss probe. By default, QUIC sends up to two before RTOing. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 // Sets of packets acked and lost as a result of the last congestion event. | 319 // Sets of packets acked and lost as a result of the last congestion event. |
313 SendAlgorithmInterface::CongestionMap packets_acked_; | 320 SendAlgorithmInterface::CongestionMap packets_acked_; |
314 SendAlgorithmInterface::CongestionMap packets_lost_; | 321 SendAlgorithmInterface::CongestionMap packets_lost_; |
315 | 322 |
316 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); | 323 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); |
317 }; | 324 }; |
318 | 325 |
319 } // namespace net | 326 } // namespace net |
320 | 327 |
321 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 328 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
OLD | NEW |