Deprecate --gfe2_reloadable_flag_quic_ignore_max_push_id.

Remove Http3DebugVisitor::OnMaxPushIdFrameReceived().  This method was never
implemented server side, and is useless client side, because servers are not
allowed to send MAX_PUSH_ID frames.

In Chromium, QuicHttp3Logger::OnMaxPushIdFrameReceived() and
NetLogEventType::HTTP3_MAX_PUSH_ID_RECEIVED should be removed.

Remove QuicSpdySession::OnMaxPushIdFrame() and max_push_id_.

PiperOrigin-RevId: 442564242
diff --git a/quiche/quic/core/http/quic_receive_control_stream.cc b/quiche/quic/core/http/quic_receive_control_stream.cc
index 853909a..1eba8f5 100644
--- a/quiche/quic/core/http/quic_receive_control_stream.cc
+++ b/quiche/quic/core/http/quic_receive_control_stream.cc
@@ -62,21 +62,9 @@
   stream_delegate()->OnStreamError(decoder->error(), decoder->error_detail());
 }
 
-bool QuicReceiveControlStream::OnMaxPushIdFrame(const MaxPushIdFrame& frame) {
-  if (GetQuicReloadableFlag(quic_ignore_max_push_id)) {
-    QUIC_RELOADABLE_FLAG_COUNT(quic_ignore_max_push_id);
-    return ValidateFrameType(HttpFrameType::MAX_PUSH_ID);
-  }
-
-  if (spdy_session()->debug_visitor()) {
-    spdy_session()->debug_visitor()->OnMaxPushIdFrameReceived(frame);
-  }
-
-  if (!ValidateFrameType(HttpFrameType::MAX_PUSH_ID)) {
-    return false;
-  }
-
-  return spdy_session()->OnMaxPushIdFrame(frame.push_id);
+bool QuicReceiveControlStream::OnMaxPushIdFrame(
+    const MaxPushIdFrame& /*frame*/) {
+  return ValidateFrameType(HttpFrameType::MAX_PUSH_ID);
 }
 
 bool QuicReceiveControlStream::OnGoAwayFrame(const GoAwayFrame& frame) {
diff --git a/quiche/quic/core/http/quic_spdy_session.cc b/quiche/quic/core/http/quic_spdy_session.cc
index 48baa74..58ce9ac 100644
--- a/quiche/quic/core/http/quic_spdy_session.cc
+++ b/quiche/quic/core/http/quic_spdy_session.cc
@@ -1558,38 +1558,6 @@
   }
 }
 
