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

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

Issue 126283002: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed extra space Created 6 years, 11 months 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 | Annotate | Revision Log
OLDNEW
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 10 matching lines...) Expand all
21 #include "net/quic/quic_config.h" 21 #include "net/quic/quic_config.h"
22 #include "net/quic/quic_protocol.h" 22 #include "net/quic/quic_protocol.h"
23 #include "net/quic/quic_time.h" 23 #include "net/quic/quic_time.h"
24 24
25 namespace net { 25 namespace net {
26 26
27 class NET_EXPORT_PRIVATE PacingSender : public SendAlgorithmInterface { 27 class NET_EXPORT_PRIVATE PacingSender : public SendAlgorithmInterface {
28 public: 28 public:
29 PacingSender(SendAlgorithmInterface* sender, 29 PacingSender(SendAlgorithmInterface* sender,
30 QuicTime::Delta alarm_granularity); 30 QuicTime::Delta alarm_granularity);
31 virtual ~PacingSender(); 31 virtual ~PacingSender() OVERRIDE;
32 32
33 // SendAlgorithmInterface methods. 33 // SendAlgorithmInterface methods.
34 virtual void SetFromConfig(const QuicConfig& config, bool is_server) OVERRIDE; 34 virtual void SetFromConfig(const QuicConfig& config, bool is_server) OVERRIDE;
35 virtual void SetMaxPacketSize(QuicByteCount max_packet_size) OVERRIDE; 35 virtual void SetMaxPacketSize(QuicByteCount max_packet_size) OVERRIDE;
36 virtual void OnIncomingQuicCongestionFeedbackFrame( 36 virtual void OnIncomingQuicCongestionFeedbackFrame(
37 const QuicCongestionFeedbackFrame& feedback, 37 const QuicCongestionFeedbackFrame& feedback,
38 QuicTime feedback_receive_time, 38 QuicTime feedback_receive_time,
39 const SendAlgorithmInterface::SentPacketsMap& sent_packets) OVERRIDE; 39 const SendAlgorithmInterface::SentPacketsMap& sent_packets) OVERRIDE;
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_
OLDNEW
« no previous file with comments | « net/quic/congestion_control/inter_arrival_sender_test.cc ('k') | net/quic/congestion_control/pacing_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698