Add explicit |forceOnlineSignin| to user pod status
[chromium-blink-merge.git] / net / quic / congestion_control / fix_rate_sender.h
blob688cf3ab5d6777fb5e91ac587c7e388ce4da1ed1
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
3 // found in the LICENSE file.
4 //
5 // Fix rate send side congestion control, used for testing.
7 #ifndef NET_QUIC_CONGESTION_CONTROL_FIX_RATE_SENDER_H_
8 #define NET_QUIC_CONGESTION_CONTROL_FIX_RATE_SENDER_H_
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "net/base/net_export.h"
13 #include "net/quic/quic_clock.h"
14 #include "net/quic/quic_time.h"
15 #include "net/quic/congestion_control/leaky_bucket.h"
16 #include "net/quic/congestion_control/paced_sender.h"
17 #include "net/quic/congestion_control/send_algorithm_interface.h"
19 namespace net {
21 class NET_EXPORT_PRIVATE FixRateSender : public SendAlgorithmInterface {
22 public:
23 explicit FixRateSender(const QuicClock* clock);
24 virtual ~FixRateSender();
26 // Start implementation of SendAlgorithmInterface.
27 virtual void SetFromConfig(const QuicConfig& config, bool is_server) OVERRIDE;
28 virtual void SetMaxPacketSize(QuicByteCount max_packet_size) OVERRIDE;
29 virtual void OnIncomingQuicCongestionFeedbackFrame(
30 const QuicCongestionFeedbackFrame& feedback,
31 QuicTime feedback_receive_time,
32 const SentPacketsMap& sent_packets) OVERRIDE;
33 virtual void OnPacketAcked(QuicPacketSequenceNumber acked_sequence_number,
34 QuicByteCount acked_bytes) OVERRIDE;
35 virtual void OnPacketLost(QuicPacketSequenceNumber sequence_number,
36 QuicTime ack_receive_time) OVERRIDE;
37 virtual bool OnPacketSent(
38 QuicTime sent_time,
39 QuicPacketSequenceNumber sequence_number,
40 QuicByteCount bytes,
41 TransmissionType transmission_type,
42 HasRetransmittableData has_retransmittable_data) OVERRIDE;
43 virtual void OnRetransmissionTimeout(bool packets_retransmitted) OVERRIDE;
44 virtual void OnPacketAbandoned(QuicPacketSequenceNumber sequence_number,
45 QuicByteCount abandoned_bytes) OVERRIDE;
46 virtual QuicTime::Delta TimeUntilSend(
47 QuicTime now,
48 TransmissionType transmission_type,
49 HasRetransmittableData has_retransmittable_data,
50 IsHandshake handshake) OVERRIDE;
51 virtual QuicBandwidth BandwidthEstimate() const OVERRIDE;
52 virtual void UpdateRtt(QuicTime::Delta rtt_sample) OVERRIDE;
53 virtual QuicTime::Delta SmoothedRtt() const OVERRIDE;
54 virtual QuicTime::Delta RetransmissionDelay() const OVERRIDE;
55 virtual QuicByteCount GetCongestionWindow() const OVERRIDE;
56 // End implementation of SendAlgorithmInterface.
58 private:
59 QuicByteCount CongestionWindow();
61 QuicBandwidth bitrate_;
62 QuicByteCount max_segment_size_;
63 LeakyBucket fix_rate_leaky_bucket_;
64 PacedSender paced_sender_;
65 QuicByteCount data_in_flight_;
66 QuicTime::Delta latest_rtt_;
68 DISALLOW_COPY_AND_ASSIGN(FixRateSender);
71 } // namespace net
73 #endif // NET_QUIC_CONGESTION_CONTROL_FIX_RATE_SENDER_H_