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. If multipath enabled, only creates | 6 // it's time to create a packet from them. If multipath enabled, only creates |
7 // packets on one path at the same time. Currently, next packet number is | 7 // packets on one path at the same time. Currently, next packet number is |
8 // tracked per-path. | 8 // tracked per-path. |
9 | 9 |
10 #ifndef NET_QUIC_QUIC_PACKET_CREATOR_H_ | 10 #ifndef NET_QUIC_QUIC_PACKET_CREATOR_H_ |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // creator. | 79 // creator. |
80 void UpdatePacketNumberLength(QuicPacketNumber least_packet_awaited_by_peer, | 80 void UpdatePacketNumberLength(QuicPacketNumber least_packet_awaited_by_peer, |
81 QuicPacketCount max_packets_in_flight); | 81 QuicPacketCount max_packets_in_flight); |
82 | 82 |
83 // The overhead the framing will add for a packet with one frame. | 83 // The overhead the framing will add for a packet with one frame. |
84 static size_t StreamFramePacketOverhead( | 84 static size_t StreamFramePacketOverhead( |
85 QuicConnectionIdLength connection_id_length, | 85 QuicConnectionIdLength connection_id_length, |
86 bool include_version, | 86 bool include_version, |
87 bool include_path_id, | 87 bool include_path_id, |
88 QuicPacketNumberLength packet_number_length, | 88 QuicPacketNumberLength packet_number_length, |
89 QuicStreamOffset offset, | 89 QuicStreamOffset offset); |
90 InFecGroup is_in_fec_group); | |
91 | 90 |
92 // Returns false and flushes all pending frames if current open packet is | 91 // Returns false and flushes all pending frames if current open packet is |
93 // full. | 92 // full. |
94 // If current packet is not full, converts a raw payload into a stream frame | 93 // If current packet is not full, converts a raw payload into a stream frame |
95 // that fits into the open packet and adds it to the packet. | 94 // that fits into the open packet and adds it to the packet. |
96 // The payload begins at |iov_offset| into the |iov|. | 95 // The payload begins at |iov_offset| into the |iov|. |
97 bool ConsumeData(QuicStreamId id, | 96 bool ConsumeData(QuicStreamId id, |
98 QuicIOVector iov, | 97 QuicIOVector iov, |
99 size_t iov_offset, | 98 size_t iov_offset, |
100 QuicStreamOffset offset, | 99 QuicStreamOffset offset, |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 | 300 |
302 // Map mapping path_id to last sent packet number on the path. | 301 // Map mapping path_id to last sent packet number on the path. |
303 std::unordered_map<QuicPathId, QuicPacketNumber> multipath_packet_number_; | 302 std::unordered_map<QuicPathId, QuicPacketNumber> multipath_packet_number_; |
304 | 303 |
305 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); | 304 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); |
306 }; | 305 }; |
307 | 306 |
308 } // namespace net | 307 } // namespace net |
309 | 308 |
310 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ | 309 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ |
OLD | NEW |