| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // created. | 148 // created. |
| 149 QuicPacketNumber packet_number() const; | 149 QuicPacketNumber packet_number() const; |
| 150 | 150 |
| 151 // Returns the maximum packet length. Note that this is the long-term maximum | 151 // Returns the maximum packet length. Note that this is the long-term maximum |
| 152 // packet length, and it may not be the maximum length of the current packet, | 152 // packet length, and it may not be the maximum length of the current packet, |
| 153 // if the generator is in the middle of the packet (in batch mode). | 153 // if the generator is in the middle of the packet (in batch mode). |
| 154 QuicByteCount GetMaxPacketLength() const; | 154 QuicByteCount GetMaxPacketLength() const; |
| 155 // Returns the maximum length current packet can actually have. | 155 // Returns the maximum length current packet can actually have. |
| 156 QuicByteCount GetCurrentMaxPacketLength() const; | 156 QuicByteCount GetCurrentMaxPacketLength() const; |
| 157 | 157 |
| 158 // Set maximum packet length sent. If |force| is set to true, all pending | 158 // Set maximum packet length at the next opportunity. |
| 159 // unfinished packets are closed, and the change is enacted immediately. | 159 void SetMaxPacketLength(QuicByteCount length); |
| 160 // Otherwise, it is enacted at the next opportunity. | |
| 161 void SetMaxPacketLength(QuicByteCount length, bool force); | |
| 162 | 160 |
| 163 // Sets |path_id| to be the path on which next packet is generated. | 161 // Sets |path_id| to be the path on which next packet is generated. |
| 164 void SetCurrentPath(QuicPathId path_id, | 162 void SetCurrentPath(QuicPathId path_id, |
| 165 QuicPacketNumber least_packet_awaited_by_peer, | 163 QuicPacketNumber least_packet_awaited_by_peer, |
| 166 QuicPacketCount max_packets_in_flight); | 164 QuicPacketCount max_packets_in_flight); |
| 167 | 165 |
| 168 void set_debug_delegate(QuicPacketCreator::DebugDelegate* debug_delegate) { | 166 void set_debug_delegate(QuicPacketCreator::DebugDelegate* debug_delegate) { |
| 169 packet_creator_.set_debug_delegate(debug_delegate); | 167 packet_creator_.set_debug_delegate(debug_delegate); |
| 170 } | 168 } |
| 171 | 169 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 // the maximum size we are actually using now, if we are in the middle of the | 205 // the maximum size we are actually using now, if we are in the middle of the |
| 208 // packet. | 206 // packet. |
| 209 QuicByteCount max_packet_length_; | 207 QuicByteCount max_packet_length_; |
| 210 | 208 |
| 211 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); | 209 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); |
| 212 }; | 210 }; |
| 213 | 211 |
| 214 } // namespace net | 212 } // namespace net |
| 215 | 213 |
| 216 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ | 214 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ |
| OLD | NEW |