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 SetPerspective(QuicSentPacketManager
* sent_packet_manager
,
31 Perspective perspective
);
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 bool HasPendingPackets(
48 const QuicSentPacketManager
* sent_packet_manager
);
50 static QuicTime
GetSentTime(const QuicSentPacketManager
* sent_packet_manager
,
51 QuicPacketSequenceNumber sequence_number
);
53 // Returns true if |sequence_number| is a retransmission of a packet.
54 static bool IsRetransmission(QuicSentPacketManager
* sent_packet_manager
,
55 QuicPacketSequenceNumber sequence_number
);
57 static void MarkForRetransmission(QuicSentPacketManager
* sent_packet_manager
,
58 QuicPacketSequenceNumber sequence_number
,
59 TransmissionType transmission_type
);
61 static QuicTime::Delta
GetRetransmissionDelay(
62 const QuicSentPacketManager
* sent_packet_manager
);
64 static bool HasUnackedCryptoPackets(
65 const QuicSentPacketManager
* sent_packet_manager
);
67 static size_t GetNumRetransmittablePackets(
68 const QuicSentPacketManager
* sent_packet_manager
);
70 static QuicByteCount
GetBytesInFlight(
71 const QuicSentPacketManager
* sent_packet_manager
);
73 static QuicSentPacketManager::NetworkChangeVisitor
* GetNetworkChangeVisitor(
74 const QuicSentPacketManager
* sent_packet_manager
);
76 static QuicSustainedBandwidthRecorder
& GetBandwidthRecorder(
77 QuicSentPacketManager
* sent_packet_manager
);
80 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManagerPeer
);
87 #endif // NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_