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

Unified Diff: net/quic/quic_unacked_packet_map.cc

Issue 1660593004: Landing Recent QUIC changes until 01/28/2016 18:41 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0202
Patch Set: Created 4 years, 11 months 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 | « net/quic/quic_session.h ('k') | net/quic/quic_unacked_packet_map_test.cc » ('j') | 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 b3abe557cbc1178dfa2998d8de23cac095a258a1..2153c7cf3ef55ed1cd0dd8af6cab7c45cd7e149c 100644
--- a/net/quic/quic_unacked_packet_map.cc
+++ b/net/quic/quic_unacked_packet_map.cc
@@ -62,18 +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.
+ // Swap the ack listeners and retransmittable frames to avoid allocations.
// TODO(ianswett): Could use emplace_back when Chromium can.
if (old_packet_number == 0) {
if (has_crypto_handshake) {
++pending_crypto_packet_count_;
}
- if (packet->retransmittable_frames != nullptr) {
- packet->retransmittable_frames->swap(
- unacked_packets_.back().retransmittable_frames);
- delete packet->retransmittable_frames;
- packet->retransmittable_frames = nullptr;
- }
+
+ packet->retransmittable_frames.swap(
+ unacked_packets_.back().retransmittable_frames);
unacked_packets_.back().ack_listeners.swap(packet->listeners);
}
}
« no previous file with comments | « net/quic/quic_session.h ('k') | net/quic/quic_unacked_packet_map_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698