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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // Returns false and flushes all pending frames if current open packet is | 96 // Returns false and flushes all pending frames if current open packet is |
97 // full. | 97 // full. |
98 // If current packet is not full, converts a raw payload into a stream frame | 98 // If current packet is not full, converts a raw payload into a stream frame |
99 // that fits into the open packet and adds it to the packet. | 99 // that fits into the open packet and adds it to the packet. |
100 // The payload begins at |iov_offset| into the |iov|. | 100 // The payload begins at |iov_offset| into the |iov|. |
101 bool ConsumeData(QuicStreamId id, | 101 bool ConsumeData(QuicStreamId id, |
102 QuicIOVector iov, | 102 QuicIOVector iov, |
103 size_t iov_offset, | 103 size_t iov_offset, |
104 QuicStreamOffset offset, | 104 QuicStreamOffset offset, |
105 bool fin, | 105 bool fin, |
106 bool needs_padding, | 106 bool needs_full_padding, |
107 QuicFrame* frame); | 107 QuicFrame* frame); |
108 | 108 |
109 // Returns true if current open packet can accommodate more stream frames of | 109 // Returns true if current open packet can accommodate more stream frames of |
110 // stream |id| at |offset|, false otherwise. | 110 // stream |id| at |offset|, false otherwise. |
111 bool HasRoomForStreamFrame(QuicStreamId id, QuicStreamOffset offset); | 111 bool HasRoomForStreamFrame(QuicStreamId id, QuicStreamOffset offset); |
112 | 112 |
113 // Re-serializes frames with the original packet's packet number length. | 113 // Re-serializes frames with the original packet's packet number length. |
114 // Used for retransmitting packets to ensure they aren't too long. | 114 // Used for retransmitting packets to ensure they aren't too long. |
115 void ReserializeAllFrames(const PendingRetransmission& retransmission, | 115 void ReserializeAllFrames(const PendingRetransmission& retransmission, |
116 char* buffer, | 116 char* buffer, |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 | 312 |
313 // Map mapping path_id to last sent packet number on the path. | 313 // Map mapping path_id to last sent packet number on the path. |
314 std::unordered_map<QuicPathId, QuicPacketNumber> multipath_packet_number_; | 314 std::unordered_map<QuicPathId, QuicPacketNumber> multipath_packet_number_; |
315 | 315 |
316 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); | 316 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); |
317 }; | 317 }; |
318 | 318 |
319 } // namespace net | 319 } // namespace net |
320 | 320 |
321 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ | 321 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ |
OLD | NEW |