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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 }; | 93 }; |
94 | 94 |
95 QuicPacketGenerator(QuicConnectionId connection_id, | 95 QuicPacketGenerator(QuicConnectionId connection_id, |
96 QuicFramer* framer, | 96 QuicFramer* framer, |
97 QuicRandom* random_generator, | 97 QuicRandom* random_generator, |
98 DelegateInterface* delegate); | 98 DelegateInterface* delegate); |
99 | 99 |
100 virtual ~QuicPacketGenerator(); | 100 virtual ~QuicPacketGenerator(); |
101 | 101 |
102 // Called by the connection in the event of the congestion window changing. | 102 // Called by the connection in the event of the congestion window changing. |
103 void OnCongestionWindowChange(QuicByteCount congestion_window); | 103 void OnCongestionWindowChange(QuicPacketCount max_packets_in_flight); |
104 | 104 |
105 // Indicates that an ACK frame should be sent. If |also_send_feedback| is | 105 // Indicates that an ACK frame should be sent. If |also_send_feedback| is |
106 // true, then it also indicates a CONGESTION_FEEDBACK frame should be sent. | 106 // true, then it also indicates a CONGESTION_FEEDBACK frame should be sent. |
107 // If |also_send_stop_waiting| is true, then it also indicates that a | 107 // If |also_send_stop_waiting| is true, then it also indicates that a |
108 // STOP_WAITING frame should be sent as well. | 108 // STOP_WAITING frame should be sent as well. |
109 // The contents of the frame(s) will be generated via a call to the delegates | 109 // The contents of the frame(s) will be generated via a call to the delegates |
110 // CreateAckFrame() and CreateFeedbackFrame() when the packet is serialized. | 110 // CreateAckFrame() and CreateFeedbackFrame() when the packet is serialized. |
111 void SetShouldSendAck(bool also_send_feedback, | 111 void SetShouldSendAck(bool also_send_feedback, |
112 bool also_send_stop_waiting); | 112 bool also_send_stop_waiting); |
113 | 113 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // Caller must ensure that any open FEC group is closed before calling this | 158 // Caller must ensure that any open FEC group is closed before calling this |
159 // method. | 159 // method. |
160 SerializedPacket ReserializeAllFrames( | 160 SerializedPacket ReserializeAllFrames( |
161 const QuicFrames& frames, | 161 const QuicFrames& frames, |
162 QuicSequenceNumberLength original_length); | 162 QuicSequenceNumberLength original_length); |
163 | 163 |
164 // Update the sequence number length to use in future packets as soon as it | 164 // Update the sequence number length to use in future packets as soon as it |
165 // can be safely changed. | 165 // can be safely changed. |
166 void UpdateSequenceNumberLength( | 166 void UpdateSequenceNumberLength( |
167 QuicPacketSequenceNumber least_packet_awaited_by_peer, | 167 QuicPacketSequenceNumber least_packet_awaited_by_peer, |
168 QuicByteCount congestion_window); | 168 QuicPacketCount max_packets_in_flight); |
169 | 169 |
170 // Set the minimum number of bytes for the connection id length; | 170 // Set the minimum number of bytes for the connection id length; |
171 void SetConnectionIdLength(uint32 length); | 171 void SetConnectionIdLength(uint32 length); |
172 | 172 |
173 // Sets the encryption level that will be applied to new packets. | 173 // Sets the encryption level that will be applied to new packets. |
174 void set_encryption_level(EncryptionLevel level); | 174 void set_encryption_level(EncryptionLevel level); |
175 | 175 |
176 // 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 |
177 // created. | 177 // created. |
178 QuicPacketSequenceNumber sequence_number() const; | 178 QuicPacketSequenceNumber sequence_number() const; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 scoped_ptr<QuicAckFrame> pending_ack_frame_; | 241 scoped_ptr<QuicAckFrame> pending_ack_frame_; |
242 scoped_ptr<QuicCongestionFeedbackFrame> pending_feedback_frame_; | 242 scoped_ptr<QuicCongestionFeedbackFrame> pending_feedback_frame_; |
243 scoped_ptr<QuicStopWaitingFrame> pending_stop_waiting_frame_; | 243 scoped_ptr<QuicStopWaitingFrame> pending_stop_waiting_frame_; |
244 | 244 |
245 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); | 245 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); |
246 }; | 246 }; |
247 | 247 |
248 } // namespace net | 248 } // namespace net |
249 | 249 |
250 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ | 250 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ |
OLD | NEW |