#ifndef NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_
#define NET_QUIC_CONGESTION_CONTROL_RTT_STATS_H_
#include <algorithm>
#include "base/basictypes.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_time.h"
namespace net {
class NET_EXPORT_PRIVATE RttStats {
public:
RttStats();
bool HasUpdates() const;
void UpdateRtt(QuicTime::Delta send_delta, QuicTime::Delta ack_delay);
QuicTime::Delta SmoothedRtt() const;
void set_initial_rtt_us(int64 initial_rtt_us) {
initial_rtt_us_ = initial_rtt_us;
}
QuicTime::Delta latest_rtt() const {
return latest_rtt_;
}
QuicTime::Delta min_rtt() const {
return min_rtt_;
}
QuicTime::Delta mean_deviation() const {
return mean_deviation_;
}
private:
QuicTime::Delta latest_rtt_;
QuicTime::Delta min_rtt_;
QuicTime::Delta smoothed_rtt_;
QuicTime::Delta mean_deviation_;
int64 initial_rtt_us_;
};
}
#endif