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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 void SendQueuedFrames(bool flush, bool is_fec_timeout); | 252 void SendQueuedFrames(bool flush, bool is_fec_timeout); |
253 | 253 |
254 // Test to see if we have pending ack, or control frames. | 254 // Test to see if we have pending ack, or control frames. |
255 bool HasPendingFrames() const; | 255 bool HasPendingFrames() const; |
256 // Test to see if the addition of a pending frame (which might be | 256 // Test to see if the addition of a pending frame (which might be |
257 // retransmittable) would still allow the resulting packet to be sent now. | 257 // retransmittable) would still allow the resulting packet to be sent now. |
258 bool CanSendWithNextPendingFrameAddition() const; | 258 bool CanSendWithNextPendingFrameAddition() const; |
259 // Add exactly one pending frame, preferring ack frames over control frames. | 259 // Add exactly one pending frame, preferring ack frames over control frames. |
260 bool AddNextPendingFrame(); | 260 bool AddNextPendingFrame(); |
261 // Adds a frame and takes ownership of the underlying buffer if the addition | 261 // Adds a frame and takes ownership of the underlying buffer. |
262 // was successful. | 262 bool AddFrame(const QuicFrame& frame, |
263 bool AddFrame(const QuicFrame& frame, char* buffer, bool needs_padding); | 263 UniqueStreamBuffer buffer, |
| 264 bool needs_padding); |
264 | 265 |
265 void SerializeAndSendPacket(); | 266 void SerializeAndSendPacket(); |
266 | 267 |
267 DelegateInterface* delegate_; | 268 DelegateInterface* delegate_; |
268 DebugDelegate* debug_delegate_; | 269 DebugDelegate* debug_delegate_; |
269 | 270 |
270 QuicPacketCreator packet_creator_; | 271 QuicPacketCreator packet_creator_; |
271 QuicFrames queued_control_frames_; | 272 QuicFrames queued_control_frames_; |
272 | 273 |
273 // True if batch mode is currently enabled. | 274 // True if batch mode is currently enabled. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 // the maximum size we are actually using now, if we are in the middle of the | 310 // the maximum size we are actually using now, if we are in the middle of the |
310 // packet. | 311 // packet. |
311 QuicByteCount max_packet_length_; | 312 QuicByteCount max_packet_length_; |
312 | 313 |
313 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); | 314 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); |
314 }; | 315 }; |
315 | 316 |
316 } // namespace net | 317 } // namespace net |
317 | 318 |
318 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ | 319 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ |
OLD | NEW |