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

Unified Diff: net/quic/quic_framer.h

Issue 2192633002: Switch to PacketNumberQueue interval iteration and avoid allocations in new ACK frame generation. G… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@128431128
Patch Set: Rebase Created 4 years, 5 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_flags.cc ('k') | net/quic/quic_framer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_framer.h
diff --git a/net/quic/quic_framer.h b/net/quic/quic_framer.h
index 067083a794592b092202f4e99829ed1ea20e24c0..6ac0518d34b86ebb11da84fd8f3cbf138e002e29 100644
--- a/net/quic/quic_framer.h
+++ b/net/quic/quic_framer.h
@@ -411,6 +411,9 @@ class NET_EXPORT_PRIVATE QuicFramer {
QuicPacketNumber first_block_length;
// Ack blocks starting with gaps to next block and ack block lengths.
std::vector<AckBlock> ack_blocks;
+ // Number of ACK blocks. If |ack_blocks| is generated, must equal
+ // |ack_blocks.size()|.
+ size_t num_ack_blocks;
};
bool ProcessDataPacket(QuicDataReader* reader,
@@ -513,12 +516,20 @@ class NET_EXPORT_PRIVATE QuicFramer {
QuicPacketNumber packet_number,
QuicDataWriter* writer);
+ // Appends a single ACK block to |writer| and returns true if the block was
+ // successfully appended.
+ static bool AppendAckBlock(uint8_t gap,
+ QuicPacketNumberLength length_length,
+ QuicPacketNumber length,
+ QuicDataWriter* writer);
+
static uint8_t GetSequenceNumberFlags(
QuicPacketNumberLength packet_number_length);
static AckFrameInfo GetAckFrameInfo(const QuicAckFrame& frame);
- static NewAckFrameInfo GetNewAckFrameInfo(const QuicAckFrame& frame);
+ static NewAckFrameInfo GetNewAckFrameInfo(const QuicAckFrame& frame,
+ bool construct_blocks);
// The Append* methods attempt to write the provided header or frame using the
// |writer|, and return true if successful.
« no previous file with comments | « net/quic/quic_flags.cc ('k') | net/quic/quic_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698