gfe-relnote: Return QuicCryptoServerStreamBase from CreateCryptoServerStream. Refactor only - no behavior change, not flag protected
The QuicCryptoServerStreamBase abstract class has been modified to contain all of the public methods of QuicCryptoServerStream (there was one method missing, ShouldSendExpectCTHeader). QuicCryptoServerStreamBase should be used in place of QuicCryptoServerStream.
PiperOrigin-RevId: 288054167
Change-Id: Ia32159ecd3906385b4a31866e54c933e1c26eeac
diff --git a/quic/core/quic_crypto_server_stream.cc b/quic/core/quic_crypto_server_stream.cc
index 9b2a021..8a299c5 100644
--- a/quic/core/quic_crypto_server_stream.cc
+++ b/quic/core/quic_crypto_server_stream.cc
@@ -27,7 +27,7 @@
QuicCryptoServerStreamBase::QuicCryptoServerStreamBase(QuicSession* session)
: QuicCryptoStream(session) {}
-std::unique_ptr<QuicCryptoServerStream> CreateCryptoServerStream(
+std::unique_ptr<QuicCryptoServerStreamBase> CreateCryptoServerStream(
const QuicCryptoServerConfig* crypto_config,
QuicCompressedCertsCache* compressed_certs_cache,
QuicSession* session,
diff --git a/quic/core/quic_crypto_server_stream.h b/quic/core/quic_crypto_server_stream.h
index 890ee56..852bb93 100644
--- a/quic/core/quic_crypto_server_stream.h
+++ b/quic/core/quic_crypto_server_stream.h
@@ -56,6 +56,13 @@
const = 0;
virtual void SetPreviousCachedNetworkParams(
CachedNetworkParameters cached_network_params) = 0;
+
+ // NOTE: Indicating that the Expect-CT header should be sent here presents
+ // a layering violation to some extent. The Expect-CT header only applies to
+ // HTTP connections, while this class can be used for non-HTTP applications.
+ // However, it is exposed here because that is the only place where the
+ // configuration for the certificate used in the connection is accessible.
+ virtual bool ShouldSendExpectCTHeader() const = 0;
};
class QUIC_EXPORT_PRIVATE QuicCryptoServerStream
@@ -157,13 +164,7 @@
bool ZeroRttAttempted() const override;
void SetPreviousCachedNetworkParams(
CachedNetworkParameters cached_network_params) override;
-
- // NOTE: Indicating that the Expect-CT header should be sent here presents
- // a layering violation to some extent. The Expect-CT header only applies to
- // HTTP connections, while this class can be used for non-HTTP applications.
- // However, it is exposed here because that is the only place where the
- // configuration for the certificate used in the connection is accessible.
- bool ShouldSendExpectCTHeader() const;
+ bool ShouldSendExpectCTHeader() const override;
bool encryption_established() const override;
bool handshake_confirmed() const override;
@@ -176,7 +177,7 @@
const ParsedQuicVersion& version) override;
protected:
- friend std::unique_ptr<QuicCryptoServerStream> CreateCryptoServerStream(
+ friend std::unique_ptr<QuicCryptoServerStreamBase> CreateCryptoServerStream(
const QuicCryptoServerConfig* crypto_config,
QuicCompressedCertsCache* compressed_certs_cache,
QuicSession* session,
@@ -219,7 +220,7 @@
// including the version used by |session|. |crypto_config|, |session|, and
// |helper| must all outlive the stream. The caller takes ownership of the
// returned object.
-std::unique_ptr<QuicCryptoServerStream> CreateCryptoServerStream(
+std::unique_ptr<QuicCryptoServerStreamBase> CreateCryptoServerStream(
const QuicCryptoServerConfig* crypto_config,
QuicCompressedCertsCache* compressed_certs_cache,
QuicSession* session,
diff --git a/quic/quartc/quartc_session.h b/quic/quartc/quartc_session.h
index e389867..6e00fcf 100644
--- a/quic/quartc/quartc_session.h
+++ b/quic/quartc/quartc_session.h
@@ -331,7 +331,7 @@
QuicCryptoServerStream::Helper* const stream_helper_;
// Server perspective crypto stream.
- std::unique_ptr<QuicCryptoServerStream> crypto_stream_;
+ std::unique_ptr<QuicCryptoServerStreamBase> crypto_stream_;
};
} // namespace quic
diff --git a/quic/quic_transport/quic_transport_server_session.h b/quic/quic_transport/quic_transport_server_session.h
index 4630e22..c023264 100644
--- a/quic/quic_transport/quic_transport_server_session.h
+++ b/quic/quic_transport/quic_transport_server_session.h
@@ -111,7 +111,7 @@
virtual void OnIncomingDataStream(QuicTransportStream* /*stream*/) {}
- std::unique_ptr<QuicCryptoServerStream> crypto_stream_;
+ std::unique_ptr<QuicCryptoServerStreamBase> crypto_stream_;
bool ready_ = false;
ServerVisitor* visitor_;
};