| 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( | 228 void set_max_packets_per_fec_group(size_t max_packets_per_fec_group) { |
| 229 size_t max_packets_per_fec_group) { | |
| 230 // To turn off FEC protection, use StopFecProtectingPackets(). | 229 // To turn off FEC protection, use StopFecProtectingPackets(). |
| 231 DCHECK_NE(0u, max_packets_per_fec_group); | 230 DCHECK_NE(0u, max_packets_per_fec_group); |
| 232 max_packets_per_fec_group_ = max_packets_per_fec_group; | 231 max_packets_per_fec_group_ = max_packets_per_fec_group; |
| 233 } | 232 } |
| 234 | 233 |
| 235 private: | 234 private: |
| 236 friend class test::QuicPacketCreatorPeer; | 235 friend class test::QuicPacketCreatorPeer; |
| 237 | 236 |
| 238 static bool ShouldRetransmit(const QuicFrame& frame); | 237 static bool ShouldRetransmit(const QuicFrame& frame); |
| 239 | 238 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 mutable size_t packet_size_; | 289 mutable size_t packet_size_; |
| 291 QuicFrames queued_frames_; | 290 QuicFrames queued_frames_; |
| 292 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; | 291 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; |
| 293 | 292 |
| 294 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); | 293 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); |
| 295 }; | 294 }; |
| 296 | 295 |
| 297 } // namespace net | 296 } // namespace net |
| 298 | 297 |
| 299 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ | 298 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ |
| OLD | NEW |