| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // that value as a member of SerializedPacket. | 158 // that value as a member of SerializedPacket. |
| 159 SerializedPacket SerializeFec(); | 159 SerializedPacket SerializeFec(); |
| 160 | 160 |
| 161 // Creates a version negotiation packet which supports |supported_versions|. | 161 // Creates a version negotiation packet which supports |supported_versions|. |
| 162 // Caller owns the created packet. Also, sets the entropy hash of the | 162 // Caller owns the created packet. Also, sets the entropy hash of the |
| 163 // serialized packet to a random bool and returns that value as a member of | 163 // serialized packet to a random bool and returns that value as a member of |
| 164 // SerializedPacket. | 164 // SerializedPacket. |
| 165 QuicEncryptedPacket* SerializeVersionNegotiationPacket( | 165 QuicEncryptedPacket* SerializeVersionNegotiationPacket( |
| 166 const QuicVersionVector& supported_versions); | 166 const QuicVersionVector& supported_versions); |
| 167 | 167 |
| 168 // Returns a dummy packet that is valid but contains no useful information. |
| 169 static SerializedPacket NoPacket(); |
| 170 |
| 168 // Sets the encryption level that will be applied to new packets. | 171 // Sets the encryption level that will be applied to new packets. |
| 169 void set_encryption_level(EncryptionLevel level) { | 172 void set_encryption_level(EncryptionLevel level) { |
| 170 encryption_level_ = level; | 173 encryption_level_ = level; |
| 171 } | 174 } |
| 172 | 175 |
| 173 // Sequence number of the last created packet, or 0 if no packets have been | 176 // Sequence number of the last created packet, or 0 if no packets have been |
| 174 // created. | 177 // created. |
| 175 QuicPacketSequenceNumber sequence_number() const { | 178 QuicPacketSequenceNumber sequence_number() const { |
| 176 return sequence_number_; | 179 return sequence_number_; |
| 177 } | 180 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 mutable size_t packet_size_; | 267 mutable size_t packet_size_; |
| 265 QuicFrames queued_frames_; | 268 QuicFrames queued_frames_; |
| 266 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; | 269 scoped_ptr<RetransmittableFrames> queued_retransmittable_frames_; |
| 267 | 270 |
| 268 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); | 271 DISALLOW_COPY_AND_ASSIGN(QuicPacketCreator); |
| 269 }; | 272 }; |
| 270 | 273 |
| 271 } // namespace net | 274 } // namespace net |
| 272 | 275 |
| 273 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ | 276 #endif // NET_QUIC_QUIC_PACKET_CREATOR_H_ |
| OLD | NEW |