Deprecate QuicSession::SendStopSending().

Protected by quic_reloadable_flag_quic_unify_stop_sending.

PiperOrigin-RevId: 358005575
Change-Id: I636ac7d1bdd67239a0a85c2cff5af694eae60fc0
diff --git a/quic/core/http/quic_spdy_session.cc b/quic/core/http/quic_spdy_session.cc
index 5374044..94e2bfc 100644
--- a/quic/core/http/quic_spdy_session.cc
+++ b/quic/core/http/quic_spdy_session.cc
@@ -1413,7 +1413,15 @@
       return true;
     }
     default:
-      SendStopSending(QUIC_STREAM_STREAM_CREATION_ERROR, pending->id());
+      if (GetQuicReloadableFlag(quic_unify_stop_sending)) {
+        QUIC_RELOADABLE_FLAG_COUNT(quic_unify_stop_sending);
+        MaybeSendStopSendingFrame(pending->id(),
+                                  QUIC_STREAM_STREAM_CREATION_ERROR);
+      } else {
+        // TODO(renjietang): deprecate SendStopSending() when the flag is
+        // deprecated.
+        SendStopSending(QUIC_STREAM_STREAM_CREATION_ERROR, pending->id());
+      }
       pending->StopReading();
   }
   return false;
diff --git a/quic/core/quic_flags_list.h b/quic/core/quic_flags_list.h
index 82c923a..6c298b8 100644
--- a/quic/core/quic_flags_list.h
+++ b/quic/core/quic_flags_list.h
@@ -60,6 +60,7 @@
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_tls_use_normalized_sni_for_cert_selectioon, false)
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_tls_use_per_handshaker_proof_source, false)
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_unified_iw_options, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_unify_stop_sending, false)
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_update_packet_content_returns_connected, true)
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_use_encryption_level_context, true)
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_use_write_or_buffer_data_at_level, false)