| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // return true if an fec group is open. | 62 // return true if an fec group is open. |
| 63 bool ShouldSendFec(bool force_close) const; | 63 bool ShouldSendFec(bool force_close) const; |
| 64 | 64 |
| 65 // Starts a new FEC group with the next serialized packet, if FEC is enabled | 65 // Starts a new FEC group with the next serialized packet, if FEC is enabled |
| 66 // and there is not already an FEC group open. | 66 // and there is not already an FEC group open. |
| 67 void MaybeStartFEC(); | 67 void MaybeStartFEC(); |
| 68 | 68 |
| 69 // Makes the framer not serialize the protocol version in sent packets. | 69 // Makes the framer not serialize the protocol version in sent packets. |
| 70 void StopSendingVersion(); | 70 void StopSendingVersion(); |
| 71 | 71 |
| 72 // The overhead the framing will add for a packet with num_frames frames. | 72 // The overhead the framing will add for a packet with one frame. |
| 73 static size_t StreamFramePacketOverhead( | 73 static size_t StreamFramePacketOverhead( |
| 74 int num_frames, | |
| 75 QuicGuidLength guid_length, | 74 QuicGuidLength guid_length, |
| 76 bool include_version, | 75 bool include_version, |
| 77 QuicSequenceNumberLength sequence_number_length, | 76 QuicSequenceNumberLength sequence_number_length, |
| 78 InFecGroup is_in_fec_group); | 77 InFecGroup is_in_fec_group); |
| 79 | 78 |
| 80 bool HasRoomForStreamFrame() const; | 79 bool HasRoomForStreamFrame() const; |
| 81 | 80 |
| 82 // Converts a raw payload to a frame which fits into the currently open | 81 // Converts a raw payload to a frame which fits into the currently open |
| 83 // packet if there is one. Returns the number of bytes consumed from data. | 82 // packet if there is one. Returns the number of bytes consumed from data. |
| 84 // If data is empty and fin is true, the expected behavior is to consume the | 83 // If data is empty and fin is true, the expected behavior is to consume the |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 size_t packet_size_; | 172 size_t packet_size_; |
| 174 QuicFrames queued_frames_; | 173 QuicFrames queued_frames_; |
| 175 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; | 174 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; |
| 176 | 175 |
| 177 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); | 176 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); |
| 178 }; | 177 }; |
| 179 | 178 |
| 180 } // namespace net | 179 } // namespace net |
| 181 | 180 |
| 182 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ | 181 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ |
| OLD | NEW |