QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 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. |
| 4 | |
| 5 | #ifndef QUICHE_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_ |
| 6 | #define QUICHE_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_ |
| 7 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 8 | #include "net/third_party/quiche/src/quic/core/quic_packets.h" |
| 9 | #include "net/third_party/quiche/src/quic/core/quic_sent_packet_manager.h" |
| 10 | |
| 11 | namespace quic { |
| 12 | |
| 13 | class SendAlgorithmInterface; |
| 14 | |
| 15 | namespace test { |
| 16 | |
| 17 | class QuicSentPacketManagerPeer { |
| 18 | public: |
| 19 | QuicSentPacketManagerPeer() = delete; |
| 20 | |
| 21 | static size_t GetMaxTailLossProbes( |
| 22 | QuicSentPacketManager* sent_packet_manager); |
| 23 | |
| 24 | static void SetMaxTailLossProbes(QuicSentPacketManager* sent_packet_manager, |
| 25 | size_t max_tail_loss_probes); |
| 26 | |
| 27 | static bool GetEnableHalfRttTailLossProbe( |
| 28 | QuicSentPacketManager* sent_packet_manager); |
| 29 | |
| 30 | static bool GetUseNewRto(QuicSentPacketManager* sent_packet_manager); |
| 31 | |
| 32 | static void SetPerspective(QuicSentPacketManager* sent_packet_manager, |
| 33 | Perspective perspective); |
| 34 | |
| 35 | static SendAlgorithmInterface* GetSendAlgorithm( |
| 36 | const QuicSentPacketManager& sent_packet_manager); |
| 37 | |
| 38 | static void SetSendAlgorithm(QuicSentPacketManager* sent_packet_manager, |
| 39 | SendAlgorithmInterface* send_algorithm); |
| 40 | |
| 41 | static const LossDetectionInterface* GetLossAlgorithm( |
| 42 | QuicSentPacketManager* sent_packet_manager); |
| 43 | |
| 44 | static void SetLossAlgorithm(QuicSentPacketManager* sent_packet_manager, |
| 45 | LossDetectionInterface* loss_detector); |
| 46 | |
| 47 | static RttStats* GetRttStats(QuicSentPacketManager* sent_packet_manager); |
| 48 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 49 | // Returns true if |packet_number| is a retransmission of a packet. |
| 50 | static bool IsRetransmission(QuicSentPacketManager* sent_packet_manager, |
| 51 | uint64_t packet_number); |
| 52 | |
| 53 | static void MarkForRetransmission(QuicSentPacketManager* sent_packet_manager, |
| 54 | uint64_t packet_number, |
| 55 | TransmissionType transmission_type); |
| 56 | |
| 57 | static QuicTime::Delta GetRetransmissionDelay( |
| 58 | const QuicSentPacketManager* sent_packet_manager, |
| 59 | size_t consecutive_rto_count); |
| 60 | static QuicTime::Delta GetRetransmissionDelay( |
| 61 | const QuicSentPacketManager* sent_packet_manager); |
| 62 | static QuicTime::Delta GetTailLossProbeDelay( |
| 63 | const QuicSentPacketManager* sent_packet_manager, |
| 64 | size_t consecutive_tlp_count); |
| 65 | static QuicTime::Delta GetTailLossProbeDelay( |
| 66 | const QuicSentPacketManager* sent_packet_manager); |
| 67 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 68 | static size_t GetNumRetransmittablePackets( |
| 69 | const QuicSentPacketManager* sent_packet_manager); |
| 70 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 71 | static void SetConsecutiveRtoCount(QuicSentPacketManager* sent_packet_manager, |
| 72 | size_t count); |
| 73 | |
| 74 | static void SetConsecutiveTlpCount(QuicSentPacketManager* sent_packet_manager, |
| 75 | size_t count); |
| 76 | |
| 77 | static QuicSustainedBandwidthRecorder& GetBandwidthRecorder( |
| 78 | QuicSentPacketManager* sent_packet_manager); |
| 79 | |
| 80 | static void SetUsingPacing(QuicSentPacketManager* sent_packet_manager, |
| 81 | bool using_pacing); |
| 82 | |
| 83 | static bool UsingPacing(const QuicSentPacketManager* sent_packet_manager); |
| 84 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 85 | static bool HasRetransmittableFrames( |
| 86 | QuicSentPacketManager* sent_packet_manager, |
| 87 | uint64_t packet_number); |
| 88 | |
| 89 | static QuicUnackedPacketMap* GetUnackedPacketMap( |
| 90 | QuicSentPacketManager* sent_packet_manager); |
| 91 | |
| 92 | static void DisablePacerBursts(QuicSentPacketManager* sent_packet_manager); |
| 93 | |
| 94 | static void SetNextPacedPacketTime(QuicSentPacketManager* sent_packet_manager, |
| 95 | QuicTime time); |
| 96 | }; |
| 97 | |
| 98 | } // namespace test |
| 99 | |
| 100 | } // namespace quic |
| 101 | |
| 102 | #endif // QUICHE_QUIC_TEST_TOOLS_QUIC_SENT_PACKET_MANAGER_PEER_H_ |