Update To 11.40.268.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 size_t GetMaxTailLossProbes(
20       QuicSentPacketManager* sent_packet_manager);
21
22   static void SetMaxTailLossProbes(
23       QuicSentPacketManager* sent_packet_manager, size_t max_tail_loss_probes);
24
25   static QuicByteCount GetReceiveWindow(
26       QuicSentPacketManager* sent_packet_manager);
27
28   static void SetIsServer(QuicSentPacketManager* sent_packet_manager,
29                           bool is_server);
30
31   static const SendAlgorithmInterface* GetSendAlgorithm(
32       const QuicSentPacketManager& sent_packet_manager);
33
34   static void SetSendAlgorithm(QuicSentPacketManager* sent_packet_manager,
35                                SendAlgorithmInterface* send_algorithm);
36
37   static const LossDetectionInterface* GetLossAlgorithm(
38       QuicSentPacketManager* sent_packet_manager);
39
40   static void SetLossAlgorithm(QuicSentPacketManager* sent_packet_manager,
41                                LossDetectionInterface* loss_detector);
42
43   static RttStats* GetRttStats(QuicSentPacketManager* sent_packet_manager);
44
45   static size_t GetNackCount(
46       const QuicSentPacketManager* sent_packet_manager,
47       QuicPacketSequenceNumber sequence_number);
48
49   static size_t GetPendingRetransmissionCount(
50       const QuicSentPacketManager* sent_packet_manager);
51
52   static bool HasPendingPackets(
53       const QuicSentPacketManager* sent_packet_manager);
54
55   static QuicTime GetSentTime(const QuicSentPacketManager* sent_packet_manager,
56                               QuicPacketSequenceNumber sequence_number);
57
58   // Returns true if |sequence_number| is a retransmission of a packet.
59   static bool IsRetransmission(QuicSentPacketManager* sent_packet_manager,
60                                QuicPacketSequenceNumber sequence_number);
61
62   static void MarkForRetransmission(QuicSentPacketManager* sent_packet_manager,
63                                     QuicPacketSequenceNumber sequence_number,
64                                     TransmissionType transmission_type);
65
66   static QuicTime::Delta GetRetransmissionDelay(
67       const QuicSentPacketManager* sent_packet_manager);
68
69   static bool HasUnackedCryptoPackets(
70       const QuicSentPacketManager* sent_packet_manager);
71
72   static size_t GetNumRetransmittablePackets(
73       const QuicSentPacketManager* sent_packet_manager);
74
75   static QuicByteCount GetBytesInFlight(
76       const QuicSentPacketManager* sent_packet_manager);
77
78   static QuicSentPacketManager::NetworkChangeVisitor* GetNetworkChangeVisitor(
79       const QuicSentPacketManager* sent_packet_manager);
80
81   static QuicSustainedBandwidthRecorder& GetBandwidthRecorder(
82       QuicSentPacketManager* sent_packet_manager);
83
84  private:
85   DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManagerPeer);
86 };
87
88 }  // namespace test
89
90 }  // namespace net
91
92 #endif  // NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_