Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3771)

Unified Diff: net/quic/quic_unacked_packet_map.cc

Issue 1428303003: No functional change. Minor change to reorder when the list of QuicAckListeners is swapped into th… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698