Remove Stale Licenses on Reprovisioning

Merges change 267713c (Remove stale licenses on reprovisioning) from
the Widevine CDM repository.  This change removes licenses belonging
to the previous provisioning when provisioning changes.

Bug: 9761923
Change-Id: I473816dd11dd950f4fb009b5b004630bd2d2b579
This commit is contained in:
John "Juce" Bruce
2013-08-08 14:57:40 -07:00
parent ba66224ef4
commit 0fa3e16999
13 changed files with 250 additions and 104 deletions

View File

@@ -17,10 +17,11 @@ class DeviceFiles {
kLicenseStateUnknown,
} LicenseState;
DeviceFiles() {}
DeviceFiles(): file_(NULL), security_level_(kSecurityLevelUninitialized),
initialized_(false) {}
virtual ~DeviceFiles() {}
virtual bool Init(File* handle);
virtual bool Init(const File* handle, CdmSecurityLevel security_level);
virtual bool StoreCertificate(const std::string& certificate,
const std::string& wrapped_private_key);
@@ -44,6 +45,7 @@ class DeviceFiles {
CdmKeyResponse* key_renewal_response,
std::string* release_server_url);
virtual bool DeleteLicense(const std::string& key_set_id);
virtual bool DeleteAllLicenses();
virtual bool LicenseExists(const std::string& key_set_id);
// For testing only
@@ -57,6 +59,8 @@ class DeviceFiles {
private:
File* file_;
CdmSecurityLevel security_level_;
bool initialized_;
CORE_DISALLOW_COPY_AND_ASSIGN(DeviceFiles);
};