Prevent race conditions between decrypt and close session
[ Merge of http://go/wvgerrit/47520 ] Bug: 73781703 Test: WV unit/integration tests, GTS GtsMediaTestCases tests and AUPT tests. Change-Id: I618ed8ca38855aecdb31e829a7f4041cbd505a02
This commit is contained in:
@@ -37,7 +37,7 @@ class CdmSession {
|
||||
CdmSession(FileSystem* file_system, metrics::SessionMetrics* metrics);
|
||||
virtual ~CdmSession();
|
||||
|
||||
void Close() { closed_ = true; }
|
||||
void Close();
|
||||
bool IsClosed() { return closed_; }
|
||||
|
||||
// Initializes this instance of CdmSession with the given property set.
|
||||
@@ -263,6 +263,9 @@ 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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user