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

Unified Diff: net/quic/quic_packet_generator.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_test.cc ('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_generator.cc
diff --git a/net/quic/quic_packet_generator.cc b/net/quic/quic_packet_generator.cc
index d58259ad427cf1ba389150260e953d7de31ae971..275dbe06f37c3af256cfed08e8818c3183a73fdf 100644
--- a/net/quic/quic_packet_generator.cc
+++ b/net/quic/quic_packet_generator.cc
@@ -118,11 +118,6 @@ QuicConsumedData QuicPacketGenerator::ConsumeData(
packet_creator_.Flush();
}
- if (fec_protection == MUST_FEC_PROTECT) {
- packet_creator_.set_should_fec_protect(true);
- packet_creator_.MaybeStartFecProtection();
- }
-
if (!fin && (iov.total_length == 0)) {
LOG(DFATAL) << "Attempt to consume empty data without FIN.";
return QuicConsumedData(0, false);
@@ -133,7 +128,7 @@ QuicConsumedData QuicPacketGenerator::ConsumeData(
QuicFrame frame;
if (!packet_creator_.ConsumeData(id, iov, total_bytes_consumed,
offset + total_bytes_consumed, fin,
- has_handshake, &frame)) {
+ has_handshake, &frame, fec_protection)) {
// Current packet is full and flushed.
continue;
}
@@ -167,7 +162,7 @@ QuicConsumedData QuicPacketGenerator::ConsumeData(
if (fec_protection == MUST_FEC_PROTECT) {
// Turn off FEC protection when we're done writing protected data.
DVLOG(1) << "Turning FEC protection OFF";
- packet_creator_.set_should_fec_protect(false);
+ packet_creator_.set_should_fec_protect_next_packet(false);
}
break;
}
@@ -408,7 +403,7 @@ void QuicPacketGenerator::OnSerializedPacket(
if (serialized_packet->packet == nullptr) {
LOG(DFATAL) << "Failed to SerializePacket. fec_policy:" << fec_send_policy()
<< " should_fec_protect_:"
- << packet_creator_.should_fec_protect();
+ << packet_creator_.should_fec_protect_next_packet();
delegate_->CloseConnection(QUIC_FAILED_TO_SERIALIZE_PACKET, false);
return;
}
« no previous file with comments | « net/quic/quic_packet_creator_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698