Allow QuicReceiveControlStreams to construct from pending streams.

gfe-relnote: n/a --unused code.
PiperOrigin-RevId: 245838514
Change-Id: I7f01b4236da10776aa559f371a86478d7adcd7a0
diff --git a/quic/core/http/quic_receive_control_stream.cc b/quic/core/http/quic_receive_control_stream.cc
index 4c625c0..8e0c011 100644
--- a/quic/core/http/quic_receive_control_stream.cc
+++ b/quic/core/http/quic_receive_control_stream.cc
@@ -111,6 +111,14 @@
   sequencer()->set_level_triggered(true);
 }
 
+QuicReceiveControlStream::QuicReceiveControlStream(PendingStream pending)
+    : QuicStream(std::move(pending), READ_UNIDIRECTIONAL),
+      received_settings_length_(0),
+      http_decoder_visitor_(new HttpDecoderVisitor(this)) {
+  decoder_.set_visitor(http_decoder_visitor_.get());
+  sequencer()->set_level_triggered(true);
+}
+
 QuicReceiveControlStream::~QuicReceiveControlStream() {}
 
 void QuicReceiveControlStream::OnStreamReset(const QuicRstStreamFrame& frame) {
diff --git a/quic/core/http/quic_receive_control_stream.h b/quic/core/http/quic_receive_control_stream.h
index 1805d6c..61e4299 100644
--- a/quic/core/http/quic_receive_control_stream.h
+++ b/quic/core/http/quic_receive_control_stream.h
@@ -20,6 +20,9 @@
   // |session| can't be nullptr, and the ownership is not passed. The stream can
   // only be accessed through the session.
   explicit QuicReceiveControlStream(QuicStreamId id, QuicSpdySession* session);
+  // Construct control stream from pending stream, the |pending| object will no
+  // longer exist after the construction.
+  explicit QuicReceiveControlStream(PendingStream pending);
   QuicReceiveControlStream(const QuicReceiveControlStream&) = delete;
   QuicReceiveControlStream& operator=(const QuicReceiveControlStream&) = delete;
   ~QuicReceiveControlStream() override;