| OLD | NEW |
| 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 // Accumulates frames for the next packet until more frames no longer fit or | 5 // Accumulates frames for the next packet until more frames no longer fit or |
| 6 // it's time to create a packet from them. Also provides packet creation of | 6 // it's time to create a packet from them. Also provides packet creation of |
| 7 // FEC packets based on previously created packets. | 7 // FEC packets based on previously created packets. |
| 8 | 8 |
| 9 #ifndef NET_QUIC_QUIC_PACKET_CREATOR_H_ | 9 #ifndef NET_QUIC_QUIC_PACKET_CREATOR_H_ |
| 10 #define NET_QUIC_QUIC_PACKET_CREATOR_H_ | 10 #define NET_QUIC_QUIC_PACKET_CREATOR_H_ |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 DCHECK(fec_group_.get() == NULL && queued_frames_.empty()); | 218 DCHECK(fec_group_.get() == NULL && queued_frames_.empty()); |
| 219 max_packet_length_ = length; | 219 max_packet_length_ = length; |
| 220 } | 220 } |
| 221 | 221 |
| 222 // Returns current max number of packets covered by an FEC group. | 222 // Returns current max number of packets covered by an FEC group. |
| 223 size_t max_packets_per_fec_group() const { | 223 size_t max_packets_per_fec_group() const { |
| 224 return max_packets_per_fec_group_; | 224 return max_packets_per_fec_group_; |
| 225 } | 225 } |
| 226 | 226 |
| 227 // Sets creator's max number of packets covered by an FEC group. | 227 // Sets creator's max number of packets covered by an FEC group. |
| 228 void set_max_packets_per_fec_group(size_t max_packets_per_fec_group) { | 228 // Note: While there are no constraints on |max_packets_per_fec_group|, |
| 229 // To turn off FEC protection, use StopFecProtectingPackets(). | 229 // this setter enforces a min value of kLowestMaxPacketsPerFecGroup. |
| 230 DCHECK_NE(0u, max_packets_per_fec_group); | 230 // To turn off FEC protection, use StopFecProtectingPackets(). |
| 231 max_packets_per_fec_group_ = max_packets_per_fec_group; | 231 void set_max_packets_per_fec_group(size_t max_packets_per_fec_group); |
| 232 } | |
| 233 | 232 |
| 234 private: | 233 private: |
| 235 friend class test::QuicPacketCreatorPeer; | 234 friend class test::QuicPacketCreatorPeer; |
| 236 | 235 |
| 237 static bool ShouldRetransmit(const QuicFrame& frame); | 236 static bool ShouldRetransmit(const QuicFrame& frame); |
| 238 | 237 |
| 239 // Updates sequence number and max packet lengths on a packet or FEC group | 238 // Updates sequence number and max packet lengths on a packet or FEC group |
| 240 // boundary. | 239 // boundary. |
| 241 void MaybeUpdateLengths(); | 240 void MaybeUpdateLengths(); |
| 242 | 241 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 mutable size_t packet_size_; | 288 mutable size_t packet_size_; |
| 290 QuicFrames queued_frames_; | 289 QuicFrames queued_frames_; |
| 291 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; | 290 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; |
| 292 | 291 |
| 293 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); | 292 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); |
| 294 }; | 293 }; |
| 295 | 294 |
| 296 } // namespace net | 295 } // namespace net |
| 297 | 296 |
| 298 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ | 297 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ |
| OLD | NEW |