Remove HttpDecoder::set_visitor().
Since all call sites have a visitor ready when HttpDecoder is instantiated, pass
that in HttpDecoder constructor instead of a set_visitor() method. Also make
HttpDecoder::visitor_ member constant. Just one fewer way to hold HttpDecoder
wrong.
While touching this area already, use |QuicMakeUnique| instead of |new| for
initializing unique_ptr<HttpDecoderVisitor> members. And add quic_ptr_util.h
include to every file touched that needs it, even if no QuicMakeUnique is added
with this CL.
Also remove unused QuicReceiveControlStreamTest::decoder_ member.
gfe-relnote: n/a, change only affects QUIC v99.
PiperOrigin-RevId: 257306155
Change-Id: I6b27704dc6001f69668a36cd6072aaa24a95b389
diff --git a/quic/core/http/quic_receive_control_stream.h b/quic/core/http/quic_receive_control_stream.h
index 3ea53cf..1bd13fe 100644
--- a/quic/core/http/quic_receive_control_stream.h
+++ b/quic/core/http/quic_receive_control_stream.h
@@ -41,16 +41,15 @@
// TODO(renjietang): Decode Priority in HTTP/3 style.
bool OnPriorityFrame(const PriorityFrame& priority);
- HttpDecoder decoder_;
-
// Track the current priority frame length.
QuicByteCount current_priority_length_;
// Track the number of settings bytes received.
size_t received_settings_length_;
- // HttpDecoder's visitor.
+ // HttpDecoder and its visitor.
std::unique_ptr<HttpDecoderVisitor> http_decoder_visitor_;
+ HttpDecoder decoder_;
// Sequencer offset keeping track of how much data HttpDecoder has processed.
// Initial value is sequencer()->NumBytesConsumed() at time of