Inject a random number generator into QuartcEndpoint and SendAlgorithms.
QuicSentPacketManager now takes a QuicRandom instance in its construtor. It
shares the connection's random number generator, which may be injected through
the QuicConnectionHelperInterface. This random number generator is only used to
create a send algorithm.
Rather than using the default instance of QuicRandom, QuartcEndpoint and
QuartcConnectionHelper now use an injected instance. In production, this will
still be the default instance. However, in tests it may be replaced with a
deterministic generator (for reproducible results).
In all tests that currently use the QUIC simulator and construct their own
endpoints, inject the simulator's random number generator.
In QuartcBidiTest, set the simulator to use a SimpleRandom generator (which
should give predictable output based on a fixed seed).
gfe-relnote: n/a (Quartc only)
PiperOrigin-RevId: 244280321
Change-Id: I1925f79e3cec3ff7f474f4b979b85c387751503f
diff --git a/quic/core/quic_sent_packet_manager.h b/quic/core/quic_sent_packet_manager.h
index 7e10b77..f7f3c12 100644
--- a/quic/core/quic_sent_packet_manager.h
+++ b/quic/core/quic_sent_packet_manager.h
@@ -89,6 +89,7 @@
QuicSentPacketManager(Perspective perspective,
const QuicClock* clock,
+ QuicRandom* random,
QuicConnectionStats* stats,
CongestionControlType congestion_control_type,
LossDetectionType loss_type);
@@ -535,6 +536,7 @@
PendingRetransmissionMap pending_retransmissions_;
const QuicClock* clock_;
+ QuicRandom* random_;
QuicConnectionStats* stats_;
DebugDelegate* debug_delegate_;