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 bool GetUseNewRto(QuicSentPacketManager
* sent_packet_manager
);
27 static QuicByteCount
GetReceiveWindow(
28 QuicSentPacketManager
* sent_packet_manager
);
30 static void SetIsServer(QuicSentPacketManager
* sent_packet_manager
,
33 static const SendAlgorithmInterface
* GetSendAlgorithm(
34 const QuicSentPacketManager
& sent_packet_manager
);
36 static void SetSendAlgorithm(QuicSentPacketManager
* sent_packet_manager
,
37 SendAlgorithmInterface
* send_algorithm
);
39 static const LossDetectionInterface
* GetLossAlgorithm(
40 QuicSentPacketManager
* sent_packet_manager
);
42 static void SetLossAlgorithm(QuicSentPacketManager
* sent_packet_manager
,
43 LossDetectionInterface
* loss_detector
);
45 static RttStats
* GetRttStats(QuicSentPacketManager
* sent_packet_manager
);
47 static QuicPacketCount
GetNackCount(
48 const QuicSentPacketManager
* sent_packet_manager
,
49 QuicPacketSequenceNumber sequence_number
);
51 static size_t GetPendingRetransmissionCount(
52 const QuicSentPacketManager
* sent_packet_manager
);
54 static bool HasPendingPackets(
55 const QuicSentPacketManager
* sent_packet_manager
);
57 static QuicTime
GetSentTime(const QuicSentPacketManager
* sent_packet_manager
,
58 QuicPacketSequenceNumber sequence_number
);
60 // Returns true if |sequence_number| is a retransmission of a packet.
61 static bool IsRetransmission(QuicSentPacketManager
* sent_packet_manager
,
62 QuicPacketSequenceNumber sequence_number
);
64 static void MarkForRetransmission(QuicSentPacketManager
* sent_packet_manager
,
65 QuicPacketSequenceNumber sequence_number
,
66 TransmissionType transmission_type
);
68 static QuicTime::Delta
GetRetransmissionDelay(
69 const QuicSentPacketManager
* sent_packet_manager
);
71 static bool HasUnackedCryptoPackets(
72 const QuicSentPacketManager
* sent_packet_manager
);
74 static size_t GetNumRetransmittablePackets(
75 const QuicSentPacketManager
* sent_packet_manager
);
77 static QuicByteCount
GetBytesInFlight(
78 const QuicSentPacketManager
* sent_packet_manager
);
80 static QuicSentPacketManager::NetworkChangeVisitor
* GetNetworkChangeVisitor(
81 const QuicSentPacketManager
* sent_packet_manager
);
83 static QuicSustainedBandwidthRecorder
& GetBandwidthRecorder(
84 QuicSentPacketManager
* sent_packet_manager
);
87 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManagerPeer
);
94 #endif // NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_