| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 // Returns the currently open FEC group's number. If there isn't an open FEC | 208 // Returns the currently open FEC group's number. If there isn't an open FEC |
| 209 // group, returns the last closed FEC group number. Returns 0 when FEC is | 209 // group, returns the last closed FEC group number. Returns 0 when FEC is |
| 210 // disabled or no FEC group has been created yet. | 210 // disabled or no FEC group has been created yet. |
| 211 QuicFecGroupNumber fec_group_number() { return fec_group_number_; } | 211 QuicFecGroupNumber fec_group_number() { return fec_group_number_; } |
| 212 | 212 |
| 213 private: | 213 private: |
| 214 friend class test::QuicPacketCreatorPeer; | 214 friend class test::QuicPacketCreatorPeer; |
| 215 | 215 |
| 216 static bool ShouldRetransmit(const QuicFrame& frame); | 216 static bool ShouldRetransmit(const QuicFrame& frame); |
| 217 | 217 |
| 218 // Updates sequence number and max packet lengths on a packet or FEC group | |
| 219 // boundary. | |
| 220 void MaybeUpdateLengths(); | |
| 221 | |
| 222 // Updates lengths and also starts an FEC group if FEC protection is on and | 218 // Updates lengths and also starts an FEC group if FEC protection is on and |
| 223 // there is not already an FEC group open. | 219 // there is not already an FEC group open. |
| 224 InFecGroup MaybeUpdateLengthsAndStartFec(); | 220 InFecGroup MaybeUpdateLengthsAndStartFec(); |
| 225 | 221 |
| 226 void FillPacketHeader(QuicFecGroupNumber fec_group, | 222 void FillPacketHeader(QuicFecGroupNumber fec_group, |
| 227 bool fec_flag, | 223 bool fec_flag, |
| 228 QuicPacketHeader* header); | 224 QuicPacketHeader* header); |
| 229 | 225 |
| 230 // Allows a frame to be added without creating retransmittable frames. | 226 // Allows a frame to be added without creating retransmittable frames. |
| 231 // Particularly useful for retransmits using SerializeAllFrames(). | 227 // Particularly useful for retransmits using SerializeAllFrames(). |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 mutable size_t packet_size_; | 264 mutable size_t packet_size_; |
| 269 QuicFrames queued_frames_; | 265 QuicFrames queued_frames_; |
| 270 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; | 266 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; |
| 271 | 267 |
| 272 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); | 268 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); |
| 273 }; | 269 }; |
| 274 | 270 |
| 275 } // namespace net | 271 } // namespace net |
| 276 | 272 |
| 277 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ | 273 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ |
| OLD | NEW |