gfe-relnote: (n/a) Pluming work for loss detection tuning using go/smartchoices. No behavior change, not protected.

This adds 4 'broadcast' points to a quic session: SetLossDetectionTuner, OnMinRttAvailable, OnConfigNegotiated and OnConnectionClosed. Currently nothing is done at these points. The next CL will implement a loss detection tuner and use it from uStreamer.

PiperOrigin-RevId: 298729689
Change-Id: I90cabde07e9d4a1ab82b66cd4d416005db5ee7ec
diff --git a/quic/core/quic_sent_packet_manager.cc b/quic/core/quic_sent_packet_manager.cc
index c8fd641..eb59a8e 100644
--- a/quic/core/quic_sent_packet_manager.cc
+++ b/quic/core/quic_sent_packet_manager.cc
@@ -339,6 +339,19 @@
   }
 }
 
+void QuicSentPacketManager::SetLossDetectionTuner(
+    std::unique_ptr<LossDetectionTunerInterface> tuner) {
+  uber_loss_algorithm_.SetLossDetectionTuner(std::move(tuner));
+}
+
+void QuicSentPacketManager::OnConfigNegotiated() {
+  loss_algorithm_->OnConfigNegotiated();
+}
+
+void QuicSentPacketManager::OnConnectionClosed() {
+  loss_algorithm_->OnConnectionClosed();
+}
+
 void QuicSentPacketManager::SetHandshakeConfirmed() {
   if (!handshake_finished_) {
     handshake_finished_ = true;
@@ -951,8 +964,13 @@
   }
 
   QuicTime::Delta send_delta = ack_receive_time - transmission_info.sent_time;
+  const bool min_rtt_available = !rtt_stats_.min_rtt().IsZero();
   rtt_stats_.UpdateRtt(send_delta, ack_delay_time, ack_receive_time);
 
+  if (!min_rtt_available && !rtt_stats_.min_rtt().IsZero()) {
+    loss_algorithm_->OnMinRttAvailable();
+  }
+
   return true;
 }