Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Unified Diff: net/quic/quic_packet_creator.cc

Issue 1658373002: Move QuicPacketCreator::SerializeAllFrames into QuicPacketCreatorPeer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0202
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_packet_creator.h ('k') | net/quic/quic_packet_creator_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « net/quic/quic_packet_creator.h ('k') | net/quic/quic_packet_creator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698