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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 214 |
215 Options* options() { | 215 Options* options() { |
216 return &options_; | 216 return &options_; |
217 } | 217 } |
218 | 218 |
219 private: | 219 private: |
220 friend class test::QuicPacketCreatorPeer; | 220 friend class test::QuicPacketCreatorPeer; |
221 | 221 |
222 static bool ShouldRetransmit(const QuicFrame& frame); | 222 static bool ShouldRetransmit(const QuicFrame& frame); |
223 | 223 |
224 // Starts a new FEC group with the next serialized packet, if FEC is enabled | 224 // Updates sequence number length on a packet or FEC group boundary. |
225 // and there is not already an FEC group open. | 225 // Also starts an FEC group if FEC protection is on and there is not already |
226 InFecGroup MaybeStartFec(); | 226 // an FEC group open. |
| 227 InFecGroup MaybeUpdateLengthsAndStartFec(); |
227 | 228 |
228 void FillPacketHeader(QuicFecGroupNumber fec_group, | 229 void FillPacketHeader(QuicFecGroupNumber fec_group, |
229 bool fec_flag, | 230 bool fec_flag, |
230 QuicPacketHeader* header); | 231 QuicPacketHeader* header); |
231 | 232 |
232 // Allows a frame to be added without creating retransmittable frames. | 233 // Allows a frame to be added without creating retransmittable frames. |
233 // Particularly useful for retransmits using SerializeAllFrames(). | 234 // Particularly useful for retransmits using SerializeAllFrames(). |
234 bool AddFrame(const QuicFrame& frame, bool save_retransmittable_frames); | 235 bool AddFrame(const QuicFrame& frame, bool save_retransmittable_frames); |
235 | 236 |
236 // Adds a padding frame to the current packet only if the current packet | 237 // Adds a padding frame to the current packet only if the current packet |
(...skipping 25 matching lines...) Expand all Loading... |
262 mutable size_t packet_size_; | 263 mutable size_t packet_size_; |
263 QuicFrames queued_frames_; | 264 QuicFrames queued_frames_; |
264 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; | 265 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; |
265 | 266 |
266 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); | 267 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); |
267 }; | 268 }; |
268 | 269 |
269 } // namespace net | 270 } // namespace net |
270 | 271 |
271 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ | 272 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ |
OLD | NEW |