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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 // Removes entries from the unacked packet map, and deletes | 116 // Removes entries from the unacked packet map, and deletes |
117 // the retransmittable frames associated with the packet. | 117 // the retransmittable frames associated with the packet. |
118 // Does not remove any previous or subsequent transmissions of this packet. | 118 // Does not remove any previous or subsequent transmissions of this packet. |
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's only purpose is to measure RTT. It must not |
126 static bool IsSentAndNotPending(const TransmissionInfo& transmission_info); | 126 // be pending, have retransmittable frames, or be linked to transmissions |
| 127 // with retransmittable frames. |
| 128 static bool IsForRttOnly(const TransmissionInfo& transmission_info); |
127 | 129 |
128 private: | 130 private: |
129 void MaybeRemoveRetransmittableFrames(TransmissionInfo* transmission_info); | 131 void MaybeRemoveRetransmittableFrames(TransmissionInfo* transmission_info); |
130 | 132 |
131 QuicPacketSequenceNumber largest_sent_packet_; | 133 QuicPacketSequenceNumber largest_sent_packet_; |
132 | 134 |
133 // Newly serialized retransmittable and fec packets are added to this map, | 135 // Newly serialized retransmittable and fec packets are added to this map, |
134 // which contains owning pointers to any contained frames. If a packet is | 136 // which contains owning pointers to any contained frames. If a packet is |
135 // retransmitted, this map will contain entries for both the old and the new | 137 // retransmitted, this map will contain entries for both the old and the new |
136 // packet. The old packet's retransmittable frames entry will be NULL, while | 138 // packet. The old packet's retransmittable frames entry will be NULL, while |
137 // the new packet's entry will contain the frames to retransmit. | 139 // the new packet's entry will contain the frames to retransmit. |
138 // If the old packet is acked before the new packet, then the old entry will | 140 // If the old packet is acked before the new packet, then the old entry will |
139 // be removed from the map and the new entry's retransmittable frames will be | 141 // be removed from the map and the new entry's retransmittable frames will be |
140 // set to NULL. | 142 // set to NULL. |
141 UnackedPacketMap unacked_packets_; | 143 UnackedPacketMap unacked_packets_; |
142 | 144 |
143 size_t bytes_in_flight_; | 145 size_t bytes_in_flight_; |
144 // Number of outstanding crypto handshake packets. | 146 // Number of outstanding crypto handshake packets. |
145 size_t pending_crypto_packet_count_; | 147 size_t pending_crypto_packet_count_; |
146 | 148 |
147 DISALLOW_COPY_AND_ASSIGN(QuicUnackedPacketMap); | 149 DISALLOW_COPY_AND_ASSIGN(QuicUnackedPacketMap); |
148 }; | 150 }; |
149 | 151 |
150 } // namespace net | 152 } // namespace net |
151 | 153 |
152 #endif // NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ | 154 #endif // NET_QUIC_QUIC_UNACKED_PACKET_MAP_H_ |
OLD | NEW |