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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // can be safely changed. | 155 // can be safely changed. |
156 void UpdateSequenceNumberLength(QuicPacketNumber least_packet_awaited_by_peer, | 156 void UpdateSequenceNumberLength(QuicPacketNumber least_packet_awaited_by_peer, |
157 QuicPacketCount max_packets_in_flight); | 157 QuicPacketCount max_packets_in_flight); |
158 | 158 |
159 // Set the minimum number of bytes for the connection id length; | 159 // Set the minimum number of bytes for the connection id length; |
160 void SetConnectionIdLength(uint32_t length); | 160 void SetConnectionIdLength(uint32_t length); |
161 | 161 |
162 // Sets the encrypter to use for the encryption level. | 162 // Sets the encrypter to use for the encryption level. |
163 void SetEncrypter(EncryptionLevel level, QuicEncrypter* encrypter); | 163 void SetEncrypter(EncryptionLevel level, QuicEncrypter* encrypter); |
164 | 164 |
| 165 // Returns true if there are control frames or current constructed packet has |
| 166 // pending retransmittable frames. |
| 167 bool HasRetransmittableFrames() const; |
| 168 |
165 // Sets the encryption level that will be applied to new packets. | 169 // Sets the encryption level that will be applied to new packets. |
166 void set_encryption_level(EncryptionLevel level); | 170 void set_encryption_level(EncryptionLevel level); |
167 | 171 |
168 // packet number of the last created packet, or 0 if no packets have been | 172 // packet number of the last created packet, or 0 if no packets have been |
169 // created. | 173 // created. |
170 QuicPacketNumber packet_number() const; | 174 QuicPacketNumber packet_number() const; |
171 | 175 |
172 // Returns the maximum length a current packet can actually have. | 176 // Returns the maximum length a current packet can actually have. |
173 QuicByteCount GetCurrentMaxPacketLength() const; | 177 QuicByteCount GetCurrentMaxPacketLength() const; |
174 | 178 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 QuicStopWaitingFrame pending_stop_waiting_frame_; | 229 QuicStopWaitingFrame pending_stop_waiting_frame_; |
226 | 230 |
227 QuicRandom* random_generator_; | 231 QuicRandom* random_generator_; |
228 | 232 |
229 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); | 233 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); |
230 }; | 234 }; |
231 | 235 |
232 } // namespace net | 236 } // namespace net |
233 | 237 |
234 #endif // NET_QUIC_CORE_QUIC_PACKET_GENERATOR_H_ | 238 #endif // NET_QUIC_CORE_QUIC_PACKET_GENERATOR_H_ |
OLD | NEW |