| 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> |
| 11 #include <queue> | 11 #include <queue> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <utility> | 13 #include <utility> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/containers/hash_tables.h" | 16 #include "base/containers/hash_tables.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "net/base/linked_hash_map.h" | 18 #include "net/base/linked_hash_map.h" |
| 19 #include "net/quic/congestion_control/loss_detection_interface.h" | 19 #include "net/quic/congestion_control/loss_detection_interface.h" |
| 20 #include "net/quic/congestion_control/rtt_stats.h" | 20 #include "net/quic/congestion_control/rtt_stats.h" |
| 21 #include "net/quic/congestion_control/send_algorithm_interface.h" | 21 #include "net/quic/congestion_control/send_algorithm_interface.h" |
| 22 #include "net/quic/quic_ack_notifier_manager.h" | 22 #include "net/quic/quic_ack_notifier_manager.h" |
| 23 #include "net/quic/quic_protocol.h" | 23 #include "net/quic/quic_protocol.h" |
| 24 #include "net/quic/quic_sustained_bandwidth_recorder.h" |
| 24 #include "net/quic/quic_unacked_packet_map.h" | 25 #include "net/quic/quic_unacked_packet_map.h" |
| 25 | 26 |
| 26 namespace net { | 27 namespace net { |
| 27 | 28 |
| 28 namespace test { | 29 namespace test { |
| 29 class QuicConnectionPeer; | 30 class QuicConnectionPeer; |
| 30 class QuicSentPacketManagerPeer; | 31 class QuicSentPacketManagerPeer; |
| 31 } // namespace test | 32 } // namespace test |
| 32 | 33 |
| 33 class QuicClock; | 34 class QuicClock; |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // Returns the current delay for the retransmission timer, which may send | 191 // Returns the current delay for the retransmission timer, which may send |
| 191 // either a tail loss probe or do a full RTO. Returns QuicTime::Zero() if | 192 // either a tail loss probe or do a full RTO. Returns QuicTime::Zero() if |
| 192 // there are no retransmittable packets. | 193 // there are no retransmittable packets. |
| 193 const QuicTime GetRetransmissionTime() const; | 194 const QuicTime GetRetransmissionTime() const; |
| 194 | 195 |
| 195 const RttStats* GetRttStats() const; | 196 const RttStats* GetRttStats() const; |
| 196 | 197 |
| 197 // Returns the estimated bandwidth calculated by the congestion algorithm. | 198 // Returns the estimated bandwidth calculated by the congestion algorithm. |
| 198 QuicBandwidth BandwidthEstimate() const; | 199 QuicBandwidth BandwidthEstimate() const; |
| 199 | 200 |
| 200 // Returns true if the current bandwidth estimate is reliable. | 201 // Returns true if the current instantaneous bandwidth estimate is reliable. |
| 201 bool HasReliableBandwidthEstimate() const; | 202 bool HasReliableBandwidthEstimate() const; |
| 202 | 203 |
| 204 const QuicSustainedBandwidthRecorder& SustainedBandwidthRecorder() const; |
| 205 |
| 203 // Returns the size of the current congestion window in bytes. Note, this is | 206 // Returns the size of the current congestion window in bytes. Note, this is |
| 204 // not the *available* window. Some send algorithms may not use a congestion | 207 // not the *available* window. Some send algorithms may not use a congestion |
| 205 // window and will return 0. | 208 // window and will return 0. |
| 206 QuicByteCount GetCongestionWindow() const; | 209 QuicByteCount GetCongestionWindow() const; |
| 207 | 210 |
| 208 // Returns the size of the slow start congestion window in bytes, | 211 // Returns the size of the slow start congestion window in bytes, |
| 209 // aka ssthresh. Some send algorithms do not define a slow start | 212 // aka ssthresh. Some send algorithms do not define a slow start |
| 210 // threshold and will return 0. | 213 // threshold and will return 0. |
| 211 QuicByteCount GetSlowStartThreshold() const; | 214 QuicByteCount GetSlowStartThreshold() const; |
| 212 | 215 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 // Sets of packets acked and lost as a result of the last congestion event. | 373 // Sets of packets acked and lost as a result of the last congestion event. |
| 371 SendAlgorithmInterface::CongestionMap packets_acked_; | 374 SendAlgorithmInterface::CongestionMap packets_acked_; |
| 372 SendAlgorithmInterface::CongestionMap packets_lost_; | 375 SendAlgorithmInterface::CongestionMap packets_lost_; |
| 373 | 376 |
| 374 // Set to true after the crypto handshake has successfully completed. After | 377 // Set to true after the crypto handshake has successfully completed. After |
| 375 // this is true we no longer use HANDSHAKE_MODE, and further frames sent on | 378 // this is true we no longer use HANDSHAKE_MODE, and further frames sent on |
| 376 // the crypto stream (i.e. SCUP messages) are treated like normal | 379 // the crypto stream (i.e. SCUP messages) are treated like normal |
| 377 // retransmittable frames. | 380 // retransmittable frames. |
| 378 bool handshake_confirmed_; | 381 bool handshake_confirmed_; |
| 379 | 382 |
| 383 // Records bandwidth from server to client in normal operation, over periods |
| 384 // of time with no loss events. |
| 385 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; |
| 386 |
| 380 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); | 387 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); |
| 381 }; | 388 }; |
| 382 | 389 |
| 383 } // namespace net | 390 } // namespace net |
| 384 | 391 |
| 385 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 392 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
| OLD | NEW |