Add QuicStreamsBlockedFrame and QuicMaxStreamsFrame classes

There are two main parts to this work
1) connecting up the new frames, replacing the old ones, to move data around the
   system. This also entails a lot of editorial changes (just changing names, comments,
   and so on, without notable logic chanages -- eg, "OnMaxStreamIdFrame" becomes
   "OnMaxStreamsFrame".

2) the second, and more complex, task is revising the stream id manager to work entirely
   with stream counts rather than stream-ids. For example, the logic to check whether a
   new stream can be created checks if the current-stream-count is less than the limit
   or not, rather than if the next stream id to hand out is above the limit or not.
   For all intents and purposes, this completely rewrote the stream ID manager.

   Another big change resulting from keeping track solely of stream counts is that the
   stream ID manager doesn't care whether it is doing unidirectional or bidirectional
   streams, nor does it care whether stream ids are client- or server- initiated.

gfe-relnote: N/A, all changes are for V99/IETF QUIC code only.

LOG_STORAGE_INCREASE(GB/week): 0
TMPLOG_STORAGE_INCREASE(GB): 0

This change neither adds nor deletes data stored. It adds two new codepoints to the QUIC FrameType enum.  These new enums reflect two new frames defined in IETF QUIC, which replace two now-deprecated frames (and their associated type codepoints). This is a name change/type codepoint extension; data is neither added nor deleted.

PiperOrigin-RevId: 244661277
Change-Id: I07cdb79db6bd15e1d5ece97b3aa2d67e94ccf00b
diff --git a/quic/core/quic_session.cc b/quic/core/quic_session.cc
index 91d323b..d780961 100644
--- a/quic/core/quic_session.cc
+++ b/quic/core/quic_session.cc
@@ -244,14 +244,14 @@
 
   // Get the QuicStream for this stream. Ignore the STOP_SENDING
   // if the QuicStream pointer is NULL
-  // QUESTION: IS THIS THE RIGHT THING TO DO? (that is, this would happen IFF
-  // there was an entry in the map, but the pointer is null. sounds more like a
-  // deep programming error rather than a simple protocol problem).
+  // QUESTION(fkastenholz): IS THIS THE RIGHT THING TO DO? (that is, this would
+  // happen IFF there was an entry in the map, but the pointer is null. sounds
+  // more like a deep programming error rather than a simple protocol problem).
   QuicStream* stream = it->second.get();
   if (stream == nullptr) {
-    QUIC_DVLOG(1) << ENDPOINT
-                  << "Received STOP_SENDING for NULL QuicStream, stream_id: "
-                  << stream_id << ". Ignoring.";
+    QUIC_BUG << ENDPOINT
+             << "Received STOP_SENDING for NULL QuicStream, stream_id: "
+             << stream_id << ". Ignoring.";
     return true;
   }
 
@@ -732,12 +732,15 @@
   control_frame_manager_.WriteOrBufferWindowUpdate(id, byte_offset);
 }
 
-void QuicSession::SendMaxStreamId(QuicStreamId max_allowed_incoming_id) {
-  control_frame_manager_.WriteOrBufferMaxStreamId(max_allowed_incoming_id);
+void QuicSession::SendMaxStreams(QuicStreamCount stream_count,
+                                 bool unidirectional) {
+  control_frame_manager_.WriteOrBufferMaxStreams(stream_count, unidirectional);
 }
 
-void QuicSession::SendStreamIdBlocked(QuicStreamId max_allowed_outgoing_id) {
-  control_frame_manager_.WriteOrBufferStreamIdBlocked(max_allowed_outgoing_id);
+void QuicSession::SendStreamsBlocked(QuicStreamCount stream_count,
+                                     bool unidirectional) {
+  control_frame_manager_.WriteOrBufferStreamsBlocked(stream_count,
+                                                     unidirectional);
 }
 
 void QuicSession::CloseStream(QuicStreamId stream_id) {
@@ -913,7 +916,14 @@
   }
   QUIC_DVLOG(1) << "Setting max_open_outgoing_streams_ to " << max_streams;
   if (connection_->transport_version() == QUIC_VERSION_99) {
-    v99_streamid_manager_.SetMaxOpenOutgoingStreams(max_streams);
+    // TODO: When transport negotiation knows about bi- and uni- directional
+    // streams, this should be modified to indicate which one to the manager.
+    // Currently, BOTH are set to the same value.
+    // TODO(fkastenholz): AdjustMax is cognizant of the number of static streams
+    // and sets the maximum to be max_streams + number_of_statics. This should
+    // eventually be removed from IETF QUIC. -- Replace the call with
+    // ConfigureMaxOpen...
+    v99_streamid_manager_.AdjustMaxOpenOutgoingStreams(max_streams);
   } else {
     stream_id_manager_.set_max_open_outgoing_streams(max_streams);
   }
@@ -1765,13 +1775,12 @@
   return stream_id_manager_.next_outgoing_stream_id();
 }
 
-bool QuicSession::OnMaxStreamIdFrame(const QuicMaxStreamIdFrame& frame) {
-  return v99_streamid_manager_.OnMaxStreamIdFrame(frame);
+bool QuicSession::OnMaxStreamsFrame(const QuicMaxStreamsFrame& frame) {
+  return v99_streamid_manager_.OnMaxStreamsFrame(frame);
 }
 
-bool QuicSession::OnStreamIdBlockedFrame(
-    const QuicStreamIdBlockedFrame& frame) {
-  return v99_streamid_manager_.OnStreamIdBlockedFrame(frame);
+bool QuicSession::OnStreamsBlockedFrame(const QuicStreamsBlockedFrame& frame) {
+  return v99_streamid_manager_.OnStreamsBlockedFrame(frame);
 }
 
 size_t QuicSession::max_open_incoming_bidirectional_streams() const {