| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // The pure virtual class for send side loss detection algorithm. | 5 // The pure virtual class for send side loss detection algorithm. |
| 6 | 6 |
| 7 #ifndef NET_QUIC_CORE_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_ | 7 #ifndef NET_QUIC_CORE_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_ |
| 8 #define NET_QUIC_CORE_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_ | 8 #define NET_QUIC_CORE_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_ |
| 9 | 9 |
| 10 #include "net/base/net_export.h" | |
| 11 #include "net/quic/core/congestion_control/send_algorithm_interface.h" | 10 #include "net/quic/core/congestion_control/send_algorithm_interface.h" |
| 12 #include "net/quic/core/quic_packets.h" | 11 #include "net/quic/core/quic_packets.h" |
| 13 #include "net/quic/core/quic_time.h" | 12 #include "net/quic/core/quic_time.h" |
| 13 #include "net/quic/platform/api/quic_export.h" |
| 14 | 14 |
| 15 namespace net { | 15 namespace net { |
| 16 | 16 |
| 17 class QuicUnackedPacketMap; | 17 class QuicUnackedPacketMap; |
| 18 class RttStats; | 18 class RttStats; |
| 19 | 19 |
| 20 class NET_EXPORT_PRIVATE LossDetectionInterface { | 20 class QUIC_EXPORT_PRIVATE LossDetectionInterface { |
| 21 public: | 21 public: |
| 22 virtual ~LossDetectionInterface() {} | 22 virtual ~LossDetectionInterface() {} |
| 23 | 23 |
| 24 virtual LossDetectionType GetLossDetectionType() const = 0; | 24 virtual LossDetectionType GetLossDetectionType() const = 0; |
| 25 | 25 |
| 26 // Called when a new ack arrives or the loss alarm fires. | 26 // Called when a new ack arrives or the loss alarm fires. |
| 27 virtual void DetectLosses( | 27 virtual void DetectLosses( |
| 28 const QuicUnackedPacketMap& unacked_packets, | 28 const QuicUnackedPacketMap& unacked_packets, |
| 29 QuicTime time, | 29 QuicTime time, |
| 30 const RttStats& rtt_stats, | 30 const RttStats& rtt_stats, |
| 31 QuicPacketNumber largest_newly_acked, | 31 QuicPacketNumber largest_newly_acked, |
| 32 SendAlgorithmInterface::CongestionVector* packets_lost) = 0; | 32 SendAlgorithmInterface::CongestionVector* packets_lost) = 0; |
| 33 | 33 |
| 34 // Get the time the LossDetectionAlgorithm wants to re-evaluate losses. | 34 // Get the time the LossDetectionAlgorithm wants to re-evaluate losses. |
| 35 // Returns QuicTime::Zero if no alarm needs to be set. | 35 // Returns QuicTime::Zero if no alarm needs to be set. |
| 36 virtual QuicTime GetLossTimeout() const = 0; | 36 virtual QuicTime GetLossTimeout() const = 0; |
| 37 | 37 |
| 38 // Called when a |spurious_retransmission| is detected. The original | 38 // Called when a |spurious_retransmission| is detected. The original |
| 39 // transmission must have been caused by DetectLosses. | 39 // transmission must have been caused by DetectLosses. |
| 40 virtual void SpuriousRetransmitDetected( | 40 virtual void SpuriousRetransmitDetected( |
| 41 const QuicUnackedPacketMap& unacked_packets, | 41 const QuicUnackedPacketMap& unacked_packets, |
| 42 QuicTime time, | 42 QuicTime time, |
| 43 const RttStats& rtt_stats, | 43 const RttStats& rtt_stats, |
| 44 QuicPacketNumber spurious_retransmission) = 0; | 44 QuicPacketNumber spurious_retransmission) = 0; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 } // namespace net | 47 } // namespace net |
| 48 | 48 |
| 49 #endif // NET_QUIC_CORE_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_ | 49 #endif // NET_QUIC_CORE_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_ |
| OLD | NEW |