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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // mode, we should probably set a timer so that several independent | 46 // mode, we should probably set a timer so that several independent |
47 // operations can be grouped into the same FEC group. | 47 // operations can be grouped into the same FEC group. |
48 // | 48 // |
49 // When an FEC packet is generated, it will be send to the Delegate, | 49 // When an FEC packet is generated, it will be send to the Delegate, |
50 // even if the Delegate has become unwritable after handling the | 50 // even if the Delegate has become unwritable after handling the |
51 // data packet immediately proceeding the FEC packet. | 51 // data packet immediately proceeding the FEC packet. |
52 | 52 |
53 #ifndef NET_QUIC_QUIC_PACKET_GENERATOR_H_ | 53 #ifndef NET_QUIC_QUIC_PACKET_GENERATOR_H_ |
54 #define NET_QUIC_QUIC_PACKET_GENERATOR_H_ | 54 #define NET_QUIC_QUIC_PACKET_GENERATOR_H_ |
55 | 55 |
| 56 #include <list> |
| 57 |
56 #include "base/containers/hash_tables.h" | 58 #include "base/containers/hash_tables.h" |
57 #include "net/quic/quic_ack_notifier.h" | 59 #include "net/quic/quic_ack_notifier.h" |
58 #include "net/quic/quic_packet_creator.h" | 60 #include "net/quic/quic_packet_creator.h" |
59 #include "net/quic/quic_sent_packet_manager.h" | 61 #include "net/quic/quic_sent_packet_manager.h" |
60 #include "net/quic/quic_types.h" | 62 #include "net/quic/quic_types.h" |
61 | 63 |
62 namespace net { | 64 namespace net { |
63 | 65 |
64 namespace test { | 66 namespace test { |
65 class QuicPacketGeneratorPeer; | 67 class QuicPacketGeneratorPeer; |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 bool should_send_ack_; | 251 bool should_send_ack_; |
250 bool should_send_stop_waiting_; | 252 bool should_send_stop_waiting_; |
251 // If we put a non-retransmittable frame (ack frame) in this packet, then we | 253 // If we put a non-retransmittable frame (ack frame) in this packet, then we |
252 // have to hold a reference to it until we flush (and serialize it). | 254 // have to hold a reference to it until we flush (and serialize it). |
253 // Retransmittable frames are referenced elsewhere so that they | 255 // Retransmittable frames are referenced elsewhere so that they |
254 // can later be (optionally) retransmitted. | 256 // can later be (optionally) retransmitted. |
255 scoped_ptr<QuicAckFrame> pending_ack_frame_; | 257 scoped_ptr<QuicAckFrame> pending_ack_frame_; |
256 scoped_ptr<QuicStopWaitingFrame> pending_stop_waiting_frame_; | 258 scoped_ptr<QuicStopWaitingFrame> pending_stop_waiting_frame_; |
257 | 259 |
258 // Stores notifiers that should be attached to the next serialized packet. | 260 // Stores notifiers that should be attached to the next serialized packet. |
259 base::hash_set<QuicAckNotifier*> ack_notifiers_; | 261 std::list<QuicAckNotifier*> ack_notifiers_; |
260 | 262 |
261 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); | 263 DISALLOW_COPY_AND_ASSIGN(QuicPacketGenerator); |
262 }; | 264 }; |
263 | 265 |
264 } // namespace net | 266 } // namespace net |
265 | 267 |
266 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ | 268 #endif // NET_QUIC_QUIC_PACKET_GENERATOR_H_ |
OLD | NEW |