Deprecate gfe2_reloadable_flag_quic_update_packet_size.

PiperOrigin-RevId: 328798592
Change-Id: I1d694f071a6f6882a3d518cdc985438ce6226212
diff --git a/quic/core/quic_packet_creator.cc b/quic/core/quic_packet_creator.cc
index bfced90..358a4ae 100644
--- a/quic/core/quic_packet_creator.cc
+++ b/quic/core/quic_packet_creator.cc
@@ -717,21 +717,14 @@
   return kQuicStreamPayloadLengthSize;
 }
 
-size_t QuicPacketCreator::BytesFree() {
+size_t QuicPacketCreator::BytesFree() const {
   DCHECK_GE(max_plaintext_size_, PacketSize());
   return max_plaintext_size_ -
          std::min(max_plaintext_size_, PacketSize() + ExpansionOnNewFrame());
 }
 
-size_t QuicPacketCreator::PacketSize() {
-  if (update_packet_size_) {
-    return queued_frames_.empty() ? PacketHeaderSize() : packet_size_;
-  }
-  if (!queued_frames_.empty()) {
-    return packet_size_;
-  }
-  packet_size_ = PacketHeaderSize();
-  return packet_size_;
+size_t QuicPacketCreator::PacketSize() const {
+  return queued_frames_.empty() ? PacketHeaderSize() : packet_size_;
 }
 
 bool QuicPacketCreator::AddPaddedSavedFrame(
@@ -1637,8 +1630,7 @@
     FlushCurrentPacket();
     return false;
   }
-  if (update_packet_size_ && queued_frames_.empty()) {
-    QUIC_RELOADABLE_FLAG_COUNT(quic_update_packet_size);
+  if (queued_frames_.empty()) {
     packet_size_ = PacketHeaderSize();
   }
   DCHECK_LT(0u, packet_size_);
diff --git a/quic/core/quic_packet_creator.h b/quic/core/quic_packet_creator.h
index 5edcff3..19f0c2a 100644
--- a/quic/core/quic_packet_creator.h
+++ b/quic/core/quic_packet_creator.h
@@ -163,14 +163,14 @@
 
   // Returns true if current open packet can accommodate more stream frames of
   // stream |id| at |offset| and data length |data_size|, false otherwise.
-  // TODO(fayang): mark this const when deprecating quic_update_packet_size.
+  // TODO(fayang): mark this const by moving RemoveSoftMaxPacketLength out.
   bool HasRoomForStreamFrame(QuicStreamId id,
                              QuicStreamOffset offset,
                              size_t data_size);
 
   // Returns true if current open packet can accommodate a message frame of
   // |length|.
-  // TODO(fayang): mark this const when deprecating quic_update_packet_size.
+  // TODO(fayang): mark this const by moving RemoveSoftMaxPacketLength out.
   bool HasRoomForMessageFrame(QuicByteCount length);
 
   // Serializes all added frames into a single packet and invokes the delegate_
@@ -202,8 +202,7 @@
   // frames in the packet.  Since stream frames are slightly smaller when they
   // are the last frame in a packet, this method will return a different
   // value than max_packet_size - PacketSize(), in this case.
-  // TODO(fayang): mark this const when deprecating quic_update_packet_size.
-  size_t BytesFree();
+  size_t BytesFree() const;
 
   // Returns the number of bytes that the packet will expand by if a new frame
   // is added to the packet. If the last frame was a stream frame, it will
@@ -220,8 +219,7 @@
   // if serialized with the current frames.  Adding a frame to the packet
   // may change the serialized length of existing frames, as per the comment
   // in BytesFree.
-  // TODO(fayang): mark this const when deprecating quic_update_packet_size.
-  size_t PacketSize();
+  size_t PacketSize() const;
 
   // Tries to add |frame| to the packet creator's list of frames to be
   // serialized. If the frame does not fit into the current packet, flushes the
@@ -653,9 +651,6 @@
   // negotiates this during the handshake.
   QuicByteCount max_datagram_frame_size_;
 
-  const bool update_packet_size_ =
-      GetQuicReloadableFlag(quic_update_packet_size);
-
   const bool coalesced_packet_of_higher_space_ =
       GetQuicReloadableFlag(quic_coalesced_packet_of_higher_space2);
 };