-bool QuicSpdySession::OnMaxPushIdFrame(PushId max_push_id) {
-  QUICHE_DCHECK(VersionUsesHttp3(transport_version()));
-  QUICHE_DCHECK_EQ(Perspective::IS_SERVER, perspective());
-
-  if (max_push_id_.has_value()) {
-    QUIC_DVLOG(1) << "Setting max_push_id to:  " << max_push_id
-                  << " from: " << max_push_id_.value();
-  } else {
-    QUIC_DVLOG(1) << "Setting max_push_id to:  " << max_push_id
-                  << " from unset";
-  }
-  absl::optional<PushId> old_max_push_id = max_push_id_;
-  max_push_id_ = max_push_id;
-
-  if (!old_max_push_id.has_value() || max_push_id > old_max_push_id.value()) {
-    OnCanCreateNewOutgoingStream(true);
-    return true;
-  }
-
-  // Equal value is not considered an error.
-  if (max_push_id < old_max_push_id.value()) {
-    CloseConnectionWithDetails(
-        QUIC_HTTP_INVALID_MAX_PUSH_ID,
-        absl::StrCat("MAX_PUSH_ID received with value ", max_push_id,
-                     " which is smaller that previously received value ",
-                     old_max_push_id.value()));
-    return false;
-  }
-
-  return true;
-}
-
 bool QuicSpdySession::goaway_received() const {
   return VersionUsesHttp3(transport_version())
              ? last_received_http3_goaway_id_.has_value()
diff --git a/quiche/quic/core/http/quic_spdy_session.h b/quiche/quic/core/http/quic_spdy_session.h
index b31b5ad..8d737d6 100644
--- a/quiche/quic/core/http/quic_spdy_session.h
+++ b/quiche/quic/core/http/quic_spdy_session.h
@@ -81,8 +81,6 @@
   // Incoming HTTP/3 frames on the control stream.
   virtual void OnSettingsFrameReceived(const SettingsFrame& /*frame*/) = 0;
   virtual void OnGoAwayFrameReceived(const GoAwayFrame& /*frame*/) {}
-  // TODO(b/171463363): Remove.
-  virtual void OnMaxPushIdFrameReceived(const MaxPushIdFrame& /*frame*/) {}
   virtual void OnPriorityUpdateFrameReceived(
       const PriorityUpdateFrame& /*frame*/) {}
   virtual void OnAcceptChFrameReceived(const AcceptChFrame& /*frame*/) {}
@@ -322,14 +320,6 @@
   // those streams are not initialized yet.
   void OnCanCreateNewOutgoingStream(bool unidirectional) override;
 
-  // Sets |max_push_id_|.
-  // This method must only be called if protocol is IETF QUIC and perspective is
-  // server.  It must only be called if a MAX_PUSH_ID frame is received.
-  // Returns whether |max_push_id| is greater than or equal to current
-  // |max_push_id_|.
-  // TODO(b/171463363): Remove.
-  bool OnMaxPushIdFrame(PushId max_push_id);
-
   int32_t destruction_indicator() const { return destruction_indicator_; }
 
   void set_debug_visitor(Http3DebugVisitor* debug_visitor) {
@@ -567,10 +557,9 @@
       absl::string_view type);
 
   // Sends any data which should be sent at the start of a connection, including
-  // the initial SETTINGS frame, and (when IETF QUIC is used) also a MAX_PUSH_ID
-  // frame if SetMaxPushId() had been called before encryption was established.
-  // When using 0-RTT, this method is called twice: once when encryption is
-  // established, and again when 1-RTT keys are available.
+  // the initial SETTINGS frame.  When using 0-RTT, this method is called twice:
+  // once when encryption is established, and again when 1-RTT keys are
+  // available.
   void SendInitialData();
 
   void FillSettingsFrame();
@@ -631,20 +620,6 @@
   http2::Http2DecoderAdapter h2_deframer_;
   std::unique_ptr<SpdyFramerVisitor> spdy_framer_visitor_;
 
-  // Used in IETF QUIC only.
-  // For a server:
-  //   the push ID in the most recently received MAX_PUSH_ID frame,
-  //   or unset if no MAX_PUSH_ID frame has been received.
-  // For a client:
-  //   unset until SetMaxPushId() is called;
-  //   before encryption is established, the push ID to be sent in the initial
-  //   MAX_PUSH_ID frame;
-  //   after encryption is established, the push ID in the most recently sent
-  //   MAX_PUSH_ID frame.
-  // Once set, never goes back to unset.
-  // TODO(b/171463363): Remove.
-  absl::optional<PushId> max_push_id_;
-
   // Not owned by the session.
   Http3DebugVisitor* debug_visitor_;
 
diff --git a/quiche/quic/core/http/quic_spdy_session_test.cc b/quiche/quic/core/http/quic_spdy_session_test.cc
index e26432a..8636a75 100644
--- a/quiche/quic/core/http/quic_spdy_session_test.cc
+++ b/quiche/quic/core/http/quic_spdy_session_test.cc
@@ -502,29 +502,6 @@
     return std::string(priority_buffer.get(), priority_frame_length);
   }
 
-  // TODO(b/171463363): Remove.
-  std::string SerializeMaxPushIdFrame(PushId push_id) {
-    const QuicByteCount payload_length =
-        QuicDataWriter::GetVarInt62Len(push_id);
-
-    const QuicByteCount total_length =
-        QuicDataWriter::GetVarInt62Len(
-            static_cast<uint64_t>(HttpFrameType::MAX_PUSH_ID)) +
-        QuicDataWriter::GetVarInt62Len(payload_length) +
-        QuicDataWriter::GetVarInt62Len(push_id);
-
-    std::string max_push_id_frame(total_length, '\0');
-    QuicDataWriter writer(total_length, &*max_push_id_frame.begin());
-
-    QUICHE_CHECK(writer.WriteVarInt62(
-        static_cast<uint64_t>(HttpFrameType::MAX_PUSH_ID)));
-    QUICHE_CHECK(writer.WriteVarInt62(payload_length));
-    QUICHE_CHECK(writer.WriteVarInt62(push_id));
-    QUICHE_CHECK_EQ(0u, writer.remaining());
-
-    return max_push_id_frame;
-  }
-
   QuicStreamId StreamCountToId(QuicStreamCount stream_count,
                                Perspective perspective, bool bidirectional) {
     // Calculate and build up stream ID rather than use
@@ -1815,60 +1792,6 @@
   }
 }
 
