Merge changes I2618c2be,Ie8b9d8b9,I2f39f99c
* changes: Support GetPropertyByteArray for getting metrics. CDM Metrics Protocol buffer serialization. Refactored metrics to support pull model.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#include "initialization_data.h"
|
||||
#include "license.h"
|
||||
#include "log.h"
|
||||
#include "metrics_front_end.h"
|
||||
#include "metrics.pb.h"
|
||||
#include "properties.h"
|
||||
#include "service_certificate.h"
|
||||
#include "wv_cdm_constants.h"
|
||||
@@ -21,22 +21,10 @@ namespace wvcdm {
|
||||
|
||||
Lock WvContentDecryptionModule::session_sharing_id_generation_lock_;
|
||||
|
||||
WvContentDecryptionModule::WvContentDecryptionModule() {
|
||||
// TODO (b/36497276)
|
||||
// replace call to new AmiAdapter() and remove ami_apdater.*
|
||||
report_root_ = NULL; // new AmiAdapter();
|
||||
front_end_ = new metrics::MetricsFrontEnd(report_root_);
|
||||
metrics::MetricsFrontEnd::OverrideInstance(front_end_);
|
||||
}
|
||||
WvContentDecryptionModule::WvContentDecryptionModule() {}
|
||||
|
||||
WvContentDecryptionModule::~WvContentDecryptionModule() {
|
||||
DisablePolicyTimer(true);
|
||||
|
||||
metrics::MetricsFrontEnd::OverrideInstance(NULL);
|
||||
delete front_end_;
|
||||
delete report_root_;
|
||||
front_end_ = NULL;
|
||||
report_root_ = NULL;
|
||||
}
|
||||
|
||||
bool WvContentDecryptionModule::IsSupported(const std::string& init_data_type) {
|
||||
@@ -409,6 +397,25 @@ bool WvContentDecryptionModule::IsValidServiceCertificate(
|
||||
NO_ERROR;
|
||||
}
|
||||
|
||||
void WvContentDecryptionModule::GetSerializedMetrics(
|
||||
std::string* serialized_metrics) {
|
||||
drm_metrics::MetricsGroup metric_group;
|
||||
{
|
||||
AutoLock auto_lock(cdms_lock_);
|
||||
for (auto it = cdms_.begin(); it != cdms_.end(); it++) {
|
||||
metrics::EngineMetrics* engine_metrics =
|
||||
it->second.cdm_engine->GetMetrics();
|
||||
if (engine_metrics) {
|
||||
// Serialize the metrics from the engine and any completed sessions.
|
||||
// Clear the metrics from any completed sessions.
|
||||
engine_metrics->Serialize(
|
||||
metric_group.add_metric_sub_group(), true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
metric_group.SerializeToString(serialized_metrics);
|
||||
}
|
||||
|
||||
WvContentDecryptionModule::CdmInfo::CdmInfo()
|
||||
: cdm_engine(new CdmEngine(&file_system)) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user