Deprecate quic_update_max_datagram.

PiperOrigin-RevId: 917308005
diff --git a/quiche/common/quiche_feature_flags_list.h b/quiche/common/quiche_feature_flags_list.h
index 299fc29..08494c5 100755
--- a/quiche/common/quiche_feature_flags_list.h
+++ b/quiche/common/quiche_feature_flags_list.h
@@ -64,7 +64,6 @@
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_test_peer_addr_change_after_normalize, false, false, "If true, QuicConnection::ProcessValidatedPacket will use normalized address to test peer address changes.")
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_testonly_default_false, false, false, "A testonly reloadable flag that will always default to false.")
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_testonly_default_true, true, true, "A testonly reloadable flag that will always default to true.")
-QUICHE_FLAG(bool, quiche_reloadable_flag_quic_update_max_datagram, true, true, "If true, updates the maximum datagram size after flushing pending packets.")
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_use_received_client_addresses_cache, true, true, "If true, use a LRU cache to record client addresses of packets received on server's original address.")
 QUICHE_FLAG(bool, quiche_restart_flag_quic_client_cert_support, false, true, "If true, enables dynamic client certs in QUIC.")
 QUICHE_FLAG(bool, quiche_restart_flag_quic_dispatcher_close_connection_on_invalid_ack, false, false, "An invalid ack is an ack that the peer sent for a packet that was not sent by the dispatcher. If true, the dispatcher will close the connection if it receives an invalid ack.")
diff --git a/quiche/quic/core/quic_packet_creator.cc b/quiche/quic/core/quic_packet_creator.cc
index 6a5b780..7553054 100644
--- a/quiche/quic/core/quic_packet_creator.cc
+++ b/quiche/quic/core/quic_packet_creator.cc
@@ -1885,18 +1885,15 @@
   }
   if (!HasRoomForDatagramFrame(datagram_length)) {
     FlushCurrentPacket();
-    if (GetQuicReloadableFlag(quic_update_max_datagram)) {
-      QUIC_RELOADABLE_FLAG_COUNT(quic_update_max_datagram);
-      // The above FlushCurrentPacket() can occasionally enlarge needed space
-      // for packet number encoding. Repeat previous validation once more.
-      const QuicPacketLength max_payload = GetCurrentLargestDatagramPayload();
-      if (datagram_length > max_payload) {
-        QUIC_LOG(INFO)
-            << ENDPOINT
-            << "LargestDatagramPayload changed when inserting datagram. Packet "
-            << "number length probably changed.";
-        return DATAGRAM_STATUS_TOO_LARGE;
-      }
+    // The above FlushCurrentPacket() can occasionally enlarge needed space
+    // for packet number encoding. Repeat previous validation once more.
+    const QuicPacketLength max_payload = GetCurrentLargestDatagramPayload();
+    if (datagram_length > max_payload) {
+      QUIC_LOG(INFO)
+          << ENDPOINT
+          << "LargestDatagramPayload changed when inserting datagram. Packet "
+          << "number length probably changed.";
+      return DATAGRAM_STATUS_TOO_LARGE;
     }
   }
   QuicDatagramFrame* frame = new QuicDatagramFrame(datagram_id, datagram);
diff --git a/quiche/quic/core/quic_packet_creator_test.cc b/quiche/quic/core/quic_packet_creator_test.cc
index 991534e..fca1f41 100644
--- a/quiche/quic/core/quic_packet_creator_test.cc
+++ b/quiche/quic/core/quic_packet_creator_test.cc
@@ -4369,7 +4369,6 @@
 }
 
 TEST_F(QuicPacketCreatorMultiplePacketsTest, AddDatagramFrameSpaceChanges) {
-  SetQuicReloadableFlag(quic_update_max_datagram, true);
   if (framer_.version().IsIetfQuic()) {
     creator_.SetMaxDatagramFrameSize(kMaxAcceptedDatagramFrameSize);
   }