Make CreateIncomingStream() to take PendingStream* instead of PendingStream. PendingStream* will be passed to create QuicStream.
non const pointer is used because sequencer and flow controller need to be transferred to QuicStream.
This reduces uses of std::move().
gfe-relnote: refactor. No behavior change. Not flag protected.
PiperOrigin-RevId: 250575271
Change-Id: I8a2897d8a8d76a3da5096bc6d643afe704125433
diff --git a/quic/core/quic_stream_test.cc b/quic/core/quic_stream_test.cc
index 9b32012..094ca79 100644
--- a/quic/core/quic_stream_test.cc
+++ b/quic/core/quic_stream_test.cc
@@ -49,8 +49,8 @@
TestStream(QuicStreamId id, QuicSession* session, StreamType type)
: QuicStream(id, session, /*is_static=*/false, type) {}
- TestStream(PendingStream pending, StreamType type, bool is_static)
- : QuicStream(std::move(pending), type, is_static) {}
+ TestStream(PendingStream* pending, StreamType type, bool is_static)
+ : QuicStream(pending, type, is_static) {}
void OnDataAvailable() override {}
@@ -175,11 +175,11 @@
Initialize();
PendingStream pending(kTestStreamId + 2, session_.get());
- TestStream stream(std::move(pending), StreamType::BIDIRECTIONAL, false);
+ TestStream stream(&pending, StreamType::BIDIRECTIONAL, false);
EXPECT_FALSE(stream.is_static());
PendingStream pending2(kTestStreamId + 3, session_.get());
- TestStream stream2(std::move(pending2), StreamType::BIDIRECTIONAL, true);
+ TestStream stream2(&pending2, StreamType::BIDIRECTIONAL, true);
EXPECT_TRUE(stream2.is_static());
}
@@ -240,7 +240,7 @@
QuicStreamFrame frame2(kTestStreamId + 2, true, 3, QuicStringPiece("."));
pending.OnStreamFrame(frame2);
- TestStream stream(std::move(pending), StreamType::READ_UNIDIRECTIONAL, false);
+ TestStream stream(&pending, StreamType::READ_UNIDIRECTIONAL, false);
EXPECT_EQ(3, stream.num_frames_received());
EXPECT_EQ(3u, stream.stream_bytes_read());
EXPECT_EQ(1, stream.num_duplicate_frames_received());
@@ -259,8 +259,8 @@
QuicStreamFrame frame(kTestStreamId + 2, false, 2, QuicStringPiece("."));
pending.OnStreamFrame(frame);
- auto stream = new TestStream(std::move(pending),
- StreamType::READ_UNIDIRECTIONAL, false);
+ auto stream =
+ new TestStream(&pending, StreamType::READ_UNIDIRECTIONAL, false);
session_->ActivateStream(QuicWrapUnique(stream));
QuicStreamFrame frame2(kTestStreamId + 2, true, 3, QuicStringPiece("."));