Upstream version 7.35.144.0
[platform/framework/web/crosswalk.git] / src / net / quic / congestion_control / inter_arrival_receiver.h
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
3 // found in the LICENSE file.
4
5 #ifndef NET_QUIC_CONGESTION_CONTROL_INTER_ARRIVAL_RECEIVER_H_
6 #define NET_QUIC_CONGESTION_CONTROL_INTER_ARRIVAL_RECEIVER_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "net/base/net_export.h"
11 #include "net/quic/congestion_control/receive_algorithm_interface.h"
12 #include "net/quic/quic_clock.h"
13 #include "net/quic/quic_protocol.h"
14
15 namespace net {
16
17 class NET_EXPORT_PRIVATE InterArrivalReceiver
18     : public ReceiveAlgorithmInterface {
19  public:
20   InterArrivalReceiver();
21   virtual ~InterArrivalReceiver();
22
23   // Start implementation of ReceiveAlgorithmInterface.
24   virtual bool GenerateCongestionFeedback(
25       QuicCongestionFeedbackFrame* feedback) OVERRIDE;
26
27   virtual void RecordIncomingPacket(QuicByteCount bytes,
28                                     QuicPacketSequenceNumber sequence_number,
29                                     QuicTime timestamp) OVERRIDE;
30   // End implementation of ReceiveAlgorithmInterface.
31
32  private:
33   // The set of received packets since the last feedback was sent, along with
34   // their arrival times.
35   TimeMap received_packet_times_;
36
37   DISALLOW_COPY_AND_ASSIGN(InterArrivalReceiver);
38 };
39
40 }  // namespace net
41
42 #endif  // NET_QUIC_CONGESTION_CONTROL_INTER_ARRIVAL_RECEIVER_H_