| Index: net/quic/quic_unacked_packet_map.cc
|
| diff --git a/net/quic/quic_unacked_packet_map.cc b/net/quic/quic_unacked_packet_map.cc
|
| index ab389ce631da89a0efb573da4a88f2bb9634b774..74813419ffe866806d751ec212bc8f226d20b958 100644
|
| --- a/net/quic/quic_unacked_packet_map.cc
|
| +++ b/net/quic/quic_unacked_packet_map.cc
|
| @@ -51,13 +51,7 @@ void QuicUnackedPacketMap::AddSentPacket(SerializedPacket* packet,
|
| TransmissionInfo info(packet->retransmittable_frames,
|
| packet->packet_number_length, transmission_type,
|
| sent_time, bytes_sent, packet->is_fec_packet);
|
| - if (old_packet_number == 0) {
|
| - if (packet->retransmittable_frames != nullptr &&
|
| - packet->retransmittable_frames->HasCryptoHandshake() == IS_HANDSHAKE) {
|
| - ++pending_crypto_packet_count_;
|
| - }
|
| - info.ack_listeners.swap(packet->listeners);
|
| - } else {
|
| + if (old_packet_number > 0) {
|
| TransferRetransmissionInfo(old_packet_number, packet_number,
|
| transmission_type, &info);
|
| }
|
| @@ -68,6 +62,15 @@ void QuicUnackedPacketMap::AddSentPacket(SerializedPacket* packet,
|
| info.in_flight = true;
|
| }
|
| unacked_packets_.push_back(info);
|
| + // Swap the ack listeners after to avoid an extra list allocation.
|
| + // TODO(ianswett): Could use emplace_back when Chromium can.
|
| + if (old_packet_number == 0) {
|
| + if (packet->retransmittable_frames != nullptr &&
|
| + packet->retransmittable_frames->HasCryptoHandshake() == IS_HANDSHAKE) {
|
| + ++pending_crypto_packet_count_;
|
| + }
|
| + unacked_packets_.back().ack_listeners.swap(packet->listeners);
|
| + }
|
| }
|
|
|
| void QuicUnackedPacketMap::RemoveObsoletePackets() {
|
|
|