Add GetLargestGuaranteedMessagePayload to QuicSession/Connection/Generator/Creator to expose the largest message payload that's guaranteed to fit in any packet containing application data.

gfe-relnote: n/a (Only used in Quartc)
PiperOrigin-RevId: 242135946
Change-Id: I52cc763af88d22fc240210e00cf4d4062d0b9c59
diff --git a/quic/core/quic_connection_test.cc b/quic/core/quic_connection_test.cc
index 3d1e483..f5a840a 100644
--- a/quic/core/quic_connection_test.cc
+++ b/quic/core/quic_connection_test.cc
@@ -8257,7 +8257,7 @@
       connection_.SupportsMultiplePacketNumberSpaces()) {
     return;
   }
-  std::string message(connection_.GetLargestMessagePayload() * 2, 'a');
+  std::string message(connection_.GetCurrentLargestMessagePayload() * 2, 'a');
   QuicStringPiece message_data(message);
   QuicMemSliceStorage storage(nullptr, 0, nullptr, 0);
   {
@@ -8272,8 +8272,9 @@
         MESSAGE_STATUS_SUCCESS,
         connection_.SendMessage(
             1, MakeSpan(connection_.helper()->GetStreamSendBufferAllocator(),
-                        QuicStringPiece(message_data.data(),
-                                        connection_.GetLargestMessagePayload()),
+                        QuicStringPiece(
+                            message_data.data(),
+                            connection_.GetCurrentLargestMessagePayload()),
                         &storage)));
   }
   // Fail to send a message if connection is congestion control blocked.
@@ -8289,11 +8290,11 @@
   EXPECT_EQ(
       MESSAGE_STATUS_TOO_LARGE,
       connection_.SendMessage(
-          3,
-          MakeSpan(connection_.helper()->GetStreamSendBufferAllocator(),
-                   QuicStringPiece(message_data.data(),
-                                   connection_.GetLargestMessagePayload() + 1),
-                   &storage)));
+          3, MakeSpan(connection_.helper()->GetStreamSendBufferAllocator(),
+                      QuicStringPiece(
+                          message_data.data(),
+                          connection_.GetCurrentLargestMessagePayload() + 1),
+                      &storage)));
 }
 
 // Test to check that the path challenge/path response logic works