Release offline release sessions
[ Merge of http://go/wvgerrit/21960 ] When an offline release message is generated, a session is created internally to generate the release and handle the release response. If the response is never provided (network, server errors), or there is an error when the response is being processed, the session may not be closed. This change introduces a time to live for release sessions of 60 seconds and will be reclaimed after this period. Test: verified by unittests on angler b/32223945 Change-Id: I3bd4637733ddf6c343956ed9f97c68d84dc7d4e4
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "certificate_provisioning.h"
|
||||
#include "clock.h"
|
||||
#include "crypto_session.h"
|
||||
#include "file_store.h"
|
||||
#include "initialization_data.h"
|
||||
@@ -23,7 +24,10 @@ class UsagePropertySet;
|
||||
class WvCdmEventListener;
|
||||
|
||||
typedef std::map<CdmSessionId, CdmSession*> CdmSessionMap;
|
||||
typedef std::map<CdmKeySetId, CdmSessionId> CdmReleaseKeySetMap;
|
||||
typedef std::map<
|
||||
CdmKeySetId,
|
||||
std::pair<CdmSessionId, int64_t /* expiration time in seconds */> >
|
||||
CdmReleaseKeySetMap;
|
||||
|
||||
class CdmEngine {
|
||||
public:
|
||||
@@ -222,12 +226,15 @@ class CdmEngine {
|
||||
|
||||
std::string MapHdcpVersion(CryptoSession::HdcpCapability version);
|
||||
|
||||
void CloseExpiredReleaseSessions();
|
||||
|
||||
// instance variables
|
||||
CdmSessionMap sessions_;
|
||||
CdmReleaseKeySetMap release_key_sets_;
|
||||
scoped_ptr<CertificateProvisioning> cert_provisioning_;
|
||||
SecurityLevel cert_provisioning_requested_security_level_;
|
||||
FileSystem* file_system_;
|
||||
Clock clock_;
|
||||
|
||||
static bool seeded_;
|
||||
|
||||
@@ -244,6 +251,8 @@ class CdmEngine {
|
||||
// occur simultaneously with OpenSession or CloseSession.
|
||||
Lock session_list_lock_;
|
||||
|
||||
Lock release_key_sets_lock_;
|
||||
|
||||
CORE_DISALLOW_COPY_AND_ASSIGN(CdmEngine);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user