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"
13 class SendAlgorithmInterface
;
17 class QuicSentPacketManagerPeer
{
19 static size_t GetMaxTailLossProbes(
20 QuicSentPacketManager
* sent_packet_manager
);
22 static void SetMaxTailLossProbes(
23 QuicSentPacketManager
* sent_packet_manager
, size_t max_tail_loss_probes
);
25 static QuicByteCount
GetReceiveWindow(
26 QuicSentPacketManager
* sent_packet_manager
);
28 static void SetIsServer(QuicSentPacketManager
* sent_packet_manager
,
31 static const SendAlgorithmInterface
* GetSendAlgorithm(
32 const QuicSentPacketManager
& sent_packet_manager
);
34 static void SetSendAlgorithm(QuicSentPacketManager
* sent_packet_manager
,
35 SendAlgorithmInterface
* send_algorithm
);
37 static const LossDetectionInterface
* GetLossAlgorithm(
38 QuicSentPacketManager
* sent_packet_manager
);
40 static void SetLossAlgorithm(QuicSentPacketManager
* sent_packet_manager
,
41 LossDetectionInterface
* loss_detector
);
43 static RttStats
* GetRttStats(QuicSentPacketManager
* sent_packet_manager
);
45 static QuicPacketCount
GetNackCount(
46 const QuicSentPacketManager
* sent_packet_manager
,
47 QuicPacketSequenceNumber sequence_number
);
49 static size_t GetPendingRetransmissionCount(
50 const QuicSentPacketManager
* sent_packet_manager
);
52 static bool HasPendingPackets(
53 const QuicSentPacketManager
* sent_packet_manager
);
55 static QuicTime
GetSentTime(const QuicSentPacketManager
* sent_packet_manager
,
56 QuicPacketSequenceNumber sequence_number
);
58 // Returns true if |sequence_number| is a retransmission of a packet.
59 static bool IsRetransmission(QuicSentPacketManager
* sent_packet_manager
,
60 QuicPacketSequenceNumber sequence_number
);
62 static void MarkForRetransmission(QuicSentPacketManager
* sent_packet_manager
,
63 QuicPacketSequenceNumber sequence_number
,
64 TransmissionType transmission_type
);
66 static QuicTime::Delta
GetRetransmissionDelay(
67 const QuicSentPacketManager
* sent_packet_manager
);
69 static bool HasUnackedCryptoPackets(
70 const QuicSentPacketManager
* sent_packet_manager
);
72 static size_t GetNumRetransmittablePackets(
73 const QuicSentPacketManager
* sent_packet_manager
);
75 static QuicByteCount
GetBytesInFlight(
76 const QuicSentPacketManager
* sent_packet_manager
);
78 static QuicSentPacketManager::NetworkChangeVisitor
* GetNetworkChangeVisitor(
79 const QuicSentPacketManager
* sent_packet_manager
);
81 static QuicSustainedBandwidthRecorder
& GetBandwidthRecorder(
82 QuicSentPacketManager
* sent_packet_manager
);
85 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManagerPeer
);
92 #endif // NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_