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

Unified Diff: net/quic/quic_packet_generator.cc

Issue 335533002: API changes to Write path Session on down for FEC protection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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_generator.h ('k') | net/quic/quic_packet_generator_test.cc » ('j') | 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 782fa355688e8984146b788d36315e3c2a8c9dc8..175f555f9843d247762bf731e711e62768300f5b 100644
--- a/net/quic/quic_packet_generator.cc
+++ b/net/quic/quic_packet_generator.cc
@@ -93,6 +93,7 @@ QuicConsumedData QuicPacketGenerator::ConsumeData(QuicStreamId id,
const IOVector& data_to_write,
QuicStreamOffset offset,
bool fin,
+ FecProtection fec_protection,
QuicAckNotifier* notifier) {
IsHandshake handshake = id == kCryptoStreamId ? IS_HANDSHAKE : NOT_HANDSHAKE;
SendQueuedFrames(false);
@@ -104,6 +105,10 @@ QuicConsumedData QuicPacketGenerator::ConsumeData(QuicStreamId id,
SerializeAndSendPacket();
}
+ if (fec_protection == MUST_FEC_PROTECT) {
+ MaybeStartFecProtection();
+ }
+
IOVector data = data_to_write;
size_t data_size = data.TotalBufferSize();
while (delegate_->ShouldGeneratePacket(NOT_RETRANSMISSION,
@@ -140,6 +145,11 @@ QuicConsumedData QuicPacketGenerator::ConsumeData(QuicStreamId id,
// We're done writing the data. Exit the loop.
// We don't make this a precondition because we could have 0 bytes of data
// if we're simply writing a fin.
+ if (fec_protection == MUST_FEC_PROTECT) {
+ // Turn off FEC protection when we're done writing protected data.
+ DVLOG(1) << "Turning FEC protection OFF";
+ should_fec_protect_ = false;
+ }
break;
}
}
@@ -206,13 +216,6 @@ void QuicPacketGenerator::MaybeStartFecProtection() {
DCHECK(packet_creator_->IsFecProtected());
}
-void QuicPacketGenerator::MaybeStopFecProtection(bool force) {
- DVLOG(1) << "Turning FEC protection OFF";
- // FEC protection will stop after the next FEC packet is transmitted.
- should_fec_protect_ = false;
- MaybeSendFecPacketAndCloseGroup(force);
-}
-
void QuicPacketGenerator::MaybeSendFecPacketAndCloseGroup(bool force) {
if (!packet_creator_->IsFecProtected() ||
packet_creator_->HasPendingFrames()) {
« no previous file with comments | « net/quic/quic_packet_generator.h ('k') | net/quic/quic_packet_generator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698