-// TODO(b/171463363): Remove.
-TEST_P(QuicSpdySessionTestServer, ReduceMaxPushId) {
-  if (GetQuicReloadableFlag(quic_ignore_max_push_id)) {
-    return;
-  }
-
-  if (!VersionUsesHttp3(transport_version())) {
-    return;
-  }
-
-  StrictMock<MockHttp3DebugVisitor> debug_visitor;
-  session_.set_debug_visitor(&debug_visitor);
-
-  // Use an arbitrary stream id for incoming control stream.
-  QuicStreamId stream_id =
-      GetNthClientInitiatedUnidirectionalStreamId(transport_version(), 3);
-  char type[] = {kControlStream};
-  absl::string_view stream_type(type, 1);
-
-  QuicStreamOffset offset = 0;
-  QuicStreamFrame data1(stream_id, false, offset, stream_type);
-  offset += stream_type.length();
-  EXPECT_CALL(debug_visitor, OnPeerControlStreamCreated(stream_id));
-  session_.OnStreamFrame(data1);
-  EXPECT_EQ(stream_id,
-            QuicSpdySessionPeer::GetReceiveControlStream(&session_)->id());
-
-  SettingsFrame settings;
-  std::string settings_frame = EncodeSettings(settings);
-  QuicStreamFrame data2(stream_id, false, offset, settings_frame);
-  offset += settings_frame.length();
-
-  EXPECT_CALL(debug_visitor, OnSettingsFrameReceived(settings));
-  session_.OnStreamFrame(data2);
-
-  std::string max_push_id_frame1 = SerializeMaxPushIdFrame(/* push_id = */ 3);
-  QuicStreamFrame data3(stream_id, false, offset, max_push_id_frame1);
-  offset += max_push_id_frame1.length();
-
-  EXPECT_CALL(debug_visitor, OnMaxPushIdFrameReceived(_));
-  session_.OnStreamFrame(data3);
-
-  std::string max_push_id_frame2 = SerializeMaxPushIdFrame(/* push_id = */ 1);
-  QuicStreamFrame data4(stream_id, false, offset, max_push_id_frame2);
-
-  EXPECT_CALL(debug_visitor, OnMaxPushIdFrameReceived(_));
-  EXPECT_CALL(*connection_,
-              CloseConnection(QUIC_HTTP_INVALID_MAX_PUSH_ID,
-                              "MAX_PUSH_ID received with value 1 which is "
-                              "smaller that previously received value 3",
-                              _));
-  session_.OnStreamFrame(data4);
-}
-
 class QuicSpdySessionTestClient : public QuicSpdySessionTestBase {
  protected:
   QuicSpdySessionTestClient()
diff --git a/quiche/quic/core/quic_flags_list.h b/quiche/quic/core/quic_flags_list.h
index 12cac82..2ab566c 100644
--- a/quiche/quic/core/quic_flags_list.h
+++ b/quiche/quic/core/quic_flags_list.h
@@ -67,8 +67,6 @@
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_flush_pending_frames_and_padding_bytes_on_migration, true)
 // If true, ietf connection migration is no longer conditioned on connection option RVCM.
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_remove_connection_migration_connection_option_v2, false)
-// If true, ignore incoming MAX_PUSH_ID frames (expect for enforcing frame type rules).
-QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_ignore_max_push_id, true)
 // If true, include stream information in idle timeout connection close detail.
 QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_add_stream_info_to_idle_close_detail, true)
 // If true, limit the size of HPACK encoder dynamic table to 16 kB.  Only affects gQUIC; QPACK encoder dynamic table size used in IETF QUIC is already bounded.
diff --git a/quiche/quic/test_tools/quic_test_utils.h b/quiche/quic/test_tools/quic_test_utils.h
index aadf96f..84aebc1 100644
--- a/quiche/quic/test_tools/quic_test_utils.h
+++ b/quiche/quic/test_tools/quic_test_utils.h
@@ -959,8 +959,6 @@
   MOCK_METHOD(void, OnSettingsFrameReceived, (const SettingsFrame&),
               (override));
   MOCK_METHOD(void, OnGoAwayFrameReceived, (const GoAwayFrame&), (override));
-  MOCK_METHOD(void, OnMaxPushIdFrameReceived, (const MaxPushIdFrame&),
-              (override));
   MOCK_METHOD(void, OnPriorityUpdateFrameReceived, (const PriorityUpdateFrame&),
               (override));
   MOCK_METHOD(void, OnAcceptChFrameReceived, (const AcceptChFrame&),