Improve QuicCryptoServerStreamBase functions for querying resumption status
QuicCryptoServerStreamBase::ZeroRttAttempted is currently only used in one
place, which is to query whether or not the client attempted to resume the
crypto connection. In QUIC Crypto, the only way to resume a connection is if
it's a 0-RTT connection, but in TLS, a resumption can occur without 0-RTT.
Given this difference, it makes sense to change the semantics (and name) of
ZeroRttAttempted to match its use (and simplify its implementation for the
TLS handshake). This CL also implements the previously unimplemented
TlsServerHandshaker::ResumptionAttempted.
QuicCryptoServerStreamBase is also missing a function to query whether the
connection was actually a resumption, so this CL adds the unused
IsResumption function.
No behavior changes: renames a method, adds new unused method, not flag protected
PiperOrigin-RevId: 314368205
Change-Id: I985fbc278493f6f104db9b509d83103e37bca48f
diff --git a/quic/core/quic_crypto_server_stream_base.h b/quic/core/quic_crypto_server_stream_base.h
index cdf12a3..540b7a4 100644
--- a/quic/core/quic_crypto_server_stream_base.h
+++ b/quic/core/quic_crypto_server_stream_base.h
@@ -62,8 +62,17 @@
virtual void SendServerConfigUpdate(
const CachedNetworkParameters* cached_network_params) = 0;
+ // Returns true if the connection was a successful 0-RTT resumption.
virtual bool IsZeroRtt() const = 0;
- virtual bool ZeroRttAttempted() const = 0;
+
+ // Returns true if the connection was the result of a resumption handshake,
+ // whether 0-RTT or not.
+ virtual bool IsResumption() const = 0;
+
+ // Returns true if the client attempted a resumption handshake, whether or not
+ // the resumption actually occurred.
+ virtual bool ResumptionAttempted() const = 0;
+
virtual const CachedNetworkParameters* PreviousCachedNetworkParams()
const = 0;
virtual void SetPreviousCachedNetworkParams(