Land Recent QUIC Changes
[chromium-blink-merge.git] / net / quic / test_tools / quic_sent_packet_manager_peer.h
blob18eb6be2afc971d7723e42e4ff17c292c05e63b1
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.
5 #ifndef NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_
6 #define NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_
8 #include "net/quic/quic_protocol.h"
9 #include "net/quic/quic_sent_packet_manager.h"
11 namespace net {
13 class SendAlgorithmInterface;
15 namespace test {
17 class QuicSentPacketManagerPeer {
18 public:
19 static void SetMaxTailLossProbes(
20 QuicSentPacketManager* sent_packet_manager, size_t max_tail_loss_probes);
22 static void SetSendAlgorithm(QuicSentPacketManager* sent_packet_manager,
23 SendAlgorithmInterface* send_algorithm);
25 static const LossDetectionInterface* GetLossAlgorithm(
26 QuicSentPacketManager* sent_packet_manager);
28 static const SendAlgorithmInterface* GetCongestionControlAlgorithm(
29 const QuicSentPacketManager& sent_packet_manager);
31 static void SetLossAlgorithm(QuicSentPacketManager* sent_packet_manager,
32 LossDetectionInterface* loss_detector);
34 static RttStats* GetRttStats(QuicSentPacketManager* sent_packet_manager);
36 static size_t GetNackCount(
37 const QuicSentPacketManager* sent_packet_manager,
38 QuicPacketSequenceNumber sequence_number);
40 static size_t GetPendingRetransmissionCount(
41 const QuicSentPacketManager* sent_packet_manager);
43 static bool HasPendingPackets(
44 const QuicSentPacketManager* sent_packet_manager);
46 static QuicTime GetSentTime(const QuicSentPacketManager* sent_packet_manager,
47 QuicPacketSequenceNumber sequence_number);
49 // Returns true if |sequence_number| is a retransmission of a packet.
50 static bool IsRetransmission(QuicSentPacketManager* sent_packet_manager,
51 QuicPacketSequenceNumber sequence_number);
53 static void MarkForRetransmission(QuicSentPacketManager* sent_packet_manager,
54 QuicPacketSequenceNumber sequence_number,
55 TransmissionType transmission_type);
57 static QuicTime::Delta GetRetransmissionDelay(
58 const QuicSentPacketManager* sent_packet_manager);
60 static bool HasUnackedCryptoPackets(
61 const QuicSentPacketManager* sent_packet_manager);
63 static size_t GetNumRetransmittablePackets(
64 const QuicSentPacketManager* sent_packet_manager);
66 static QuicByteCount GetBytesInFlight(
67 const QuicSentPacketManager* sent_packet_manager);
69 static QuicSentPacketManager::NetworkChangeVisitor* GetNetworkChangeVisitor(
70 const QuicSentPacketManager* sent_packet_manager);
72 private:
73 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManagerPeer);
76 } // namespace test
78 } // namespace net
80 #endif // NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_