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

Unified Diff: net/quic/quic_connection.cc

Issue 1666553002: Make QUIC's SerializedPacket contain QuicFrames, rather than a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@113205205
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/congestion_control/general_loss_algorithm_test.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection.cc
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
index 25cc949158a584dc9f6d80fbf0b040c7c66eb53f..a59eaa23ea6498fe5d08a2af1475754fa1cbeaae 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -1188,8 +1188,8 @@ void QuicConnection::SendRstStream(QuicStreamId id,
QueuedPacketList::iterator packet_iterator = queued_packets_.begin();
while (packet_iterator != queued_packets_.end()) {
QuicFrames* retransmittable_frames =
- packet_iterator->retransmittable_frames;
- if (retransmittable_frames == nullptr) {
+ &packet_iterator->retransmittable_frames;
+ if (retransmittable_frames->empty()) {
++packet_iterator;
continue;
}
@@ -1825,6 +1825,7 @@ void QuicConnection::SendOrQueuePacket(SerializedPacket* packet) {
packet->packet = packet->packet->Clone();
}
queued_packets_.push_back(*packet);
+ packet->retransmittable_frames.clear();
}
// If a forward-secure encrypter is available but is not being used and the
@@ -2359,7 +2360,7 @@ HasRetransmittableData QuicConnection::IsRetransmittable(
// Retransmitted packets retransmittable frames are owned by the unacked
// packet map, but are not present in the serialized packet.
if (packet.transmission_type != NOT_RETRANSMISSION ||
- packet.retransmittable_frames != nullptr) {
+ !packet.retransmittable_frames.empty()) {
return HAS_RETRANSMITTABLE_DATA;
} else {
return NO_RETRANSMITTABLE_DATA;
@@ -2367,10 +2368,10 @@ HasRetransmittableData QuicConnection::IsRetransmittable(
}
bool QuicConnection::IsTerminationPacket(const SerializedPacket& packet) {
- if (packet.retransmittable_frames == nullptr) {
+ if (packet.retransmittable_frames.empty()) {
return false;
}
- for (const QuicFrame& frame : *packet.retransmittable_frames) {
+ for (const QuicFrame& frame : packet.retransmittable_frames) {
if (frame.type == CONNECTION_CLOSE_FRAME) {
return true;
}
« no previous file with comments | « net/quic/congestion_control/general_loss_algorithm_test.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698