This change is the complete Widevine metrics system. It will measure and record runtime information about what is happening in the CDM - such as errors and throughput. Bug: 33745339 Bug: 26027857 Change-Id: Ic9a82074f1e2b72c72d751b235f8ae361232787d
32 lines
675 B
C++
32 lines
675 B
C++
// Copyright 2016 Google Inc. All Rights Reserved
|
|
|
|
#include "metrics_front_end.h"
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <log.h>
|
|
|
|
namespace wvcdm {
|
|
namespace metrics {
|
|
|
|
MetricsFrontEnd* MetricsFrontEnd::instance_ = NULL;
|
|
|
|
MetricsFrontEnd::MetricsFrontEnd(Report* root) :
|
|
root_(root) { }
|
|
|
|
MetricNotification* MetricsFrontEnd::CreateSubscriber() {
|
|
return root_ == NULL ? NULL : root_->NewReport();
|
|
}
|
|
|
|
MetricsFrontEnd& MetricsFrontEnd::Instance() {
|
|
static MetricsFrontEnd kDummy(NULL);
|
|
return instance_ == NULL ? kDummy : *instance_;
|
|
}
|
|
|
|
void MetricsFrontEnd::OverrideInstance(MetricsFrontEnd* instance) {
|
|
instance_ = instance;
|
|
}
|
|
|
|
} // namespace metrics
|
|
} // namespace wvcdm
|