| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // A send algorithm which adds pacing on top of an another send algorithm. | 5 // A send algorithm which adds pacing on top of an another send algorithm. |
| 6 // It uses the underlying sender's bandwidth estimate to determine the | 6 // It uses the underlying sender's bandwidth estimate to determine the |
| 7 // pacing rate to be used. It also takes into consideration the expected | 7 // pacing rate to be used. It also takes into consideration the expected |
| 8 // resolution of the underlying alarm mechanism to ensure that alarms are | 8 // resolution of the underlying alarm mechanism to ensure that alarms are |
| 9 // not set too aggressively, and to smooth out variations. | 9 // not set too aggressively, and to smooth out variations. |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 virtual void OnPacketAcked(QuicPacketSequenceNumber acked_sequence_number, | 40 virtual void OnPacketAcked(QuicPacketSequenceNumber acked_sequence_number, |
| 41 QuicByteCount acked_bytes, | 41 QuicByteCount acked_bytes, |
| 42 QuicTime::Delta rtt) OVERRIDE; | 42 QuicTime::Delta rtt) OVERRIDE; |
| 43 virtual void OnPacketLost(QuicPacketSequenceNumber sequence_number, | 43 virtual void OnPacketLost(QuicPacketSequenceNumber sequence_number, |
| 44 QuicTime ack_receive_time) OVERRIDE; | 44 QuicTime ack_receive_time) OVERRIDE; |
| 45 virtual bool OnPacketSent(QuicTime sent_time, | 45 virtual bool OnPacketSent(QuicTime sent_time, |
| 46 QuicPacketSequenceNumber sequence_number, | 46 QuicPacketSequenceNumber sequence_number, |
| 47 QuicByteCount bytes, | 47 QuicByteCount bytes, |
| 48 TransmissionType transmission_type, | 48 TransmissionType transmission_type, |
| 49 HasRetransmittableData is_retransmittable) OVERRIDE; | 49 HasRetransmittableData is_retransmittable) OVERRIDE; |
| 50 virtual void OnRetransmissionTimeout() OVERRIDE; | 50 virtual void OnRetransmissionTimeout(bool packets_retransmitted) OVERRIDE; |
| 51 virtual void OnPacketAbandoned(QuicPacketSequenceNumber sequence_number, | 51 virtual void OnPacketAbandoned(QuicPacketSequenceNumber sequence_number, |
| 52 QuicByteCount abandoned_bytes) OVERRIDE; | 52 QuicByteCount abandoned_bytes) OVERRIDE; |
| 53 virtual QuicTime::Delta TimeUntilSend( | 53 virtual QuicTime::Delta TimeUntilSend( |
| 54 QuicTime now, | 54 QuicTime now, |
| 55 TransmissionType transmission_type, | 55 TransmissionType transmission_type, |
| 56 HasRetransmittableData has_retransmittable_data, | 56 HasRetransmittableData has_retransmittable_data, |
| 57 IsHandshake handshake) OVERRIDE; | 57 IsHandshake handshake) OVERRIDE; |
| 58 virtual QuicBandwidth BandwidthEstimate() const OVERRIDE; | 58 virtual QuicBandwidth BandwidthEstimate() const OVERRIDE; |
| 59 virtual QuicTime::Delta SmoothedRtt() const OVERRIDE; | 59 virtual QuicTime::Delta SmoothedRtt() const OVERRIDE; |
| 60 virtual QuicTime::Delta RetransmissionDelay() const OVERRIDE; | 60 virtual QuicTime::Delta RetransmissionDelay() const OVERRIDE; |
| 61 virtual QuicByteCount GetCongestionWindow() const OVERRIDE; | 61 virtual QuicByteCount GetCongestionWindow() const OVERRIDE; |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 QuicTime::Delta GetTransferTime(QuicByteCount bytes); | 64 QuicTime::Delta GetTransferTime(QuicByteCount bytes); |
| 65 | 65 |
| 66 scoped_ptr<SendAlgorithmInterface> sender_; // Underlying sender. | 66 scoped_ptr<SendAlgorithmInterface> sender_; // Underlying sender. |
| 67 QuicTime::Delta alarm_granularity_; | 67 QuicTime::Delta alarm_granularity_; |
| 68 QuicTime next_packet_send_time_; // When can the next packet be sent. | 68 QuicTime next_packet_send_time_; // When can the next packet be sent. |
| 69 bool was_last_send_delayed_; // True when the last send was delayed. | 69 bool was_last_send_delayed_; // True when the last send was delayed. |
| 70 QuicByteCount max_segment_size_; | 70 QuicByteCount max_segment_size_; |
| 71 | 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(PacingSender); | 72 DISALLOW_COPY_AND_ASSIGN(PacingSender); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace net | 75 } // namespace net |
| 76 | 76 |
| 77 #endif // NET_QUIC_CONGESTION_CONTROL_PACING_SENDER_H_ | 77 #endif // NET_QUIC_CONGESTION_CONTROL_PACING_SENDER_H_ |
| OLD | NEW |