Plumb max_datagram_frame_size

In QUIC_CRYPTO, the maximum allowed size of a DATAGRAM/MESSAGE frame is unlimited. However, in QUIC+TLS, it's negotiated during the handshake using the max_datagram_frame_size IETF QUIC transport parameter. This CL adds this limit to QuicPacketCreator and plumbs it through during the handshake. Since all of our uses of the DATAGRAM/MESSAGE frame today only support QUIC_CRYPTO, this CL does not change any existing behavior.

Plumb max_datagram_frame_size, no behavior change, not flag protected

PiperOrigin-RevId: 310456458
Change-Id: Ib40d6e7e950865e496809ba5c880dc47cd243be9
diff --git a/quic/core/quic_packet_creator.h b/quic/core/quic_packet_creator.h
index 508cd56..fbe046f 100644
--- a/quic/core/quic_packet_creator.h
+++ b/quic/core/quic_packet_creator.h
@@ -278,6 +278,9 @@
   // Sets the maximum packet length.
   void SetMaxPacketLength(QuicByteCount length);
 
+  // Sets the maximum DATAGRAM/MESSAGE frame size we can send.
+  void SetMaxDatagramFrameSize(QuicByteCount max_datagram_frame_size);
+
   // Set a soft maximum packet length in the creator. If a packet cannot be
   // successfully created, creator will remove the soft limit and use the actual
   // max packet length.
@@ -589,6 +592,11 @@
   // SetSoftMaxPacketLength is called and max_packet_length_ gets
   // set to a soft value.
   QuicByteCount latched_hard_max_packet_length_;
+
+  // The maximum length of a MESSAGE/DATAGRAM frame that our peer is willing to
+  // accept. There is no limit for QUIC_CRYPTO connections, but QUIC+TLS
+  // negotiates this during the handshake.
+  QuicByteCount max_datagram_frame_size_;
 };
 
 }  // namespace quic