Makes OpenSSL concrete implementations final.

OpenSSL implementations are all final implementations of their more abstract
SSL variants. This should be both documented and enforced by the use of the
final keyword to indicate to future WebRTC contributors that this is the
intended depth of inheritance and it shouldn't be extended again. Hopefully
this minor change will help keep the code simpler to maintain going forward.

Bug: webrtc:9860
Change-Id: Ie22de722214e3b209c3d7727a93ac819c112434e
Reviewed-on: https://webrtc-review.googlesource.com/c/108203
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25401}
This commit is contained in:
Benjamin Wright 2018-10-26 17:50:00 -07:00 committed by Commit Bot
parent 2616594045
commit 61c5cc8eb5
5 changed files with 6 additions and 6 deletions

View File

@ -32,7 +32,7 @@
namespace rtc {
class OpenSSLAdapter : public SSLAdapter, public MessageHandler {
class OpenSSLAdapter final : public SSLAdapter, public MessageHandler {
public:
static bool InitializeSSL();
static bool CleanupSSL();

View File

@ -28,7 +28,7 @@ class OpenSSLKeyPair;
// OpenSSLCertificate encapsulates an OpenSSL X509* certificate object,
// which is also reference counted inside the OpenSSL library.
class OpenSSLCertificate : public SSLCertificate {
class OpenSSLCertificate final : public SSLCertificate {
public:
// X509 object has its reference count incremented. So the caller and
// OpenSSLCertificate share ownership.

View File

@ -20,7 +20,7 @@
namespace rtc {
// An implementation of the digest class that uses OpenSSL.
class OpenSSLDigest : public MessageDigest {
class OpenSSLDigest final : public MessageDigest {
public:
// Creates an OpenSSLDigest with |algorithm| as the hash algorithm.
explicit OpenSSLDigest(const std::string& algorithm);

View File

@ -27,7 +27,7 @@ namespace rtc {
// OpenSSLKeyPair encapsulates an OpenSSL EVP_PKEY* keypair object,
// which is reference counted inside the OpenSSL library.
class OpenSSLKeyPair {
class OpenSSLKeyPair final {
public:
explicit OpenSSLKeyPair(EVP_PKEY* pkey) : pkey_(pkey) {
RTC_DCHECK(pkey_ != nullptr);
@ -58,7 +58,7 @@ class OpenSSLKeyPair {
// Holds a keypair and certificate together, and a method to generate
// them consistently.
class OpenSSLIdentity : public SSLIdentity {
class OpenSSLIdentity final : public SSLIdentity {
public:
static OpenSSLIdentity* GenerateWithExpiration(const std::string& common_name,
const KeyParams& key_params,

View File

@ -56,7 +56,7 @@ class SSLCertChain;
///////////////////////////////////////////////////////////////////////////////
class OpenSSLStreamAdapter : public SSLStreamAdapter {
class OpenSSLStreamAdapter final : public SSLStreamAdapter {
public:
explicit OpenSSLStreamAdapter(StreamInterface* stream);
~OpenSSLStreamAdapter() override;