This source file includes following definitions.
- GenerateCongestionFeedback
- RecordIncomingPacket
#include "net/quic/congestion_control/inter_arrival_receiver.h"
#include "base/basictypes.h"
namespace net {
InterArrivalReceiver::InterArrivalReceiver() {
}
InterArrivalReceiver::~InterArrivalReceiver() {
}
bool InterArrivalReceiver::GenerateCongestionFeedback(
QuicCongestionFeedbackFrame* feedback) {
if (received_packet_times_.size() <= 1) {
return false;
}
feedback->type = kInterArrival;
feedback->inter_arrival.received_packet_times = received_packet_times_;
received_packet_times_.clear();
return true;
}
void InterArrivalReceiver::RecordIncomingPacket(
QuicByteCount ,
QuicPacketSequenceNumber sequence_number,
QuicTime timestamp) {
received_packet_times_.insert(std::make_pair(sequence_number, timestamp));
}
}