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

Unified Diff: net/quic/quic_packet_creator.cc

Issue 1495263002: QuicPacketCreator knows when to start FEC protection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@108738647
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') | 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 312a738dd311c8e8d32e53c925af6fab8290cf6c..5d40e23dda0ae5d635c9fc25efa97873e22ace87 100644
--- a/net/quic/quic_packet_creator.cc
+++ b/net/quic/quic_packet_creator.cc
@@ -91,7 +91,7 @@ QuicPacketCreator::QuicPacketCreator(QuicConnectionId connection_id,
framer_(framer),
random_bool_source_(new QuicRandomBoolSource(random_generator)),
packet_number_(0),
- should_fec_protect_(false),
+ should_fec_protect_next_packet_(false),
fec_protect_(false),
send_version_in_packet_(framer->perspective() == Perspective::IS_CLIENT),
max_packet_length_(0),
@@ -251,15 +251,19 @@ bool QuicPacketCreator::ConsumeData(QuicStreamId id,
QuicStreamOffset offset,
bool fin,
bool needs_padding,
- QuicFrame* frame) {
+ QuicFrame* frame,
+ FecProtection fec_protection) {
if (!HasRoomForStreamFrame(id, offset)) {
Flush();
return false;
}
UniqueStreamBuffer buffer;
+ if (fec_protection == MUST_FEC_PROTECT) {
+ should_fec_protect_next_packet_ = true;
+ MaybeStartFecProtection();
+ }
CreateStreamFrame(id, iov, iov_offset, offset, fin, frame);
-
bool success = AddFrame(*frame,
/*save_retransmittable_frames=*/true, needs_padding,
std::move(buffer));
@@ -762,7 +766,7 @@ void QuicPacketCreator::MaybeSendFecPacketAndCloseGroup(bool force_send_fec,
}
}
- if (!should_fec_protect_ && fec_protect_ && !IsFecGroupOpen()) {
+ if (!should_fec_protect_next_packet_ && fec_protect_ && !IsFecGroupOpen()) {
StopFecProtectingPackets();
}
}
« 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