| 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. If multipath enabled, only | 7 // FEC packets based on previously created packets. If multipath enabled, only |
| 8 // creates packets on one path at the same time. Currently, next packet number | 8 // creates packets on one path at the same time. Currently, next packet number |
| 9 // is tracked per-path. | 9 // is tracked per-path. |
| 10 | 10 |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 | 304 |
| 305 // Called when a data packet is constructed that is part of an FEC group. | 305 // Called when a data packet is constructed that is part of an FEC group. |
| 306 // |payload| is the non-encrypted FEC protected payload of the packet. | 306 // |payload| is the non-encrypted FEC protected payload of the packet. |
| 307 void OnBuiltFecProtectedPayload(const QuicPacketHeader& header, | 307 void OnBuiltFecProtectedPayload(const QuicPacketHeader& header, |
| 308 base::StringPiece payload); | 308 base::StringPiece payload); |
| 309 | 309 |
| 310 void FillPacketHeader(QuicFecGroupNumber fec_group, | 310 void FillPacketHeader(QuicFecGroupNumber fec_group, |
| 311 bool fec_flag, | 311 bool fec_flag, |
| 312 QuicPacketHeader* header); | 312 QuicPacketHeader* header); |
| 313 | 313 |
| 314 // Allows a frame to be added without creating retransmittable frames. | 314 // Adds a |frame| if there is space and returns false and flushes all pending |
| 315 // Particularly useful for retransmits using SerializeAllFrames(). | 315 // frames if there isn't room. If |save_retransmittable_frames| is true, |
| 316 // If current open packet cannot accommodate |frame|, returns false and | 316 // saves the |frame| in the next SerializedPacket. |
| 317 // flushes all pending frames. | 317 bool AddFrame(const QuicFrame& frame, bool save_retransmittable_frames); |
| 318 bool AddFrame(const QuicFrame& frame, | |
| 319 bool save_retransmittable_frames, | |
| 320 bool needs_padding); | |
| 321 | 318 |
| 322 // Adds a padding frame to the current packet only if the current packet | 319 // Adds a padding frame to the current packet only if the current packet |
| 323 // contains a handshake message, and there is sufficient room to fit a | 320 // contains a handshake message, and there is sufficient room to fit a |
| 324 // padding frame. | 321 // padding frame. |
| 325 void MaybeAddPadding(); | 322 void MaybeAddPadding(); |
| 326 | 323 |
| 327 // Serializes all frames which have been added and adds any which should be | 324 // Serializes all frames which have been added and adds any which should be |
| 328 // retransmitted to queued_retransmittable_frames_ if it's not nullptr. All | 325 // retransmitted to queued_retransmittable_frames_ if it's not nullptr. All |
| 329 // frames must fit into a single packet. Sets the entropy hash of the | 326 // frames must fit into a single packet. Sets the entropy hash of the |
| 330 // serialized packet to a random bool and returns that value as a member of | 327 // serialized packet to a random bool and returns that value as a member of |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 // The multiplication factor for FEC timeout based on RTT. | 417 // The multiplication factor for FEC timeout based on RTT. |
| 421 // TODO(rtenneti): Delete this code after the 0.25 RTT FEC experiment. | 418 // TODO(rtenneti): Delete this code after the 0.25 RTT FEC experiment. |
| 422 float rtt_multiplier_for_fec_timeout_; | 419 float rtt_multiplier_for_fec_timeout_; |
| 423 | 420 |
| 424 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); | 421 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); |
| 425 }; | 422 }; |
| 426 | 423 |
| 427 } // namespace net | 424 } // namespace net |
| 428 | 425 |
| 429 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ | 426 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ |
| OLD | NEW |