| 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. | 7 // FEC packets based on previously created packets. |
| 8 | 8 |
| 9 #ifndef NET_QUIC_QUIC_PACKET_CREATOR_H_ | 9 #ifndef NET_QUIC_QUIC_PACKET_CREATOR_H_ |
| 10 #define NET_QUIC_QUIC_PACKET_CREATOR_H_ | 10 #define NET_QUIC_QUIC_PACKET_CREATOR_H_ |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // Converts a raw payload to a frame which fits into the currently open | 80 // Converts a raw payload to a frame which fits into the currently open |
| 81 // packet if there is one. Returns the number of bytes consumed from data. | 81 // packet if there is one. Returns the number of bytes consumed from data. |
| 82 // If data is empty and fin is true, the expected behavior is to consume the | 82 // If data is empty and fin is true, the expected behavior is to consume the |
| 83 // fin but return 0. | 83 // fin but return 0. |
| 84 size_t CreateStreamFrame(QuicStreamId id, | 84 size_t CreateStreamFrame(QuicStreamId id, |
| 85 const IOVector& data, | 85 const IOVector& data, |
| 86 QuicStreamOffset offset, | 86 QuicStreamOffset offset, |
| 87 bool fin, | 87 bool fin, |
| 88 QuicFrame* frame); | 88 QuicFrame* frame); |
| 89 | 89 |
| 90 // As above, but keeps track of an QuicAckNotifier that should be called when | |
| 91 // the packet that contains this stream frame is ACKed. | |
| 92 // The |notifier| is not owned by the QuicPacketGenerator and must outlive the | |
| 93 // generated packet. | |
| 94 size_t CreateStreamFrameWithNotifier(QuicStreamId id, | |
| 95 const IOVector& data, | |
| 96 QuicStreamOffset offset, | |
| 97 bool fin, | |
| 98 QuicAckNotifier* notifier, | |
| 99 QuicFrame* frame); | |
| 100 | |
| 101 // Serializes all frames into a single packet. All frames must fit into a | 90 // Serializes all frames into a single packet. All frames must fit into a |
| 102 // single packet. Also, sets the entropy hash of the serialized packet to a | 91 // single packet. Also, sets the entropy hash of the serialized packet to a |
| 103 // random bool and returns that value as a member of SerializedPacket. | 92 // random bool and returns that value as a member of SerializedPacket. |
| 104 // Never returns a RetransmittableFrames in SerializedPacket. | 93 // Never returns a RetransmittableFrames in SerializedPacket. |
| 105 SerializedPacket SerializeAllFrames(const QuicFrames& frames); | 94 SerializedPacket SerializeAllFrames(const QuicFrames& frames); |
| 106 | 95 |
| 107 // Re-serializes frames with the original packet's sequence number length. | 96 // Re-serializes frames with the original packet's sequence number length. |
| 108 // Used for retransmitting packets to ensure they aren't too long. | 97 // Used for retransmitting packets to ensure they aren't too long. |
| 109 // Caller must ensure that any open FEC group is closed before calling this | 98 // Caller must ensure that any open FEC group is closed before calling this |
| 110 // method. | 99 // method. |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 mutable size_t packet_size_; | 280 mutable size_t packet_size_; |
| 292 QuicFrames queued_frames_; | 281 QuicFrames queued_frames_; |
| 293 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; | 282 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; |
| 294 | 283 |
| 295 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); | 284 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); |
| 296 }; | 285 }; |
| 297 | 286 |
| 298 } // namespace net | 287 } // namespace net |
| 299 | 288 |
| 300 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ | 289 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ |
| OLD | NEW |