Merge "Add mutex to CdmEngine for use of cert_provisioning_." into rvc-dev
This commit is contained in:
@@ -390,6 +390,8 @@ class CdmEngine {
|
|||||||
CdmSessionMap session_map_;
|
CdmSessionMap session_map_;
|
||||||
CdmReleaseKeySetMap release_key_sets_;
|
CdmReleaseKeySetMap release_key_sets_;
|
||||||
std::unique_ptr<CertificateProvisioning> cert_provisioning_;
|
std::unique_ptr<CertificateProvisioning> cert_provisioning_;
|
||||||
|
// Lock must be acquired before using |cert_provisioning_|.
|
||||||
|
std::mutex cert_provisioning_mutex_;
|
||||||
FileSystem* file_system_;
|
FileSystem* file_system_;
|
||||||
Clock clock_;
|
Clock clock_;
|
||||||
std::string spoid_;
|
std::string spoid_;
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ class UsagePropertySet : public CdmClientPropertySet {
|
|||||||
CdmEngine::CdmEngine(FileSystem* file_system,
|
CdmEngine::CdmEngine(FileSystem* file_system,
|
||||||
std::shared_ptr<metrics::EngineMetrics> metrics)
|
std::shared_ptr<metrics::EngineMetrics> metrics)
|
||||||
: metrics_(metrics),
|
: metrics_(metrics),
|
||||||
cert_provisioning_(),
|
|
||||||
file_system_(file_system),
|
file_system_(file_system),
|
||||||
spoid_(EMPTY_SPOID),
|
spoid_(EMPTY_SPOID),
|
||||||
usage_session_(),
|
usage_session_(),
|
||||||
@@ -902,6 +901,7 @@ CdmResponseType CdmEngine::GetProvisioningRequest(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO(b/141705730): Remove usage entries on provisioning.
|
// TODO(b/141705730): Remove usage entries on provisioning.
|
||||||
|
std::unique_lock<std::mutex> cert_lock(cert_provisioning_mutex_);
|
||||||
if (!cert_provisioning_) {
|
if (!cert_provisioning_) {
|
||||||
cert_provisioning_.reset(
|
cert_provisioning_.reset(
|
||||||
new CertificateProvisioning(metrics_->GetCryptoMetrics()));
|
new CertificateProvisioning(metrics_->GetCryptoMetrics()));
|
||||||
@@ -929,6 +929,7 @@ CdmResponseType CdmEngine::HandleProvisioningResponse(
|
|||||||
SecurityLevel requested_security_level, std::string* cert,
|
SecurityLevel requested_security_level, std::string* cert,
|
||||||
std::string* wrapped_key) {
|
std::string* wrapped_key) {
|
||||||
LOGI("Handling provision request");
|
LOGI("Handling provision request");
|
||||||
|
std::unique_lock<std::mutex> cert_lock(cert_provisioning_mutex_);
|
||||||
if (response.empty()) {
|
if (response.empty()) {
|
||||||
LOGE("Empty provisioning response");
|
LOGE("Empty provisioning response");
|
||||||
cert_provisioning_.reset();
|
cert_provisioning_.reset();
|
||||||
|
|||||||
@@ -973,11 +973,10 @@ CdmResponseType CdmSession::RemoveKeys() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CdmResponseType CdmSession::RemoveLicense() {
|
CdmResponseType CdmSession::RemoveLicense() {
|
||||||
CdmResponseType sts = NO_ERROR;
|
|
||||||
if (is_offline_ || has_provider_session_token()) {
|
if (is_offline_ || has_provider_session_token()) {
|
||||||
if (usage_support_type_ == kUsageEntrySupport &&
|
if (usage_support_type_ == kUsageEntrySupport &&
|
||||||
has_provider_session_token()) {
|
has_provider_session_token()) {
|
||||||
sts = DeleteUsageEntry(usage_entry_number_);
|
DeleteUsageEntry(usage_entry_number_);
|
||||||
}
|
}
|
||||||
DeleteLicenseFile();
|
DeleteLicenseFile();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user