Revert of "Prevent race conditions between decrypt and close session"
[ Original CL http://ag/3890635, Merge of http://go/wvgerrit/50340 ] The original fix was not sufficient to address all race conditions. A subsequent CL will address them. Bug: 73781703 Bug: 79158083 Bug: 79262108 Test: WV unit/integration tests, GTS GtsMediaTestCases tests and 24 hours of continuous Netflix playback. Change-Id: I869c22a250e2467b3d49935815e4157dc012fff5
This commit is contained in:
@@ -37,7 +37,7 @@ class CdmSession {
|
||||
CdmSession(FileSystem* file_system, metrics::SessionMetrics* metrics);
|
||||
virtual ~CdmSession();
|
||||
|
||||
void Close();
|
||||
void Close() { closed_ = true; }
|
||||
bool IsClosed() { return closed_; }
|
||||
|
||||
// Initializes this instance of CdmSession with the given property set.
|
||||
@@ -263,9 +263,6 @@ class CdmSession {
|
||||
bool mock_license_parser_in_use_;
|
||||
bool mock_policy_engine_in_use_;
|
||||
|
||||
// Lock to avoid race conditions between Close() and Decrypt()
|
||||
Lock close_lock_;
|
||||
|
||||
CORE_DISALLOW_COPY_AND_ASSIGN(CdmSession);
|
||||
};
|
||||
|
||||
|
||||
@@ -333,7 +333,6 @@ enum CdmResponseType {
|
||||
GET_PROVISIONING_METHOD_ERROR = 289,
|
||||
SESSION_NOT_FOUND_17 = 290,
|
||||
SESSION_NOT_FOUND_18 = 291,
|
||||
SESSION_CLOSED_1 = 292,
|
||||
};
|
||||
|
||||
enum CdmKeyStatus {
|
||||
|
||||
@@ -72,11 +72,6 @@ CdmSession::~CdmSession() {
|
||||
}
|
||||
}
|
||||
|
||||
void CdmSession::Close() {
|
||||
AutoLock lock(close_lock_);
|
||||
closed_ = true;
|
||||
}
|
||||
|
||||
CdmResponseType CdmSession::Init(
|
||||
CdmClientPropertySet* cdm_client_property_set) {
|
||||
return Init(cdm_client_property_set, NULL, NULL);
|
||||
@@ -581,11 +576,6 @@ CdmResponseType CdmSession::Decrypt(const CdmDecryptionParameters& params) {
|
||||
return NOT_INITIALIZED_ERROR;
|
||||
}
|
||||
|
||||
AutoLock lock(close_lock_);
|
||||
if (IsClosed()) {
|
||||
return SESSION_CLOSED_1;
|
||||
}
|
||||
|
||||
// Playback may not begin until either the start time passes or the license
|
||||
// is updated, so we treat this Decrypt call as invalid.
|
||||
if (params.is_encrypted) {
|
||||
|
||||
@@ -599,8 +599,6 @@ void PrintTo(const enum CdmResponseType& value, ::std::ostream* os) {
|
||||
break;
|
||||
case SESSION_NOT_FOUND_18: *os << "SESSION_NOT_FOUND_18";
|
||||
break;
|
||||
case SESSION_CLOSED_1: *os << "SESSION_CLOSED_1";
|
||||
break;
|
||||
default:
|
||||
*os << "Unknown CdmResponseType";
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user