Delete ParsedQuicVersion.handshake_protocol references from the gfe/ directory.
This is a prerequisite to
(1) compressing ParsedQuicVersion by deleting the handshake_protocol field and
(2) scrubbing gQUIC from the GFE code.
PiperOrigin-RevId: 834980728
diff --git a/quiche/quic/core/quic_versions.cc b/quiche/quic/core/quic_versions.cc
index c526e2a..31336ec 100644
--- a/quiche/quic/core/quic_versions.cc
+++ b/quiche/quic/core/quic_versions.cc
@@ -67,7 +67,6 @@
}
bool ParsedQuicVersion::IsIetfQuic() const {
- QUICHE_DCHECK(IsKnown());
return transport_version > QUIC_VERSION_46;
}
diff --git a/quiche/quic/core/quic_versions.h b/quiche/quic/core/quic_versions.h
index 371c0c5..e71c3e5 100644
--- a/quiche/quic/core/quic_versions.h
+++ b/quiche/quic/core/quic_versions.h
@@ -166,14 +166,8 @@
return transport_version > QUIC_VERSION_46;
}
-// Returns whether this combination of handshake protocol and transport
-// version is allowed. For example, {PROTOCOL_TLS1_3, QUIC_VERSION_46} is NOT
-// allowed as TLS requires crypto frames which v46 does not support. Note that
-// UnsupportedQuicVersion is a valid version.
-QUICHE_EXPORT constexpr bool ParsedQuicVersionIsValid(
- HandshakeProtocol handshake_protocol,
+QUICHE_EXPORT constexpr bool TransportVersionIsValid(
QuicTransportVersion transport_version) {
- bool transport_version_is_valid = false;
constexpr QuicTransportVersion valid_transport_versions[] = {
QUIC_VERSION_IETF_RFC_V2,
QUIC_VERSION_IETF_RFC_V1,
@@ -184,11 +178,20 @@
};
for (size_t i = 0; i < ABSL_ARRAYSIZE(valid_transport_versions); ++i) {
if (transport_version == valid_transport_versions[i]) {
- transport_version_is_valid = true;
- break;
+ return true;
}
}
- if (!transport_version_is_valid) {
+ return false;
+}
+
+// Returns whether this combination of handshake protocol and transport
+// version is allowed. For example, {PROTOCOL_TLS1_3, QUIC_VERSION_46} is NOT
+// allowed as TLS requires crypto frames which v46 does not support. Note that
+// UnsupportedQuicVersion is a valid version.
+QUICHE_EXPORT constexpr bool ParsedQuicVersionIsValid(
+ HandshakeProtocol handshake_protocol,
+ QuicTransportVersion transport_version) {
+ if (!TransportVersionIsValid(transport_version)) {
return false;
}
switch (handshake_protocol) {