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

Unified Diff: net/quic/quic_packet_creator.cc

Issue 1529843002: Remove needs_padding from QuicPacketCreator AddFrame. Non functional change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@109634576
Patch Set: Created 5 years 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') | no next file » | 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 c89058dcff862b60f17b427d490094c1c5f19912..6fcc69a9dc3ace0a9bf0f3bbe342e416b46106ae 100644
--- a/net/quic/quic_packet_creator.cc
+++ b/net/quic/quic_packet_creator.cc
@@ -266,8 +266,10 @@ bool QuicPacketCreator::ConsumeData(QuicStreamId id,
MaybeStartFecProtection();
}
CreateStreamFrame(id, iov, iov_offset, offset, fin, frame);
- bool success = AddFrame(*frame,
- /*save_retransmittable_frames=*/true, needs_padding);
+ bool success = AddFrame(*frame, /*save_retransmittable_frames=*/true);
+ if (needs_padding) {
+ needs_padding_ = true;
+ }
DCHECK(success);
return true;
}
@@ -433,7 +435,7 @@ SerializedPacket QuicPacketCreator::SerializeAllFrames(const QuicFrames& frames,
LOG_IF(DFATAL, frames.empty())
<< "Attempt to serialize empty packet";
for (const QuicFrame& frame : frames) {
- bool success = AddFrame(frame, false, false);
+ bool success = AddFrame(frame, false);
DCHECK(success);
}
SerializedPacket packet = SerializePacket(buffer, buffer_len);
@@ -496,15 +498,15 @@ size_t QuicPacketCreator::PacketSize() const {
}
bool QuicPacketCreator::AddSavedFrame(const QuicFrame& frame) {
- return AddFrame(frame,
- /*save_retransmittable_frames=*/true,
- /*needs_padding=*/false);
+ return AddFrame(frame, /*save_retransmittable_frames=*/true);
}
bool QuicPacketCreator::AddPaddedSavedFrame(const QuicFrame& frame) {
- return AddFrame(frame,
- /*save_retransmittable_frames=*/true,
- /*needs_padding=*/true);
+ if (AddFrame(frame, /*save_retransmittable_frames=*/true)) {
+ needs_padding_ = true;
+ return true;
+ }
+ return false;
}
SerializedPacket QuicPacketCreator::SerializePacket(
@@ -672,8 +674,7 @@ bool QuicPacketCreator::ShouldRetransmit(const QuicFrame& frame) {
}
bool QuicPacketCreator::AddFrame(const QuicFrame& frame,
- bool save_retransmittable_frames,
- bool needs_padding) {
+ bool save_retransmittable_frames) {
DVLOG(1) << "Adding frame: " << frame;
InFecGroup is_in_fec_group = MaybeUpdateLengthsAndStartFec();
@@ -703,9 +704,6 @@ bool QuicPacketCreator::AddFrame(const QuicFrame& frame,
if (frame.type == STOP_WAITING_FRAME) {
has_stop_waiting_ = true;
}
- if (needs_padding) {
- needs_padding_ = true;
- }
if (debug_delegate_ != nullptr) {
debug_delegate_->OnFrameAddedToPacket(frame);
}
@@ -723,7 +721,7 @@ void QuicPacketCreator::MaybeAddPadding() {
return;
}
- bool success = AddFrame(QuicFrame(QuicPaddingFrame()), false, false);
+ bool success = AddFrame(QuicFrame(QuicPaddingFrame()), false);
DCHECK(success);
}
« no previous file with comments | « net/quic/quic_packet_creator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698