xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/quic/core/congestion_control/bbr2_probe_rtt.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2019 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_CORE_CONGESTION_CONTROL_BBR2_PROBE_RTT_H_
6 #define QUICHE_QUIC_CORE_CONGESTION_CONTROL_BBR2_PROBE_RTT_H_
7 
8 #include "quiche/quic/core/congestion_control/bbr2_misc.h"
9 #include "quiche/quic/core/quic_time.h"
10 #include "quiche/quic/core/quic_types.h"
11 #include "quiche/quic/platform/api/quic_export.h"
12 
13 namespace quic {
14 
15 class Bbr2Sender;
16 class QUICHE_EXPORT Bbr2ProbeRttMode final : public Bbr2ModeBase {
17  public:
18   using Bbr2ModeBase::Bbr2ModeBase;
19 
20   void Enter(QuicTime now,
21              const Bbr2CongestionEvent* congestion_event) override;
Leave(QuicTime,const Bbr2CongestionEvent *)22   void Leave(QuicTime /*now*/,
23              const Bbr2CongestionEvent* /*congestion_event*/) override {}
24 
25   Bbr2Mode OnCongestionEvent(
26       QuicByteCount prior_in_flight, QuicTime event_time,
27       const AckedPacketVector& acked_packets,
28       const LostPacketVector& lost_packets,
29       const Bbr2CongestionEvent& congestion_event) override;
30 
31   Limits<QuicByteCount> GetCwndLimits() const override;
32 
IsProbingForBandwidth()33   bool IsProbingForBandwidth() const override { return false; }
34 
35   Bbr2Mode OnExitQuiescence(QuicTime now,
36                             QuicTime quiescence_start_time) override;
37 
38   struct QUICHE_EXPORT DebugState {
39     QuicByteCount inflight_target;
40     QuicTime exit_time = QuicTime::Zero();
41   };
42 
43   DebugState ExportDebugState() const;
44 
45  private:
46   const Bbr2Params& Params() const;
47 
48   QuicByteCount InflightTarget() const;
49 
50   QuicTime exit_time_ = QuicTime::Zero();
51 };
52 
53 QUICHE_EXPORT std::ostream& operator<<(
54     std::ostream& os, const Bbr2ProbeRttMode::DebugState& state);
55 
56 }  // namespace quic
57 
58 #endif  // QUICHE_QUIC_CORE_CONGESTION_CONTROL_BBR2_PROBE_RTT_H_
59