Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / net / quic / test_tools / quic_sent_packet_manager_peer.h
blob10d5ebc5e78eba21f0d2a637549cf0e3fa600d6a
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 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 GetEnableHalfRttTailLossProbe(
26 QuicSentPacketManager* sent_packet_manager);
28 static bool GetUseNewRto(QuicSentPacketManager* sent_packet_manager);
30 static QuicByteCount GetReceiveWindow(
31 QuicSentPacketManager* sent_packet_manager);
33 static void SetPerspective(QuicSentPacketManager* sent_packet_manager,
34 Perspective perspective);
36 static const SendAlgorithmInterface* GetSendAlgorithm(
37 const QuicSentPacketManager& sent_packet_manager);
39 static void SetSendAlgorithm(QuicSentPacketManager* sent_packet_manager,
40 SendAlgorithmInterface* send_algorithm);
42 static const LossDetectionInterface* GetLossAlgorithm(
43 QuicSentPacketManager* sent_packet_manager);
45 static void SetLossAlgorithm(QuicSentPacketManager* sent_packet_manager,
46 LossDetectionInterface* loss_detector);
48 static RttStats* GetRttStats(QuicSentPacketManager* sent_packet_manager);
50 static bool HasPendingPackets(
51 const QuicSentPacketManager* sent_packet_manager);
53 static QuicTime GetSentTime(const QuicSentPacketManager* sent_packet_manager,
54 QuicPacketNumber packet_number);
56 // Returns true if |packet_number| is a retransmission of a packet.
57 static bool IsRetransmission(QuicSentPacketManager* sent_packet_manager,
58 QuicPacketNumber packet_number);
60 static void MarkForRetransmission(QuicSentPacketManager* sent_packet_manager,
61 QuicPacketNumber packet_number,
62 TransmissionType transmission_type);
64 static QuicTime::Delta GetRetransmissionDelay(
65 const QuicSentPacketManager* sent_packet_manager);
67 static bool HasUnackedCryptoPackets(
68 const QuicSentPacketManager* sent_packet_manager);
70 static size_t GetNumRetransmittablePackets(
71 const QuicSentPacketManager* sent_packet_manager);
73 static QuicByteCount GetBytesInFlight(
74 const QuicSentPacketManager* sent_packet_manager);
76 static QuicSentPacketManager::NetworkChangeVisitor* GetNetworkChangeVisitor(
77 const QuicSentPacketManager* sent_packet_manager);
79 static QuicSustainedBandwidthRecorder& GetBandwidthRecorder(
80 QuicSentPacketManager* sent_packet_manager);
82 private:
83 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManagerPeer);
86 } // namespace test
88 } // namespace net
90 #endif // NET_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_