Index: net/quic/quic_packet_creator.cc |
diff --git a/net/quic/quic_packet_creator.cc b/net/quic/quic_packet_creator.cc |
index c1d4e3954e80bfafbb8cc45b929926964461099b..79a33b73d19d981d42f3223c3345e9fb25515d10 100644 |
--- a/net/quic/quic_packet_creator.cc |
+++ b/net/quic/quic_packet_creator.cc |
@@ -413,6 +413,8 @@ SerializedPacket QuicPacketCreator::ReserializeAllFrames( |
DCHECK(queued_frames_.empty()); |
DCHECK(fec_group_.get() == nullptr); |
DCHECK(!needs_padding_); |
+ QUIC_BUG_IF(retransmission.retransmittable_frames.empty()) |
+ << "Attempt to serialize empty packet"; |
const QuicPacketNumberLength saved_length = packet_number_length_; |
const QuicPacketNumberLength saved_next_length = next_packet_number_length_; |
const bool saved_should_fec_protect = fec_protect_; |
@@ -433,8 +435,11 @@ SerializedPacket QuicPacketCreator::ReserializeAllFrames( |
} |
// Serialize the packet and restore the FEC and packet number length state. |
- SerializedPacket serialized_packet = SerializeAllFrames( |
- retransmission.retransmittable_frames, buffer, buffer_len); |
+ for (const QuicFrame& frame : retransmission.retransmittable_frames) { |
+ bool success = AddFrame(frame, false); |
+ DCHECK(success); |
+ } |
+ SerializedPacket serialized_packet = SerializePacket(buffer, buffer_len); |
if (FLAGS_quic_retransmit_via_onserializedpacket) { |
serialized_packet.original_packet_number = retransmission.packet_number; |
serialized_packet.transmission_type = retransmission.transmission_type; |
@@ -455,20 +460,6 @@ SerializedPacket QuicPacketCreator::ReserializeAllFrames( |
} |
} |
-SerializedPacket QuicPacketCreator::SerializeAllFrames(const QuicFrames& frames, |
- char* buffer, |
- size_t buffer_len) { |
- QUIC_BUG_IF(!queued_frames_.empty()) << "Frames already queued."; |
- QUIC_BUG_IF(frames.empty()) << "Attempt to serialize empty packet"; |
- for (const QuicFrame& frame : frames) { |
- bool success = AddFrame(frame, false); |
- DCHECK(success); |
- } |
- SerializedPacket packet = SerializePacket(buffer, buffer_len); |
- DCHECK(packet.retransmittable_frames == nullptr); |
- return packet; |
-} |
- |
void QuicPacketCreator::Flush() { |
if (!HasPendingFrames()) { |
return; |