Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / net / quic / test_tools / quic_sent_packet_manager_peer.h
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
3 // found in the LICENSE file.
4
5 #ifndef NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_
6 #define NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_
7
8 #include "net/quic/quic_protocol.h"
9 #include "net/quic/quic_sent_packet_manager.h"
10
11 namespace net {
12
13 class SendAlgorithmInterface;
14
15 namespace test {
16
17 class QuicSentPacketManagerPeer {
18  public:
19   static void SetMaxTailLossProbes(
20       QuicSentPacketManager* sent_packet_manager, size_t max_tail_loss_probes);
21
22   static void SetSendAlgorithm(QuicSentPacketManager* sent_packet_manager,
23                                SendAlgorithmInterface* send_algorithm);
24
25   static const LossDetectionInterface* GetLossAlgorithm(
26       QuicSentPacketManager* sent_packet_manager);
27
28   static void SetLossAlgorithm(QuicSentPacketManager* sent_packet_manager,
29                                LossDetectionInterface* loss_detector);
30
31   static RttStats* GetRttStats(QuicSentPacketManager* sent_packet_manager);
32
33   static size_t GetNackCount(
34       const QuicSentPacketManager* sent_packet_manager,
35       QuicPacketSequenceNumber sequence_number);
36
37   static size_t GetPendingRetransmissionCount(
38       const QuicSentPacketManager* sent_packet_manager);
39
40   static bool HasPendingPackets(
41       const QuicSentPacketManager* sent_packet_manager);
42
43   static QuicTime GetSentTime(const QuicSentPacketManager* sent_packet_manager,
44                               QuicPacketSequenceNumber sequence_number);
45
46   // Returns true if |sequence_number| is a retransmission of a packet.
47   static bool IsRetransmission(QuicSentPacketManager* sent_packet_manager,
48                                QuicPacketSequenceNumber sequence_number);
49
50   static void MarkForRetransmission(QuicSentPacketManager* sent_packet_manager,
51                                     QuicPacketSequenceNumber sequence_number,
52                                     TransmissionType transmission_type);
53
54   static QuicTime::Delta GetRetransmissionDelay(
55       const QuicSentPacketManager* sent_packet_manager);
56
57   static bool HasUnackedCryptoPackets(
58       const QuicSentPacketManager* sent_packet_manager);
59
60   static size_t GetNumRetransmittablePackets(
61       const QuicSentPacketManager* sent_packet_manager);
62
63   static SequenceNumberSet GetUnackedPackets(
64       const QuicSentPacketManager* sent_packet_manager);
65
66   static QuicByteCount GetBytesInFlight(
67       const QuicSentPacketManager* sent_packet_manager);
68
69  private:
70   DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManagerPeer);
71 };
72
73 }  // namespace test
74
75 }  // namespace net
76
77 #endif  // NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_