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 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 void SetIsServer(QuicSentPacketManager
* sent_packet_manager
,
28 static const LossDetectionInterface
* GetLossAlgorithm(
29 QuicSentPacketManager
* sent_packet_manager
);
31 static const SendAlgorithmInterface
* GetCongestionControlAlgorithm(
32 const QuicSentPacketManager
& sent_packet_manager
);
34 static void SetLossAlgorithm(QuicSentPacketManager
* sent_packet_manager
,
35 LossDetectionInterface
* loss_detector
);
37 static RttStats
* GetRttStats(QuicSentPacketManager
* sent_packet_manager
);
39 static size_t GetNackCount(
40 const QuicSentPacketManager
* sent_packet_manager
,
41 QuicPacketSequenceNumber sequence_number
);
43 static size_t GetPendingRetransmissionCount(
44 const QuicSentPacketManager
* sent_packet_manager
);
46 static bool HasPendingPackets(
47 const QuicSentPacketManager
* sent_packet_manager
);
49 static QuicTime
GetSentTime(const QuicSentPacketManager
* sent_packet_manager
,
50 QuicPacketSequenceNumber sequence_number
);
52 // Returns true if |sequence_number| is a retransmission of a packet.
53 static bool IsRetransmission(QuicSentPacketManager
* sent_packet_manager
,
54 QuicPacketSequenceNumber sequence_number
);
56 static void MarkForRetransmission(QuicSentPacketManager
* sent_packet_manager
,
57 QuicPacketSequenceNumber sequence_number
,
58 TransmissionType transmission_type
);
60 static QuicTime::Delta
GetRetransmissionDelay(
61 const QuicSentPacketManager
* sent_packet_manager
);
63 static bool HasUnackedCryptoPackets(
64 const QuicSentPacketManager
* sent_packet_manager
);
66 static size_t GetNumRetransmittablePackets(
67 const QuicSentPacketManager
* sent_packet_manager
);
69 static QuicByteCount
GetBytesInFlight(
70 const QuicSentPacketManager
* sent_packet_manager
);
72 static QuicSentPacketManager::NetworkChangeVisitor
* GetNetworkChangeVisitor(
73 const QuicSentPacketManager
* sent_packet_manager
);
75 static QuicSustainedBandwidthRecorder
& GetBandwidthRecorder(
76 QuicSentPacketManager
* sent_packet_manager
);
79 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManagerPeer
);
86 #endif // NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_