From d902366ac89b4806beaeac966b472ce6268712c6 Mon Sep 17 00:00:00 2001 From: "John W. Bruce" Date: Wed, 14 Nov 2018 10:45:57 -0800 Subject: [PATCH] override, Don't OVERRIDE (This is a merge of http://go/wvgerrit/65263) Now that C++11 is mandatory, we can drop the OVERRIDE macro which was inconsistently used in the codebase in favor of using the override keyword directly. Bug: 111851141 Test: CE CDM Unit Tests Test: Android Build Change-Id: I0b7559624b84feb19740afd63463dadd243412b0 --- .../cdm/core/include/content_key_session.h | 15 +++++++------- .../core/include/entitlement_key_session.h | 7 +++---- libwvdrmengine/cdm/core/include/override.h | 20 ------------------- 3 files changed, 10 insertions(+), 32 deletions(-) delete mode 100644 libwvdrmengine/cdm/core/include/override.h diff --git a/libwvdrmengine/cdm/core/include/content_key_session.h b/libwvdrmengine/cdm/core/include/content_key_session.h index 005dc09e..c3f73255 100644 --- a/libwvdrmengine/cdm/core/include/content_key_session.h +++ b/libwvdrmengine/cdm/core/include/content_key_session.h @@ -7,7 +7,6 @@ #include "key_session.h" #include "metrics_collections.h" -#include "override.h" #include "timer_metric.h" namespace wvcdm { @@ -21,14 +20,14 @@ class ContentKeySession : public KeySession { cipher_mode_(kCipherModeCtr) {} virtual ~ContentKeySession() {} - virtual KeySessionType Type() OVERRIDE { return kDefault; } + virtual KeySessionType Type() override { return kDefault; } // Generate Derived Keys for ContentKeySession - virtual bool GenerateDerivedKeys(const std::string& message) OVERRIDE; + virtual bool GenerateDerivedKeys(const std::string& message) override; // Generate Derived Keys (from session key) for ContentKeySession virtual bool GenerateDerivedKeys(const std::string& message, - const std::string& session_key) OVERRIDE; + const std::string& session_key) override; // Load Keys for ContentKeySession virtual OEMCryptoResult LoadKeys(const std::string& message, @@ -38,22 +37,22 @@ class ContentKeySession : public KeySession { const std::vector& keys, const std::string& provider_session_token, CdmCipherMode* cipher_mode, - const std::string& srm_requirement) OVERRIDE; + const std::string& srm_requirement) override; virtual OEMCryptoResult LoadEntitledContentKeys( - const std::vector&) OVERRIDE { + const std::vector&) override { return OEMCrypto_ERROR_INVALID_CONTEXT; } // Select Key for ContentKeySession virtual OEMCryptoResult SelectKey(const std::string& key_id, - CdmCipherMode cipher_mode) OVERRIDE; + CdmCipherMode cipher_mode) override; // Decrypt for ContentKeySession virtual OEMCryptoResult Decrypt( const CdmDecryptionParameters& params, OEMCrypto_DestBufferDesc& buffer_descriptor, - OEMCrypto_CENCEncryptPatternDesc& pattern_descriptor) OVERRIDE; + OEMCrypto_CENCEncryptPatternDesc& pattern_descriptor) override; protected: virtual OEMCryptoResult LoadKeysAsLicenseType( diff --git a/libwvdrmengine/cdm/core/include/entitlement_key_session.h b/libwvdrmengine/cdm/core/include/entitlement_key_session.h index 518962a8..a052432d 100644 --- a/libwvdrmengine/cdm/core/include/entitlement_key_session.h +++ b/libwvdrmengine/cdm/core/include/entitlement_key_session.h @@ -12,7 +12,6 @@ #include "content_key_session.h" #include "crypto_key.h" #include "metrics_collections.h" -#include "override.h" namespace wvcdm { @@ -32,11 +31,11 @@ class EntitlementKeySession : public ContentKeySession { const std::vector& keys, const std::string& provider_session_token, CdmCipherMode* cipher_mode, - const std::string& srm_requirement) OVERRIDE; + const std::string& srm_requirement) override; virtual OEMCryptoResult LoadEntitledContentKeys( - const std::vector& keys) OVERRIDE; + const std::vector& keys) override; virtual OEMCryptoResult SelectKey(const std::string& key_id, - CdmCipherMode cipher_mode) OVERRIDE; + CdmCipherMode cipher_mode) override; private: // The object returned by this function contains raw pointers to the passed-in diff --git a/libwvdrmengine/cdm/core/include/override.h b/libwvdrmengine/cdm/core/include/override.h deleted file mode 100644 index c913ceca..00000000 --- a/libwvdrmengine/cdm/core/include/override.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary -// source code may only be used and distributed under the Widevine Master -// License Agreement. -// TODO: Import to core/, use everywhere. -#ifndef WVCDM_CDM_OVERRIDE_H_ -#define WVCDM_CDM_OVERRIDE_H_ - -#define GCC_HAS_OVERRIDE ( \ - (__GNUC__ > 4) || \ - (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) \ -) - -#if !defined(DISABLE_OVERRIDE_KEYWORD) && \ - (defined(COMPILER_MSVC) || defined(__clang__) || GCC_HAS_OVERRIDE) -#define OVERRIDE override -#else -#define OVERRIDE -#endif - -#endif // WVCDM_CDM_OVERRIDE_H_