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:
@@ -47,7 +47,7 @@ class Key {
|
||||
Key(const std::vector<uint8_t>& key_string, const KeyControlBlock& control)
|
||||
: value_(key_string), control_(control), ctr_mode_(true){};
|
||||
|
||||
virtual ~Key(){};
|
||||
virtual ~Key() {};
|
||||
void UpdateDuration(const KeyControlBlock& control);
|
||||
virtual const std::vector<uint8_t>& value() const { return value_; }
|
||||
const KeyControlBlock& control() const { return control_; }
|
||||
@@ -65,8 +65,8 @@ class Key {
|
||||
class EntitlementKey : public Key {
|
||||
public:
|
||||
EntitlementKey(const Key& key) : Key(key) {}
|
||||
virtual ~EntitlementKey() {}
|
||||
virtual const std::vector<uint8_t>& value() const { return content_key_; }
|
||||
~EntitlementKey() override {}
|
||||
const std::vector<uint8_t>& value() const override { return content_key_; }
|
||||
const std::vector<uint8_t>& content_key() { return content_key_; }
|
||||
const std::vector<uint8_t>& content_key_id() { return content_key_id_; }
|
||||
const std::vector<uint8_t>& entitlement_key() { return Key::value(); }
|
||||
|
||||
@@ -55,20 +55,20 @@ namespace wvoec_ref {
|
||||
class ContentKeysContext : public SessionContextKeys {
|
||||
public:
|
||||
explicit ContentKeysContext() {}
|
||||
virtual ~ContentKeysContext() {}
|
||||
virtual size_t size() { return session_keys_.size(); }
|
||||
bool Insert(const KeyId& key_id, const Key& key_data);
|
||||
virtual Key* Find(const KeyId& key_id);
|
||||
virtual void Remove(const KeyId& key_id);
|
||||
virtual void UpdateDuration(const KeyControlBlock& control);
|
||||
~ContentKeysContext() override {}
|
||||
size_t size() override { return session_keys_.size(); }
|
||||
bool Insert(const KeyId& key_id, const Key& key_data) override;
|
||||
Key* Find(const KeyId& key_id) override;
|
||||
void Remove(const KeyId& key_id) override;
|
||||
void UpdateDuration(const KeyControlBlock& control) override;
|
||||
|
||||
virtual OEMCrypto_LicenseType type() { return OEMCrypto_ContentLicense; }
|
||||
OEMCrypto_LicenseType type() override { return OEMCrypto_ContentLicense; }
|
||||
|
||||
virtual bool SetContentKey(const KeyId& entitlement_id,
|
||||
const KeyId& content_key_id,
|
||||
const std::vector<uint8_t>& content_key);
|
||||
virtual bool GetEntitlementKey(const KeyId& entitlement_id,
|
||||
const std::vector<uint8_t>** entitlement_key);
|
||||
bool SetContentKey(const KeyId& entitlement_id,
|
||||
const KeyId& content_key_id,
|
||||
const std::vector<uint8_t>& content_key) override;
|
||||
bool GetEntitlementKey(const KeyId& entitlement_id,
|
||||
const std::vector<uint8_t>** entitlement_key) override;
|
||||
|
||||
private:
|
||||
SessionKeyTable session_keys_;
|
||||
@@ -109,19 +109,19 @@ bool ContentKeysContext::GetEntitlementKey(const KeyId& entitlement_id,
|
||||
class EntitlementKeysContext : public SessionContextKeys {
|
||||
public:
|
||||
EntitlementKeysContext() {}
|
||||
virtual ~EntitlementKeysContext() {}
|
||||
virtual size_t size() { return session_keys_.size(); }
|
||||
bool Insert(const KeyId& key_id, const Key& key_data);
|
||||
virtual Key* Find(const KeyId& key_id);
|
||||
virtual void Remove(const KeyId& key_id);
|
||||
virtual void UpdateDuration(const KeyControlBlock& control);
|
||||
virtual bool SetContentKey(const KeyId& entitlement_id,
|
||||
const KeyId& content_key_id,
|
||||
const std::vector<uint8_t>& content_key);
|
||||
virtual bool GetEntitlementKey(const KeyId& entitlement_id,
|
||||
const std::vector<uint8_t>** key);
|
||||
~EntitlementKeysContext() override {}
|
||||
size_t size() override { return session_keys_.size(); }
|
||||
bool Insert(const KeyId& key_id, const Key& key_data) override;
|
||||
Key* Find(const KeyId& key_id) override;
|
||||
void Remove(const KeyId& key_id) override;
|
||||
void UpdateDuration(const KeyControlBlock& control) override;
|
||||
bool SetContentKey(const KeyId& entitlement_id,
|
||||
const KeyId& content_key_id,
|
||||
const std::vector<uint8_t>& content_key) override;
|
||||
bool GetEntitlementKey(const KeyId& entitlement_id,
|
||||
const std::vector<uint8_t>** key) override;
|
||||
|
||||
virtual OEMCrypto_LicenseType type() { return OEMCrypto_EntitlementLicense; }
|
||||
OEMCrypto_LicenseType type() override { return OEMCrypto_EntitlementLicense; }
|
||||
|
||||
private:
|
||||
EntitlementKeyTable session_keys_;
|
||||
|
||||
Reference in New Issue
Block a user