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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // Called when the FEC alarm fires. | 171 // Called when the FEC alarm fires. |
172 void OnFecTimeout(); | 172 void OnFecTimeout(); |
173 | 173 |
174 // Called after sending |sequence_number| to determine whether an FEC alarm | 174 // Called after sending |sequence_number| to determine whether an FEC alarm |
175 // should be set for sending out an FEC packet. Returns a positive and finite | 175 // should be set for sending out an FEC packet. Returns a positive and finite |
176 // timeout if an FEC alarm should be set, and infinite if no alarm should be | 176 // timeout if an FEC alarm should be set, and infinite if no alarm should be |
177 // set. OnFecTimeout should be called to send the FEC packet when the alarm | 177 // set. OnFecTimeout should be called to send the FEC packet when the alarm |
178 // fires. | 178 // fires. |
179 QuicTime::Delta GetFecTimeout(QuicPacketSequenceNumber sequence_number); | 179 QuicTime::Delta GetFecTimeout(QuicPacketSequenceNumber sequence_number); |
180 | 180 |
| 181 // Sets the encrypter to use for the encryption level. |
| 182 void SetEncrypter(EncryptionLevel level, QuicEncrypter* encrypter); |
| 183 |
181 // Sets the encryption level that will be applied to new packets. | 184 // Sets the encryption level that will be applied to new packets. |
182 void set_encryption_level(EncryptionLevel level); | 185 void set_encryption_level(EncryptionLevel level); |
183 | 186 |
184 // Sequence number of the last created packet, or 0 if no packets have been | 187 // Sequence number of the last created packet, or 0 if no packets have been |
185 // created. | 188 // created. |
186 QuicPacketSequenceNumber sequence_number() const; | 189 QuicPacketSequenceNumber sequence_number() const; |
187 | 190 |
188 QuicByteCount max_packet_length() const; | 191 QuicByteCount max_packet_length() const; |
189 | 192 |
190 void set_max_packet_length(QuicByteCount length); | 193 void set_max_packet_length(QuicByteCount length); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 264 |
262 // Stores notifiers that should be attached to the next serialized packet. | 265 // Stores notifiers that should be attached to the next serialized packet. |
263 std::list<QuicAckNotifier*> ack_notifiers_; | 266 std::list<QuicAckNotifier*> ack_notifiers_; |
264 | 267 |
265 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); | 268 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); |
266 }; | 269 }; |
267 | 270 |
268 } // namespace net | 271 } // namespace net |
269 | 272 |
270 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ | 273 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ |
OLD | NEW |