gfe-relnote: Decouple the QuicSession from the QuicStreamIdManager by introducing a QuicStreamIdManager::DelegateInterface which the session implements. Does not change behavior, merely adds a layer of abstraction which allows unit tests of QuicStreamIdManager to be simplified.

PiperOrigin-RevId: 270302454
Change-Id: I4a66803d4a2f1f640ef68ee6373af9b67423bac4
diff --git a/quic/core/quic_session.cc b/quic/core/quic_session.cc
index 23873d0..9d0c7bf 100644
--- a/quic/core/quic_session.cc
+++ b/quic/core/quic_session.cc
@@ -62,6 +62,7 @@
                          config_.GetMaxIncomingBidirectionalStreamsToSend()),
       v99_streamid_manager_(
           this,
+          num_expected_unidirectional_static_streams,
           kDefaultMaxStreamsPerConnection,
           kDefaultMaxStreamsPerConnection,
           config_.GetMaxIncomingBidirectionalStreamsToSend(),
@@ -771,6 +772,12 @@
   control_frame_manager_.WriteOrBufferWindowUpdate(id, byte_offset);
 }
 
+void QuicSession::OnError(QuicErrorCode error_code, std::string error_details) {
+  connection_->CloseConnection(
+      error_code, error_details,
+      ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
+}
+
 void QuicSession::SendMaxStreams(QuicStreamCount stream_count,
                                  bool unidirectional) {
   control_frame_manager_.WriteOrBufferMaxStreams(stream_count, unidirectional);
@@ -1049,6 +1056,7 @@
   // STREAMS_BLOCKED or MAX_STREAMS frames against the config and either send
   // the frames or discard them.
   if (VersionHasIetfQuicFrames(connection_->transport_version())) {
+    QuicConnection::ScopedPacketFlusher flusher(connection());
     v99_streamid_manager_.OnConfigNegotiated();
   }
 }