OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ | 5 #ifndef NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ |
6 #define NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ | 6 #define NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ |
7 | 7 |
8 #include "net/base/linked_hash_map.h" | 8 #include "net/base/linked_hash_map.h" |
9 #include "net/quic/quic_protocol.h" | 9 #include "net/quic/quic_protocol.h" |
10 | 10 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 void RemovePacket(QuicPacketSequenceNumber sequence_number); | 119 void RemovePacket(QuicPacketSequenceNumber sequence_number); |
120 | 120 |
121 // Neuters the specified packet. Deletes any retransmittable | 121 // Neuters the specified packet. Deletes any retransmittable |
122 // frames, and sets all_transmissions to only include itself. | 122 // frames, and sets all_transmissions to only include itself. |
123 void NeuterPacket(QuicPacketSequenceNumber sequence_number); | 123 void NeuterPacket(QuicPacketSequenceNumber sequence_number); |
124 | 124 |
125 // Returns true if the packet has been marked as sent by SetSent. | 125 // Returns true if the packet has been marked as sent by SetSent. |
126 static bool IsSentAndNotPending(const TransmissionInfo& transmission_info); | 126 static bool IsSentAndNotPending(const TransmissionInfo& transmission_info); |
127 | 127 |
128 private: | 128 private: |
| 129 void MaybeRemoveRetransmittableFrames(TransmissionInfo* transmission_info); |
| 130 |
129 QuicPacketSequenceNumber largest_sent_packet_; | 131 QuicPacketSequenceNumber largest_sent_packet_; |
130 | 132 |
131 // Newly serialized retransmittable and fec packets are added to this map, | 133 // Newly serialized retransmittable and fec packets are added to this map, |
132 // which contains owning pointers to any contained frames. If a packet is | 134 // which contains owning pointers to any contained frames. If a packet is |
133 // retransmitted, this map will contain entries for both the old and the new | 135 // retransmitted, this map will contain entries for both the old and the new |
134 // packet. The old packet's retransmittable frames entry will be NULL, while | 136 // packet. The old packet's retransmittable frames entry will be NULL, while |
135 // the new packet's entry will contain the frames to retransmit. | 137 // the new packet's entry will contain the frames to retransmit. |
136 // If the old packet is acked before the new packet, then the old entry will | 138 // If the old packet is acked before the new packet, then the old entry will |
137 // be removed from the map and the new entry's retransmittable frames will be | 139 // be removed from the map and the new entry's retransmittable frames will be |
138 // set to NULL. | 140 // set to NULL. |
139 UnackedPacketMap unacked_packets_; | 141 UnackedPacketMap unacked_packets_; |
140 | 142 |
141 size_t bytes_in_flight_; | 143 size_t bytes_in_flight_; |
142 // Number of outstanding crypto handshake packets. | 144 // Number of outstanding crypto handshake packets. |
143 size_t pending_crypto_packet_count_; | 145 size_t pending_crypto_packet_count_; |
144 | 146 |
145 DISALLOW_COPY_AND_ASSIGN(QuicUnackedPacketMap); | 147 DISALLOW_COPY_AND_ASSIGN(QuicUnackedPacketMap); |
146 }; | 148 }; |
147 | 149 |
148 } // namespace net | 150 } // namespace net |
149 | 151 |
150 #endif // NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ | 152 #endif // NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ |
OLD | NEW |