| 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_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_ | 7 #ifndef NET_QUIC_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_ |
| 8 #define NET_QUIC_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_ | 8 #define NET_QUIC_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_ |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "net/quic/quic_protocol.h" | 11 #include "net/quic/quic_protocol.h" |
| 12 #include "net/quic/quic_time.h" | 12 #include "net/quic/quic_time.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 | 15 |
| 16 class QuicUnackedPacketMap; | 16 class QuicUnackedPacketMap; |
| 17 class RttStats; |
| 17 | 18 |
| 18 class NET_EXPORT_PRIVATE LossDetectionInterface { | 19 class NET_EXPORT_PRIVATE LossDetectionInterface { |
| 19 public: | 20 public: |
| 20 // Creates a TCP loss detector. | 21 // Creates a TCP loss detector. |
| 21 static LossDetectionInterface* Create(); | 22 static LossDetectionInterface* Create(); |
| 22 | 23 |
| 23 virtual ~LossDetectionInterface() {} | 24 virtual ~LossDetectionInterface() {} |
| 24 | 25 |
| 25 // Called when a new ack arrives or the loss alarm fires. | 26 // Called when a new ack arrives or the loss alarm fires. |
| 26 virtual SequenceNumberSet DetectLostPackets( | 27 virtual SequenceNumberSet DetectLostPackets( |
| 27 const QuicUnackedPacketMap& unacked_packets, | 28 const QuicUnackedPacketMap& unacked_packets, |
| 28 const QuicTime& time, | 29 const QuicTime& time, |
| 29 QuicPacketSequenceNumber largest_observed, | 30 QuicPacketSequenceNumber largest_observed, |
| 30 QuicTime::Delta srtt, | 31 const RttStats& rtt_stats) = 0; |
| 31 QuicTime::Delta latest_rtt) = 0; | |
| 32 | 32 |
| 33 // Get the time the LossDetectionAlgorithm wants to re-evaluate losses. | 33 // Get the time the LossDetectionAlgorithm wants to re-evaluate losses. |
| 34 // Returns QuicTime::Zero if no alarm needs to be set. | 34 // Returns QuicTime::Zero if no alarm needs to be set. |
| 35 virtual QuicTime GetLossTimeout() const = 0; | 35 virtual QuicTime GetLossTimeout() const = 0; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 } // namespace net | 38 } // namespace net |
| 39 | 39 |
| 40 #endif // NET_QUIC_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_ | 40 #endif // NET_QUIC_CONGESTION_CONTROL_LOSS_DETECTION_INTERFACE_H_ |
| OLD | NEW |