blob: af9c19626568e2a9be81149d1241a671e14b0df8 [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// Copyright 2014 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// The pure virtual class for send side loss detection algorithm.
6
7#ifndef QUICHE_QUIC_CORE_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_
8#define QUICHE_QUIC_CORE_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_
9
10#include "net/third_party/quiche/src/quic/core/congestion_control/send_algorithm_interface.h"
11#include "net/third_party/quiche/src/quic/core/quic_packets.h"
12#include "net/third_party/quiche/src/quic/core/quic_time.h"
13#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
14
15namespace quic {
16
17class QuicUnackedPacketMap;
18class RttStats;
19
20class QUIC_EXPORT_PRIVATE LossDetectionInterface {
21 public:
22 virtual ~LossDetectionInterface() {}
23
24 virtual LossDetectionType GetLossDetectionType() const = 0;
25
26 // Called when a new ack arrives or the loss alarm fires.
27 virtual void DetectLosses(const QuicUnackedPacketMap& unacked_packets,
28 QuicTime time,
29 const RttStats& rtt_stats,
30 QuicPacketNumber largest_newly_acked,
31 const AckedPacketVector& packets_acked,
32 LostPacketVector* packets_lost) = 0;
33
34 // Get the time the LossDetectionAlgorithm wants to re-evaluate losses.
35 // Returns QuicTime::Zero if no alarm needs to be set.
36 virtual QuicTime GetLossTimeout() const = 0;
37
fayang19d2d5b2019-09-11 14:22:03 -070038 // Called when |packet_number| was detected lost but gets acked later.
39 virtual void SpuriousLossDetected(
40 const QuicUnackedPacketMap& unacked_packets,
41 const RttStats& rtt_stats,
42 QuicTime ack_receive_time,
43 QuicPacketNumber packet_number,
44 QuicPacketNumber previous_largest_acked) = 0;
QUICHE teama6ef0a62019-03-07 20:34:33 -050045};
46
47} // namespace quic
48
49#endif // QUICHE_QUIC_CORE_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_