Revert "Create unique cdm engines per WVDrmPlugin instance"

This change introduced b/77618383, need to revert.

This reverts commit 58234a69f2.

Change-Id: Ie7d515bcd94f2dcee6fa9b885cd0441845c82c22

Bug: 77618383
(cherry picked from commit 90441e24df)

Change-Id: I114cb3cf5b69e2698d407ba4cf15cefcad2aaf3d
This commit is contained in:
Jeff Tinker
2018-04-05 17:56:43 +00:00
committed by android-build-team Robot
parent 94157fbfeb
commit 629e179f7c
11 changed files with 198 additions and 338 deletions

View File

@@ -127,14 +127,9 @@ class WvContentDecryptionModule : public android::RefBase, public TimerHandler {
// Validate a passed-in service certificate
virtual bool IsValidServiceCertificate(const std::string& certificate);
// Fill the metrics parameter with the metrics data for the CdmEngine
// associated with the given CdmIdentifier. If the CdmEngine instance does
// not exist, this will return an error.
virtual CdmResponseType GetMetrics(const CdmIdentifier& identifier,
drm_metrics::WvCdmMetrics* metrics);
// Closes the CdmEngine and sessions associated with the given CdmIdentifier.
virtual CdmResponseType CloseCdm(const CdmIdentifier& identifier);
// Retrieve the serialized metrics from CdmEngine and CdmSession instances
// that have been closed.
virtual void GetSerializedMetrics(std::string* serialized_metrics);
private:
struct CdmInfo {
@@ -150,10 +145,10 @@ class WvContentDecryptionModule : public android::RefBase, public TimerHandler {
// Finds the CdmEngine instance for the given session id, returning NULL if
// not found.
CdmEngine* GetCdmForSessionId(const std::string& session_id);
// Close all of the open CdmEngine instances. This is used when ready to close
// the WvContentDecryptionModule instance.
void CloseAllCdms();
// Closes CdmEngine instances that don't have any open sessions. Also stores
// metrics data for closed CdmEngine instances.
// Callers must acquire the cdms_lock_ before calling this method.
void CloseCdmsWithoutSessions();
uint32_t GenerateSessionSharingId();
@@ -175,6 +170,9 @@ class WvContentDecryptionModule : public android::RefBase, public TimerHandler {
// This contains weak pointers to the CDM instances contained in |cdms_|.
std::map<std::string, CdmEngine*> cdm_by_session_id_;
// The metrics for cdm engines and sessions that have been closed.
drm_metrics::WvCdmMetricsGroup metrics_group_;
CORE_DISALLOW_COPY_AND_ASSIGN(WvContentDecryptionModule);
};