Avoid race conditions between periodic timer and close sessions am: 5b169b1722

am: 934e0aeff8

Change-Id: I99d34d1038eca0ea567b985f65104b65f0fbce8e
This commit is contained in:
Rahul Frias
2018-05-04 09:25:46 -07:00
committed by android-build-merger

View File

@@ -72,6 +72,7 @@ CdmResponseType WvContentDecryptionModule::CloseSession(
CdmEngine* cdm_engine = GetCdmForSessionId(session_id);
// TODO(rfrias): Avoid reusing the error codes from CdmEngine.
if (!cdm_engine) return SESSION_NOT_FOUND_1;
AutoLock auto_lock(cdms_lock_);
CdmResponseType sts = cdm_engine->CloseSession(session_id);
cdm_engine->GetMetrics()->cdm_engine_close_session_.Increment(sts);
if (sts == NO_ERROR) {