Move const declarations into quic_stream_sequencer_buffer.cc constexpr members of a class require definition in addition to declaration and initialization. In Chromium, it is a link error: error: undefined symbol: quic::QuicStreamSequencerBuffer::kInitialBlockCount >>> referenced by quic_stream_sequencer_buffer.cc:88 (../../net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer.cc:88) >>> obj/net/third_party/quiche/quiche/quic_stream_sequencer_buffer.o:(quic::QuicStreamSequencerBuffer::MaybeAddMoreBlocks(unsigned long)) clang: error: linker command failed with exit code 1 (use -v to see invocation) kInitialBlockCount, kBlocksGrowthFactor are only used in .cc file. PiperOrigin-RevId: 341931802 Change-Id: Ie0dfb5d4f777bdcb68ce9cf7327d589d58dd64ff
diff --git a/quic/core/quic_stream_sequencer_buffer.cc b/quic/core/quic_stream_sequencer_buffer.cc index c4559dc..6f39938 100644 --- a/quic/core/quic_stream_sequencer_buffer.cc +++ b/quic/core/quic_stream_sequencer_buffer.cc
@@ -31,6 +31,13 @@ // arrives. const size_t kMaxNumDataIntervalsAllowed = 2 * kMaxPacketGap; +// Number of blocks allocated initially. +constexpr size_t kInitialBlockCount = 8u; + +// How fast block pointers container grow in size. +// Choose 4 to reduce the amount of reallocation. +constexpr int kBlocksGrowthFactor = 4; + } // namespace QuicStreamSequencerBuffer::QuicStreamSequencerBuffer(size_t max_capacity_bytes)
diff --git a/quic/core/quic_stream_sequencer_buffer.h b/quic/core/quic_stream_sequencer_buffer.h index 66acc53..674e3d9 100644 --- a/quic/core/quic_stream_sequencer_buffer.h +++ b/quic/core/quic_stream_sequencer_buffer.h
@@ -82,14 +82,7 @@ // Size of blocks used by this buffer. // Choose 8K to make block large enough to hold multiple frames, each of // which could be up to 1.5 KB. - static constexpr size_t kBlockSizeBytes = 8 * 1024; // 8KB - - // Number of blocks allocated initially. - static constexpr size_t kInitialBlockCount = 8u; - - // How fast block pointers container grow in size. - // Choose 4 to reduce the amount of reallocation. - static constexpr int kBlocksGrowthFactor = 4; + static const size_t kBlockSizeBytes = 8 * 1024; // 8KB // The basic storage block used by this buffer. struct QUIC_EXPORT_PRIVATE BufferBlock {