Google-style override & virtual

(This is a merge of http://go/wvgerrit/66625)

Google C++ Style dictates that methods which override base class or
interface methods should be declared "override" but not "virtual". Since
our codebase has not had access to "override" until now, many of our
classes do not follow this rule. I've updated as many places as I could
find to follow Google C++ Style, which should hopefully help us catch
errors better in the future.

Bug: 111851141
Test: CE CDM Unit Tests
Test: Android Unit Tests
Change-Id: Ic23e2e482e967256da306791532b5fec7b81b2f2
This commit is contained in:
John W. Bruce
2018-12-06 09:01:18 -08:00
parent 5629a646d8
commit b771d93514
19 changed files with 111 additions and 112 deletions

View File

@@ -18,38 +18,38 @@ class ContentKeySession : public KeySession {
: KeySession(metrics),
oec_session_id_(oec_session_id),
cipher_mode_(kCipherModeCtr) {}
virtual ~ContentKeySession() {}
~ContentKeySession() override {}
virtual KeySessionType Type() override { return kDefault; }
KeySessionType Type() override { return kDefault; }
// Generate Derived Keys for ContentKeySession
virtual bool GenerateDerivedKeys(const std::string& message) override;
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;
bool GenerateDerivedKeys(const std::string& message,
const std::string& session_key) override;
// Load Keys for ContentKeySession
virtual OEMCryptoResult LoadKeys(const std::string& message,
const std::string& signature,
const std::string& mac_key_iv,
const std::string& mac_key,
const std::vector<CryptoKey>& keys,
const std::string& provider_session_token,
CdmCipherMode* cipher_mode,
const std::string& srm_requirement) override;
OEMCryptoResult LoadKeys(const std::string& message,
const std::string& signature,
const std::string& mac_key_iv,
const std::string& mac_key,
const std::vector<CryptoKey>& keys,
const std::string& provider_session_token,
CdmCipherMode* cipher_mode,
const std::string& srm_requirement) override;
virtual OEMCryptoResult LoadEntitledContentKeys(
OEMCryptoResult LoadEntitledContentKeys(
const std::vector<CryptoKey>&) override {
return OEMCrypto_ERROR_INVALID_CONTEXT;
}
// Select Key for ContentKeySession
virtual OEMCryptoResult SelectKey(const std::string& key_id,
CdmCipherMode cipher_mode) override;
OEMCryptoResult SelectKey(const std::string& key_id,
CdmCipherMode cipher_mode) override;
// Decrypt for ContentKeySession
virtual OEMCryptoResult Decrypt(
OEMCryptoResult Decrypt(
const CdmDecryptionParameters& params,
OEMCrypto_DestBufferDesc& buffer_descriptor,
OEMCrypto_CENCEncryptPatternDesc& pattern_descriptor) override;
@@ -60,8 +60,7 @@ class ContentKeySession : public KeySession {
const std::string& mac_key_iv, const std::string& mac_key,
const std::vector<CryptoKey>& keys,
const std::string& provider_session_token, CdmCipherMode* cipher_mode,
const std::string& srm_requirement,
OEMCrypto_LicenseType license_type);
const std::string& srm_requirement, OEMCrypto_LicenseType license_type);
CryptoSessionId oec_session_id_;

View File

@@ -19,23 +19,23 @@ class EntitlementKeySession : public ContentKeySession {
public:
EntitlementKeySession(CryptoSessionId oec_session_id,
metrics::CryptoMetrics* metrics);
virtual ~EntitlementKeySession() {}
~EntitlementKeySession() override {}
KeySessionType Type() { return kEntitlement; }
// Load Keys for ContentKeySession
virtual OEMCryptoResult LoadKeys(const std::string& message,
const std::string& signature,
const std::string& mac_key_iv,
const std::string& mac_key,
const std::vector<CryptoKey>& keys,
const std::string& provider_session_token,
CdmCipherMode* cipher_mode,
const std::string& srm_requirement) override;
virtual OEMCryptoResult LoadEntitledContentKeys(
OEMCryptoResult LoadKeys(const std::string& message,
const std::string& signature,
const std::string& mac_key_iv,
const std::string& mac_key,
const std::vector<CryptoKey>& keys,
const std::string& provider_session_token,
CdmCipherMode* cipher_mode,
const std::string& srm_requirement) override;
OEMCryptoResult LoadEntitledContentKeys(
const std::vector<CryptoKey>& keys) override;
virtual OEMCryptoResult SelectKey(const std::string& key_id,
CdmCipherMode cipher_mode) override;
OEMCryptoResult SelectKey(const std::string& key_id,
CdmCipherMode cipher_mode) override;
private:
// The message is populated with the fields of the provided CryptoKey and the