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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 QuicStreamOffset offset, | 122 QuicStreamOffset offset, |
123 bool fin, | 123 bool fin, |
124 bool needs_padding, | 124 bool needs_padding, |
125 QuicFrame* frame, | 125 QuicFrame* frame, |
126 FecProtection fec_protection); | 126 FecProtection fec_protection); |
127 | 127 |
128 // Returns true if current open packet can accommodate more stream frames of | 128 // Returns true if current open packet can accommodate more stream frames of |
129 // stream |id| at |offset|, false otherwise. | 129 // stream |id| at |offset|, false otherwise. |
130 bool HasRoomForStreamFrame(QuicStreamId id, QuicStreamOffset offset) const; | 130 bool HasRoomForStreamFrame(QuicStreamId id, QuicStreamOffset offset) const; |
131 | 131 |
132 // Serializes all frames into a single packet. All frames must fit into a | |
133 // single packet. Also, sets the entropy hash of the serialized packet to a | |
134 // random bool and returns that value as a member of SerializedPacket. | |
135 // Never returns a RetransmittableFrames in SerializedPacket. | |
136 SerializedPacket SerializeAllFrames(const QuicFrames& frames, | |
137 char* buffer, | |
138 size_t buffer_len); | |
139 | |
140 // Re-serializes frames with the original packet's packet number length. | 132 // Re-serializes frames with the original packet's packet number length. |
141 // Used for retransmitting packets to ensure they aren't too long. | 133 // Used for retransmitting packets to ensure they aren't too long. |
142 // Caller must ensure that any open FEC group is closed before calling this | 134 // Caller must ensure that any open FEC group is closed before calling this |
143 // method. | 135 // method. |
144 SerializedPacket ReserializeAllFrames( | 136 SerializedPacket ReserializeAllFrames( |
145 const PendingRetransmission& retransmission, | 137 const PendingRetransmission& retransmission, |
146 char* buffer, | 138 char* buffer, |
147 size_t buffer_len); | 139 size_t buffer_len); |
148 | 140 |
149 // Serializes all added frames into a single packet and invokes the delegate_ | 141 // Serializes all added frames into a single packet and invokes the delegate_ |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 // The multiplication factor for FEC timeout based on RTT. | 428 // The multiplication factor for FEC timeout based on RTT. |
437 // TODO(rtenneti): Delete this code after the 0.25 RTT FEC experiment. | 429 // TODO(rtenneti): Delete this code after the 0.25 RTT FEC experiment. |
438 float rtt_multiplier_for_fec_timeout_; | 430 float rtt_multiplier_for_fec_timeout_; |
439 | 431 |
440 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); | 432 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); |
441 }; | 433 }; |
442 | 434 |
443 } // namespace net | 435 } // namespace net |
444 | 436 |
445 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ | 437 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ |
OLD | NEW |