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

Side by Side Diff: net/quic/quic_packet_generator.cc

Issue 1531603002: Set QuicPacketCreator's should_fec_protect_next_packet only within QuicPacketCreator. No functiona… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@110173060
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 unified diff | Download patch
« no previous file with comments | « net/quic/quic_packet_creator_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_packet_generator.h" 5 #include "net/quic/quic_packet_generator.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "net/quic/quic_fec_group.h" 9 #include "net/quic/quic_fec_group.h"
10 #include "net/quic/quic_flags.h" 10 #include "net/quic/quic_flags.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // TODO(rtenneti): remove MaybeSendFecPacketAndCloseGroup() from inside 144 // TODO(rtenneti): remove MaybeSendFecPacketAndCloseGroup() from inside
145 // SerializeAndSendPacket() and make it an explicit call here (and 145 // SerializeAndSendPacket() and make it an explicit call here (and
146 // elsewhere where we call SerializeAndSendPacket?). 146 // elsewhere where we call SerializeAndSendPacket?).
147 packet_creator_.Flush(); 147 packet_creator_.Flush();
148 } 148 }
149 149
150 if (total_bytes_consumed == iov.total_length) { 150 if (total_bytes_consumed == iov.total_length) {
151 // We're done writing the data. Exit the loop. 151 // We're done writing the data. Exit the loop.
152 // We don't make this a precondition because we could have 0 bytes of data 152 // We don't make this a precondition because we could have 0 bytes of data
153 // if we're simply writing a fin. 153 // if we're simply writing a fin.
154 if (fec_protection == MUST_FEC_PROTECT) {
155 // Turn off FEC protection when we're done writing protected data.
156 DVLOG(1) << "Turning FEC protection OFF";
157 packet_creator_.set_should_fec_protect_next_packet(false);
158 }
159 break; 154 break;
160 } 155 }
161 } 156 }
162 157
163 // Don't allow the handshake to be bundled with other retransmittable frames. 158 // Don't allow the handshake to be bundled with other retransmittable frames.
164 if (has_handshake) { 159 if (has_handshake) {
165 SendQueuedFrames(/*flush=*/true, /*is_fec_timeout=*/false); 160 SendQueuedFrames(/*flush=*/true, /*is_fec_timeout=*/false);
166 } 161 }
167 162
168 // Try to close FEC group since we've either run out of data to send or we're 163 // Try to close FEC group since we've either run out of data to send or we're
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 385
391 FecSendPolicy QuicPacketGenerator::fec_send_policy() { 386 FecSendPolicy QuicPacketGenerator::fec_send_policy() {
392 return packet_creator_.fec_send_policy(); 387 return packet_creator_.fec_send_policy();
393 } 388 }
394 389
395 void QuicPacketGenerator::set_fec_send_policy(FecSendPolicy fec_send_policy) { 390 void QuicPacketGenerator::set_fec_send_policy(FecSendPolicy fec_send_policy) {
396 packet_creator_.set_fec_send_policy(fec_send_policy); 391 packet_creator_.set_fec_send_policy(fec_send_policy);
397 } 392 }
398 393
399 } // namespace net 394 } // namespace net
OLDNEW
« 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