| 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 // Responsible for generating packets on behalf of a QuicConnection. | 5 // Responsible for generating packets on behalf of a QuicConnection. |
| 6 // Packets are serialized just-in-time. Control frames are queued. | 6 // Packets are serialized just-in-time. Control frames are queued. |
| 7 // Ack and Feedback frames will be requested from the Connection | 7 // Ack and Feedback frames will be requested from the Connection |
| 8 // just-in-time. When a packet needs to be sent, the Generator | 8 // just-in-time. When a packet needs to be sent, the Generator |
| 9 // will serialize a packet and pass it to QuicConnection::SendOrQueuePacket() | 9 // will serialize a packet and pass it to QuicConnection::SendOrQueuePacket() |
| 10 // | 10 // |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 // Caller owns the created packet. Also, sets the entropy hash of the | 151 // Caller owns the created packet. Also, sets the entropy hash of the |
| 152 // serialized packet to a random bool and returns that value as a member of | 152 // serialized packet to a random bool and returns that value as a member of |
| 153 // SerializedPacket. | 153 // SerializedPacket. |
| 154 QuicEncryptedPacket* SerializeVersionNegotiationPacket( | 154 QuicEncryptedPacket* SerializeVersionNegotiationPacket( |
| 155 const QuicVersionVector& supported_versions); | 155 const QuicVersionVector& supported_versions); |
| 156 | 156 |
| 157 // Re-serializes frames with the original packet's packet number length. | 157 // Re-serializes frames with the original packet's packet number length. |
| 158 // Used for retransmitting packets to ensure they aren't too long. | 158 // Used for retransmitting packets to ensure they aren't too long. |
| 159 // Caller must ensure that any open FEC group is closed before calling this | 159 // Caller must ensure that any open FEC group is closed before calling this |
| 160 // method. | 160 // method. |
| 161 SerializedPacket ReserializeAllFrames(const RetransmittableFrames& frames, | 161 SerializedPacket ReserializeAllFrames( |
| 162 QuicPacketNumberLength original_length, | 162 const RetransmittableFrames& frames, |
| 163 char* buffer, | 163 EncryptionLevel original_encryption_level, |
| 164 size_t buffer_len); | 164 QuicPacketNumberLength original_length, |
| 165 char* buffer, |
| 166 size_t buffer_len); |
| 165 | 167 |
| 166 // Update the packet number length to use in future packets as soon as it | 168 // Update the packet number length to use in future packets as soon as it |
| 167 // can be safely changed. | 169 // can be safely changed. |
| 168 void UpdateSequenceNumberLength(QuicPacketNumber least_packet_awaited_by_peer, | 170 void UpdateSequenceNumberLength(QuicPacketNumber least_packet_awaited_by_peer, |
| 169 QuicPacketCount max_packets_in_flight); | 171 QuicPacketCount max_packets_in_flight); |
| 170 | 172 |
| 171 // Set the minimum number of bytes for the connection id length; | 173 // Set the minimum number of bytes for the connection id length; |
| 172 void SetConnectionIdLength(uint32 length); | 174 void SetConnectionIdLength(uint32 length); |
| 173 | 175 |
| 174 // Called when the FEC alarm fires. | 176 // Called when the FEC alarm fires. |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 // the maximum size we are actually using now, if we are in the middle of the | 269 // the maximum size we are actually using now, if we are in the middle of the |
| 268 // packet. | 270 // packet. |
| 269 QuicByteCount max_packet_length_; | 271 QuicByteCount max_packet_length_; |
| 270 | 272 |
| 271 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); | 273 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); |
| 272 }; | 274 }; |
| 273 | 275 |
| 274 } // namespace net | 276 } // namespace net |
| 275 | 277 |
| 276 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ | 278 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ |
| OLD | NEW |