Refine QuicSpdyStream::UsesPendingStreams() behavior.
This is so that VersionHasStreamType(), which is an HTTP/3 concept, can be
removed from QuicStream, which lives in the transport layer.
gfe-relnote: n/a, no functional change.
PiperOrigin-RevId: 254379801
Change-Id: I6634dc77e85673166628b5912788cc8a41db2b57
diff --git a/quic/core/http/quic_spdy_session.cc b/quic/core/http/quic_spdy_session.cc
index b4849ab..55ceb2a 100644
--- a/quic/core/http/quic_spdy_session.cc
+++ b/quic/core/http/quic_spdy_session.cc
@@ -577,8 +577,10 @@
}
bool QuicSpdySession::UsesPendingStreams() const {
- DCHECK(VersionHasStreamType(connection()->transport_version()));
- return true;
+ // QuicSpdySession supports PendingStreams, therefore this method should
+ // eventually just return true. However, pending streams can only be used if
+ // unidirectional stream type is supported.
+ return VersionHasStreamType(connection()->transport_version());
}
size_t QuicSpdySession::WriteHeadersOnHeadersStreamImpl(
diff --git a/quic/core/quic_session.cc b/quic/core/quic_session.cc
index bb2a7b9..19b219d 100644
--- a/quic/core/quic_session.cc
+++ b/quic/core/quic_session.cc
@@ -200,8 +200,7 @@
return;
}
- if (VersionHasStreamType(connection()->transport_version()) &&
- UsesPendingStreams() &&
+ if (UsesPendingStreams() &&
QuicUtils::GetStreamType(stream_id, perspective(),
IsIncomingStream(stream_id)) ==
READ_UNIDIRECTIONAL &&
@@ -370,8 +369,7 @@
visitor_->OnRstStreamReceived(frame);
}
- if (VersionHasStreamType(connection()->transport_version()) &&
- UsesPendingStreams() &&
+ if (UsesPendingStreams() &&
QuicUtils::GetStreamType(stream_id, perspective(),
IsIncomingStream(stream_id)) ==
READ_UNIDIRECTIONAL &&