gfe-relnote: Remove save_retransmittable_frames from QuicPacketCreator::AddFrame. No functional change expected, not protected. PiperOrigin-RevId: 276105002 Change-Id: I5ad4fb4d7412fb64c5cac6d9e59fed6281df8c34
diff --git a/quic/core/quic_packet_creator.cc b/quic/core/quic_packet_creator.cc index 15e9651..0dc2921 100644 --- a/quic/core/quic_packet_creator.cc +++ b/quic/core/quic_packet_creator.cc
@@ -222,8 +222,7 @@ if (needs_full_padding) { needs_full_padding_ = true; } - return AddFrame(*frame, /*save_retransmittable_frames*/ true, - transmission_type); + return AddFrame(*frame, transmission_type); } bool QuicPacketCreator::ConsumeDataToFillCurrentPacket( @@ -250,8 +249,7 @@ delegate_->OnUnrecoverableError(QUIC_CRYPTO_CHLO_TOO_LARGE, error_details); return false; } - if (!AddFrame(*frame, /*save_retransmittable_frames=*/true, - transmission_type)) { + if (!AddFrame(*frame, transmission_type)) { // Fails if we try to write unencrypted stream data. return false; } @@ -569,15 +567,13 @@ bool QuicPacketCreator::AddSavedFrame(const QuicFrame& frame, TransmissionType transmission_type) { - return AddFrame(frame, /*save_retransmittable_frames=*/true, - transmission_type); + return AddFrame(frame, transmission_type); } bool QuicPacketCreator::AddPaddedSavedFrame( const QuicFrame& frame, TransmissionType transmission_type) { - if (AddFrame(frame, /*save_retransmittable_frames=*/true, - transmission_type)) { + if (AddFrame(frame, transmission_type)) { needs_full_padding_ = true; return true; } @@ -1310,7 +1306,6 @@ } bool QuicPacketCreator::AddFrame(const QuicFrame& frame, - bool save_retransmittable_frames, TransmissionType transmission_type) { QUIC_DVLOG(1) << ENDPOINT << "Adding frame with transmission type " << TransmissionTypeToString(transmission_type) << ": " << frame; @@ -1347,16 +1342,14 @@ packet_size_ += ExpansionOnNewFrame() + frame_len; - if (save_retransmittable_frames && - QuicUtils::IsRetransmittableFrame(frame.type)) { + if (QuicUtils::IsRetransmittableFrame(frame.type)) { packet_.retransmittable_frames.push_back(frame); queued_frames_.push_back(frame); if (QuicUtils::IsHandshakeFrame(frame, framer_->transport_version())) { packet_.has_crypto_handshake = IS_HANDSHAKE; } } else { - if (populate_nonretransmittable_frames_ && - !QuicUtils::IsRetransmittableFrame(frame.type)) { + if (populate_nonretransmittable_frames_) { if (frame.type == PADDING_FRAME && frame.padding_frame.num_padding_bytes == -1) { // Populate the actual length of full padding frame, such that one can @@ -1463,7 +1456,7 @@ std::max<int16_t>(packet_.num_padding_bytes, extra_padding_bytes); } - bool success = AddFrame(QuicFrame(QuicPaddingFrame(padding_bytes)), false, + bool success = AddFrame(QuicFrame(QuicPaddingFrame(padding_bytes)), packet_.transmission_type); QUIC_BUG_IF(!success) << "Failed to add padding_bytes: " << padding_bytes << " transmission_type: "
diff --git a/quic/core/quic_packet_creator.h b/quic/core/quic_packet_creator.h index 3fd877d..518e71d 100644 --- a/quic/core/quic_packet_creator.h +++ b/quic/core/quic_packet_creator.h
@@ -434,10 +434,8 @@ void FillPacketHeader(QuicPacketHeader* header); // Adds a |frame| if there is space and returns false and flushes all pending - // frames if there isn't room. If |save_retransmittable_frames| is true, - // saves the |frame| in the next SerializedPacket. + // frames if there isn't room. bool AddFrame(const QuicFrame& frame, - bool save_retransmittable_frames, TransmissionType transmission_type); // Adds a padding frame to the current packet (if there is space) when (1)
diff --git a/quic/test_tools/quic_packet_creator_peer.cc b/quic/test_tools/quic_packet_creator_peer.cc index be934fd..7c8db91 100644 --- a/quic/test_tools/quic_packet_creator_peer.cc +++ b/quic/test_tools/quic_packet_creator_peer.cc
@@ -108,14 +108,13 @@ DCHECK(creator->queued_frames_.empty()); DCHECK(!frames.empty()); for (const QuicFrame& frame : frames) { - bool success = creator->AddFrame(frame, false, NOT_RETRANSMISSION); + bool success = creator->AddFrame(frame, NOT_RETRANSMISSION); DCHECK(success); } creator->SerializePacket(buffer, buffer_len); - SerializedPacket packet = creator->packet_; + SerializedPacket packet = std::move(creator->packet_); // The caller takes ownership of the QuicEncryptedPacket. creator->packet_.encrypted_buffer = nullptr; - DCHECK(packet.retransmittable_frames.empty()); return packet; }