| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 friend class test::QuicPacketCreatorPeer; | 179 friend class test::QuicPacketCreatorPeer; |
| 180 | 180 |
| 181 static bool ShouldRetransmit(const QuicFrame& frame); | 181 static bool ShouldRetransmit(const QuicFrame& frame); |
| 182 | 182 |
| 183 // Starts a new FEC group with the next serialized packet, if FEC is enabled | 183 // Starts a new FEC group with the next serialized packet, if FEC is enabled |
| 184 // and there is not already an FEC group open. | 184 // and there is not already an FEC group open. |
| 185 void MaybeStartFEC(); | 185 void MaybeStartFEC(); |
| 186 | 186 |
| 187 void FillPacketHeader(QuicFecGroupNumber fec_group, | 187 void FillPacketHeader(QuicFecGroupNumber fec_group, |
| 188 bool fec_flag, | 188 bool fec_flag, |
| 189 bool fec_entropy_flag, | |
| 190 QuicPacketHeader* header); | 189 QuicPacketHeader* header); |
| 191 | 190 |
| 192 // Allows a frame to be added without creating retransmittable frames. | 191 // Allows a frame to be added without creating retransmittable frames. |
| 193 // Particularly useful for retransmits using SerializeAllFrames(). | 192 // Particularly useful for retransmits using SerializeAllFrames(). |
| 194 bool AddFrame(const QuicFrame& frame, bool save_retransmittable_frames); | 193 bool AddFrame(const QuicFrame& frame, bool save_retransmittable_frames); |
| 195 | 194 |
| 196 // Adds a padding frame to the current packet only if the current packet | 195 // Adds a padding frame to the current packet only if the current packet |
| 197 // contains a handshake message, and there is sufficient room to fit a | 196 // contains a handshake message, and there is sufficient room to fit a |
| 198 // padding frame. | 197 // padding frame. |
| 199 void MaybeAddPadding(); | 198 void MaybeAddPadding(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 219 mutable size_t packet_size_; | 218 mutable size_t packet_size_; |
| 220 QuicFrames queued_frames_; | 219 QuicFrames queued_frames_; |
| 221 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; | 220 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; |
| 222 | 221 |
| 223 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); | 222 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); |
| 224 }; | 223 }; |
| 225 | 224 |
| 226 } // namespace net | 225 } // namespace net |
| 227 | 226 |
| 228 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ | 227 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ |
| OLD | NEW |