gfe-relnote: In QUIC, combine NumHandshakeMessages and NumHandshakeMessagesWithServerNonces in QuicCryptoServerStreamBase to IsZeroRtt. Refactoring only, not protected. PiperOrigin-RevId: 300838886 Change-Id: I04f4850bb75197c0fcef58c7d601bdc5e6cc77c0
diff --git a/quic/core/quic_crypto_server_stream.cc b/quic/core/quic_crypto_server_stream.cc index 84fd42f..c651351 100644 --- a/quic/core/quic_crypto_server_stream.cc +++ b/quic/core/quic_crypto_server_stream.cc
@@ -293,12 +293,9 @@ ++num_server_config_update_messages_sent_; } -uint8_t QuicCryptoServerStream::NumHandshakeMessages() const { - return num_handshake_messages_; -} - -uint8_t QuicCryptoServerStream::NumHandshakeMessagesWithServerNonces() const { - return num_handshake_messages_with_server_nonces_; +bool QuicCryptoServerStream::IsZeroRtt() const { + return num_handshake_messages_ == 1 && + num_handshake_messages_with_server_nonces_ == 0; } int QuicCryptoServerStream::NumServerConfigUpdateMessagesSent() const {
diff --git a/quic/core/quic_crypto_server_stream.h b/quic/core/quic_crypto_server_stream.h index 2dc04a4..fd14d27 100644 --- a/quic/core/quic_crypto_server_stream.h +++ b/quic/core/quic_crypto_server_stream.h
@@ -34,8 +34,7 @@ bool GetBase64SHA256ClientChannelID(std::string* output) const override; void SendServerConfigUpdate( const CachedNetworkParameters* cached_network_params) override; - uint8_t NumHandshakeMessages() const override; - uint8_t NumHandshakeMessagesWithServerNonces() const override; + bool IsZeroRtt() const override; int NumServerConfigUpdateMessagesSent() const override; const CachedNetworkParameters* PreviousCachedNetworkParams() const override; bool ZeroRttAttempted() const override;
diff --git a/quic/core/quic_crypto_server_stream_base.h b/quic/core/quic_crypto_server_stream_base.h index 2e84d3b..cdf12a3 100644 --- a/quic/core/quic_crypto_server_stream_base.h +++ b/quic/core/quic_crypto_server_stream_base.h
@@ -62,9 +62,7 @@ virtual void SendServerConfigUpdate( const CachedNetworkParameters* cached_network_params) = 0; - // These are all accessors and setters to their respective counters. - virtual uint8_t NumHandshakeMessages() const = 0; - virtual uint8_t NumHandshakeMessagesWithServerNonces() const = 0; + virtual bool IsZeroRtt() const = 0; virtual bool ZeroRttAttempted() const = 0; virtual const CachedNetworkParameters* PreviousCachedNetworkParams() const = 0;
diff --git a/quic/core/tls_server_handshaker.cc b/quic/core/tls_server_handshaker.cc index 6831e69..bda7598 100644 --- a/quic/core/tls_server_handshaker.cc +++ b/quic/core/tls_server_handshaker.cc
@@ -83,14 +83,9 @@ // SCUP messages aren't supported when using the TLS handshake. } -uint8_t TlsServerHandshaker::NumHandshakeMessages() const { - // TODO(nharper): Return a sensible value here. - return 0; -} - -uint8_t TlsServerHandshaker::NumHandshakeMessagesWithServerNonces() const { - // TODO(nharper): Return a sensible value here. - return 0; +bool TlsServerHandshaker::IsZeroRtt() const { + // TODO(nharper): Support 0-RTT with TLS 1.3 in QUIC. + return false; } int TlsServerHandshaker::NumServerConfigUpdateMessagesSent() const {
diff --git a/quic/core/tls_server_handshaker.h b/quic/core/tls_server_handshaker.h index 7e58030..07c56eb 100644 --- a/quic/core/tls_server_handshaker.h +++ b/quic/core/tls_server_handshaker.h
@@ -39,8 +39,7 @@ bool GetBase64SHA256ClientChannelID(std::string* output) const override; void SendServerConfigUpdate( const CachedNetworkParameters* cached_network_params) override; - uint8_t NumHandshakeMessages() const override; - uint8_t NumHandshakeMessagesWithServerNonces() const override; + bool IsZeroRtt() const override; int NumServerConfigUpdateMessagesSent() const override; const CachedNetworkParameters* PreviousCachedNetworkParams() const override; bool ZeroRttAttempted() const override;