Introduce the concept of STOP_SENDING in gQUIC.

gQUIC uses to have RST(QUIC_STREAM_NO_ERROR) to achieve STOP_SENDING semantics. This change would unify this behavior with IETF STOP_SENDING.

Protected by quic_reloadable_flag_quic_split_up_send_rst.

PiperOrigin-RevId: 336959906
Change-Id: Ie1daa4a96bcdd627354b1425bd736a91f153beab
diff --git a/quic/core/quic_stream.h b/quic/core/quic_stream.h
index 89178c4..467cca9 100644
--- a/quic/core/quic_stream.h
+++ b/quic/core/quic_stream.h
@@ -403,6 +403,12 @@
   // empty.
   void SetFinSent();
 
+  // Send STOP_SENDING if it hasn't been sent yet.
+  void MaybeSendStopSending(QuicRstStreamErrorCode error);
+
+  // Send RESET_STREAM if it hasn't been sent yet.
+  void MaybeSendRstStream(QuicRstStreamErrorCode error);
+
   // Close the write side of the socket.  Further writes will fail.
   // Can be called by the subclass or internally.
   // Does not send a FIN.  May cause the stream to be closed.
@@ -509,6 +515,9 @@
   // True if this stream has received a RST_STREAM frame.
   bool rst_received_;
 
+  // True if the stream has sent STOP_SENDING to the session.
+  bool stop_sending_sent_;
+
   absl::optional<QuicFlowController> flow_controller_;
 
   // The connection level flow controller. Not owned.