gfe-relnote: only respect TLPR when there is pending non-crypto stream data. Flag protected by quic_ignore_tlpr_if_no_pending_stream_data and session_decides_what_to_write.

When calculating the tail loss probe delay and TLPR option is enabled, only use half tail loss probe when session has pending stream data. Otherwise, ignore TLPR.

PiperOrigin-RevId: 253286073
Change-Id: I9321c9d0608f68bb4ec0f7f4fbba1e470e4a0a3c
diff --git a/quic/core/quic_session.h b/quic/core/quic_session.h
index ef4e804..a76e7df 100644
--- a/quic/core/quic_session.h
+++ b/quic/core/quic_session.h
@@ -150,6 +150,7 @@
                         TransmissionType type) override;
   bool IsFrameOutstanding(const QuicFrame& frame) const override;
   bool HasUnackedCryptoData() const override;
+  bool HasUnackedStreamData() const override;
 
   // Called on every incoming packet. Passes |packet| through to |connection_|.
   virtual void ProcessUdpPacket(const QuicSocketAddress& self_address,
@@ -324,6 +325,9 @@
   // a stream is reset because of an error).
   void OnStreamDoneWaitingForAcks(QuicStreamId id);
 
+  // Called when stream |id| is newly waiting for acks.
+  void OnStreamWaitingForAcks(QuicStreamId id);
+
   // Called to cancel retransmission of unencypted crypto stream data.
   void NeuterUnencryptedData();
 
@@ -616,6 +620,11 @@
   // stream.
   void PendingStreamOnRstStream(const QuicRstStreamFrame& frame);
 
+  bool ignore_tlpr_if_no_pending_stream_data() const {
+    return connection_->sent_packet_manager()
+        .ignore_tlpr_if_no_pending_stream_data();
+  }
+
   // Keep track of highest received byte offset of locally closed streams, while
   // waiting for a definitive final highest offset from the peer.
   std::map<QuicStreamId, QuicStreamOffset>
@@ -654,6 +663,9 @@
   // been consumed.
   QuicUnorderedSet<QuicStreamId> draining_streams_;
 
+  // Set of stream ids that are waiting for acks excluding crypto stream id.
+  QuicUnorderedSet<QuicStreamId> streams_waiting_for_acks_;
+
   // TODO(fayang): Consider moving LegacyQuicStreamIdManager into
   // UberQuicStreamIdManager.
   // Manages stream IDs for Google QUIC.
@@ -719,7 +731,7 @@
   // list may be a superset of the connection framer's supported versions.
   ParsedQuicVersionVector supported_versions_;
 
-  //  Latched value of quic_eliminate_static_stream_map.
+  // Latched value of quic_eliminate_static_stream_map.
   const bool eliminate_static_stream_map_;
 };