Clean up code on SETTINGS.

SETTINGS are now only sent in HTTP/3. And since it's sent once encryption is established, it doesn't need to be explicitly sent before PRIORITY is written.

gfe-relnote: protected by disabled v99 flag.
PiperOrigin-RevId: 276159509
Change-Id: I8a090fcc54c222578ffcb0bf9c66dc00c0f2e20f
diff --git a/quic/core/http/quic_spdy_session.cc b/quic/core/http/quic_spdy_session.cc
index 6099f7d..8b42a90 100644
--- a/quic/core/http/quic_spdy_session.cc
+++ b/quic/core/http/quic_spdy_session.cc
@@ -531,7 +531,6 @@
       << "Server must not send priority";
 
   QuicConnection::ScopedPacketFlusher flusher(connection());
-  SendInitialData();
   send_control_stream_->WritePriority(priority);
 }
 
@@ -594,14 +593,15 @@
 }
 
 void QuicSpdySession::SendInitialData() {
-  if (VersionUsesHttp3(transport_version())) {
-    QuicConnection::ScopedPacketFlusher flusher(connection());
-    send_control_stream_->MaybeSendSettingsFrame();
-    // TODO(renjietang): Remove this once stream id manager can take dynamically
-    // created HTTP/3 unidirectional streams.
-    qpack_encoder_send_stream_->MaybeSendStreamType();
-    qpack_decoder_send_stream_->MaybeSendStreamType();
+  if (!VersionUsesHttp3(transport_version())) {
+    return;
   }
+  QuicConnection::ScopedPacketFlusher flusher(connection());
+  send_control_stream_->MaybeSendSettingsFrame();
+  // TODO(renjietang): Remove this once stream id manager can take dynamically
+  // created HTTP/3 unidirectional streams.
+  qpack_encoder_send_stream_->MaybeSendStreamType();
+  qpack_decoder_send_stream_->MaybeSendStreamType();
 }
 
 QpackEncoder* QuicSpdySession::qpack_encoder() {
@@ -631,10 +631,7 @@
 
 void QuicSpdySession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) {
   QuicSession::OnCryptoHandshakeEvent(event);
-  if (VersionUsesHttp3(transport_version()) ||
-      (event == HANDSHAKE_CONFIRMED && config()->SupportMaxHeaderListSize())) {
-    SendInitialData();
-  }
+  SendInitialData();
 }
 
 // True if there are open HTTP requests.