Pass maximum table capacity and max blocked streams in QpackDecoder constructor.

These two limits are set by the decoder using SETTINGS_QPACK_MAX_TABLE_CAPACITY
and SETTINGS_QPACK_BLOCKED_STREAMS, therefore they can be decided by
QuicSpdyStream or higher layers by the time QpackDecoder is constructed.
Therefore the constructor seems the most appropriate place to communicate these
to QpackDecoder.

(This is in contrast with the value of these settings in the encoder, which
are received via SETTINGS from the peer after QpackEncoder is instantiated.)

gfe-relnote: n/a, change to QUIC v99-only code.  Protected by existing disabled gfe2_reloadable_flag_quic_enable_version_99.
PiperOrigin-RevId: 261601336
Change-Id: I1449b63e67e387714a3bc30b6488571277281475
diff --git a/quic/core/qpack/offline/qpack_offline_decoder.cc b/quic/core/qpack/offline/qpack_offline_decoder.cc
index 20af074..267c679 100644
--- a/quic/core/qpack/offline/qpack_offline_decoder.cc
+++ b/quic/core/qpack/offline/qpack_offline_decoder.cc
@@ -20,7 +20,6 @@
 
 QpackOfflineDecoder::QpackOfflineDecoder()
     : encoder_stream_error_detected_(false),
-      qpack_decoder_(this, &decoder_stream_sender_delegate_),
       max_blocked_streams_(0) {}
 
 bool QpackOfflineDecoder::DecodeAndVerifyOfflineData(
@@ -93,8 +92,9 @@
                     << "\" as an integer.";
     return false;
   }
-
-  qpack_decoder_.SetMaximumDynamicTableCapacity(maximum_dynamic_table_capacity);
+  qpack_decoder_ = QuicMakeUnique<QpackDecoder>(
+      maximum_dynamic_table_capacity, max_blocked_streams_, this,
+      &decoder_stream_sender_delegate_);
 
   return true;
 }
@@ -133,7 +133,7 @@
 
     // Process data.
     if (stream_id == 0) {
-      qpack_decoder_.DecodeEncoderStreamData(data);
+      qpack_decoder_->DecodeEncoderStreamData(data);
 
       if (encoder_stream_error_detected_) {
         QUIC_LOG(ERROR) << "Error detected on encoder stream.";
@@ -141,7 +141,7 @@
       }
     } else {
       auto headers_handler = QuicMakeUnique<test::TestHeadersHandler>();
-      auto progressive_decoder = qpack_decoder_.CreateProgressiveDecoder(
+      auto progressive_decoder = qpack_decoder_->CreateProgressiveDecoder(
           stream_id, headers_handler.get());
 
       progressive_decoder->Decode(data);
@@ -183,6 +183,7 @@
     }
 
     // Enforce limit on blocked streams.
+    // TODO(b/112770235): Move this logic to QpackDecoder.
     uint64_t blocked_streams_count = 0;
     for (const auto& decoder : decoders_) {
       if (!decoder.headers_handler->decoding_completed()) {