| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 QuicFrame* frame); | 262 QuicFrame* frame); |
| 263 | 263 |
| 264 // Copies |length| bytes from iov starting at offset |iov_offset| into buffer. | 264 // Copies |length| bytes from iov starting at offset |iov_offset| into buffer. |
| 265 // |iov| must be at least iov_offset+length total length and buffer must be | 265 // |iov| must be at least iov_offset+length total length and buffer must be |
| 266 // at least |length| long. | 266 // at least |length| long. |
| 267 static void CopyToBuffer(QuicIOVector iov, | 267 static void CopyToBuffer(QuicIOVector iov, |
| 268 size_t iov_offset, | 268 size_t iov_offset, |
| 269 size_t length, | 269 size_t length, |
| 270 char* buffer); | 270 char* buffer); |
| 271 | 271 |
| 272 // Updates packet number length on packet boundary. | |
| 273 void MaybeUpdatePacketNumberLength(); | |
| 274 | |
| 275 void FillPacketHeader(QuicPacketHeader* header); | 272 void FillPacketHeader(QuicPacketHeader* header); |
| 276 | 273 |
| 277 // Adds a |frame| if there is space and returns false and flushes all pending | 274 // Adds a |frame| if there is space and returns false and flushes all pending |
| 278 // frames if there isn't room. If |save_retransmittable_frames| is true, | 275 // frames if there isn't room. If |save_retransmittable_frames| is true, |
| 279 // saves the |frame| in the next SerializedPacket. | 276 // saves the |frame| in the next SerializedPacket. |
| 280 bool AddFrame(const QuicFrame& frame, bool save_retransmittable_frames); | 277 bool AddFrame(const QuicFrame& frame, bool save_retransmittable_frames); |
| 281 | 278 |
| 282 // Adds a padding frame to the current packet only if the current packet | 279 // Adds a padding frame to the current packet only if the current packet |
| 283 // contains a handshake message, and there is sufficient room to fit a | 280 // contains a handshake message, and there is sufficient room to fit a |
| 284 // padding frame. | 281 // padding frame. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 | 340 |
| 344 // Map mapping path_id to last sent packet number on the path. | 341 // Map mapping path_id to last sent packet number on the path. |
| 345 std::unordered_map<QuicPathId, QuicPacketNumber> multipath_packet_number_; | 342 std::unordered_map<QuicPathId, QuicPacketNumber> multipath_packet_number_; |
| 346 | 343 |
| 347 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); | 344 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); |
| 348 }; | 345 }; |
| 349 | 346 |
| 350 } // namespace net | 347 } // namespace net |
| 351 | 348 |
| 352 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ | 349 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ |
| OLD | NEW |