This source file includes following definitions.
- SetMaxTailLossProbes
- SetSendAlgorithm
- GetLossAlgorithm
- SetLossAlgorithm
- GetRttStats
- GetNackCount
- GetPendingRetransmissionCount
- HasPendingPackets
- GetSentTime
- IsRetransmission
- MarkForRetransmission
- GetRetransmissionDelay
- HasUnackedCryptoPackets
- GetNumRetransmittablePackets
- GetUnackedPackets
#include "net/quic/test_tools/quic_sent_packet_manager_peer.h"
#include "base/stl_util.h"
#include "net/quic/congestion_control/loss_detection_interface.h"
#include "net/quic/congestion_control/send_algorithm_interface.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_sent_packet_manager.h"
namespace net {
namespace test {
void QuicSentPacketManagerPeer::SetMaxTailLossProbes(
QuicSentPacketManager* sent_packet_manager, size_t max_tail_loss_probes) {
sent_packet_manager->max_tail_loss_probes_ = max_tail_loss_probes;
}
void QuicSentPacketManagerPeer::SetSendAlgorithm(
QuicSentPacketManager* sent_packet_manager,
SendAlgorithmInterface* send_algorithm) {
sent_packet_manager->send_algorithm_.reset(send_algorithm);
}
const LossDetectionInterface* QuicSentPacketManagerPeer::GetLossAlgorithm(
QuicSentPacketManager* sent_packet_manager) {
return sent_packet_manager->loss_algorithm_.get();
}
void QuicSentPacketManagerPeer::SetLossAlgorithm(
QuicSentPacketManager* sent_packet_manager,
LossDetectionInterface* loss_detector) {
sent_packet_manager->loss_algorithm_.reset(loss_detector);
}
RttStats* QuicSentPacketManagerPeer::GetRttStats(
QuicSentPacketManager* sent_packet_manager) {
return &sent_packet_manager->rtt_stats_;
}
size_t QuicSentPacketManagerPeer::GetNackCount(
const QuicSentPacketManager* sent_packet_manager,
QuicPacketSequenceNumber sequence_number) {
return sent_packet_manager->unacked_packets_.
GetTransmissionInfo(sequence_number).nack_count;
}
size_t QuicSentPacketManagerPeer::GetPendingRetransmissionCount(
const QuicSentPacketManager* sent_packet_manager) {
return sent_packet_manager->pending_retransmissions_.size();
}
bool QuicSentPacketManagerPeer::HasPendingPackets(
const QuicSentPacketManager* sent_packet_manager) {
return sent_packet_manager->unacked_packets_.HasPendingPackets();
}
QuicTime QuicSentPacketManagerPeer::GetSentTime(
const QuicSentPacketManager* sent_packet_manager,
QuicPacketSequenceNumber sequence_number) {
DCHECK(sent_packet_manager->unacked_packets_.IsUnacked(sequence_number));
return sent_packet_manager->unacked_packets_.GetTransmissionInfo(
sequence_number).sent_time;
}
bool QuicSentPacketManagerPeer::IsRetransmission(
QuicSentPacketManager* sent_packet_manager,
QuicPacketSequenceNumber sequence_number) {
DCHECK(sent_packet_manager->HasRetransmittableFrames(sequence_number));
return sent_packet_manager->HasRetransmittableFrames(sequence_number) &&
sent_packet_manager->unacked_packets_.GetTransmissionInfo(
sequence_number).all_transmissions->size() > 1;
}
void QuicSentPacketManagerPeer::MarkForRetransmission(
QuicSentPacketManager* sent_packet_manager,
QuicPacketSequenceNumber sequence_number,
TransmissionType transmission_type) {
sent_packet_manager->MarkForRetransmission(sequence_number,
transmission_type);
}
QuicTime::Delta QuicSentPacketManagerPeer::GetRetransmissionDelay(
const QuicSentPacketManager* sent_packet_manager) {
return sent_packet_manager->GetRetransmissionDelay();
}
bool QuicSentPacketManagerPeer::HasUnackedCryptoPackets(
const QuicSentPacketManager* sent_packet_manager) {
return sent_packet_manager->unacked_packets_.HasPendingCryptoPackets();
}
size_t QuicSentPacketManagerPeer::GetNumRetransmittablePackets(
const QuicSentPacketManager* sent_packet_manager) {
return sent_packet_manager->unacked_packets_.GetNumRetransmittablePackets();
}
SequenceNumberSet QuicSentPacketManagerPeer::GetUnackedPackets(
const QuicSentPacketManager* sent_packet_manager) {
return sent_packet_manager->unacked_packets_.GetUnackedPackets();
}
}
}