1 // 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.
5 // The pure virtual class for send side loss detection algorithm.
7 #ifndef NET_QUIC_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_
8 #define NET_QUIC_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_
10 #include "base/basictypes.h"
11 #include "net/quic/quic_protocol.h"
12 #include "net/quic/quic_time.h"
16 class QuicUnackedPacketMap
;
19 class NET_EXPORT_PRIVATE LossDetectionInterface
{
21 // Creates a TCP loss detector.
22 static LossDetectionInterface
* Create(LossDetectionType loss_type
);
24 virtual ~LossDetectionInterface() {}
26 virtual LossDetectionType
GetLossDetectionType() const = 0;
28 // Called when a new ack arrives or the loss alarm fires.
29 virtual SequenceNumberSet
DetectLostPackets(
30 const QuicUnackedPacketMap
& unacked_packets
,
32 QuicPacketSequenceNumber largest_observed
,
33 const RttStats
& rtt_stats
) = 0;
35 // Get the time the LossDetectionAlgorithm wants to re-evaluate losses.
36 // Returns QuicTime::Zero if no alarm needs to be set.
37 virtual QuicTime
GetLossTimeout() const = 0;
42 #endif // NET_QUIC_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_