Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1069)

Unified Diff: media/cdm/ppapi/ppapi_cdm_adapter.cc

Issue 2265893003: media: Add UMA to report CDM interface version being used (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cdm/cdm_wrapper.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cdm/ppapi/ppapi_cdm_adapter.cc
diff --git a/media/cdm/ppapi/ppapi_cdm_adapter.cc b/media/cdm/ppapi/ppapi_cdm_adapter.cc
index a28d7037db85777666dbd642ffa4ceedd4415e68..fe76959c5bd4ed82bfa219684904c557cd586c7a 100644
--- a/media/cdm/ppapi/ppapi_cdm_adapter.cc
+++ b/media/cdm/ppapi/ppapi_cdm_adapter.cc
@@ -355,6 +355,19 @@ CdmWrapper* PpapiCdmAdapter::CreateCdmInstance(const std::string& key_system) {
DLOG_TO_CONSOLE(message);
CDM_DLOG() << message;
+ if (cdm) {
+ pp::UMAPrivate uma_interface(this);
+
+ // The interface version is relatively small. So using normal histogram
+ // instead of a sparse histogram is okay. The following DCHECK asserts this.
+ PP_DCHECK(cdm->GetInterfaceVersion() <= 30);
+ uma_interface.HistogramEnumeration(
+ "Media.EME.CdmInterfaceVersion", cdm->GetInterfaceVersion(),
+ // Sample value should always be less than the boundary. Hence use "+1".
+ // See the comment on HistogramEnumeration in ppb_uma_private.idl.
+ cdm::ContentDecryptionModule::kVersion + 1);
+ }
+
return cdm;
}
« no previous file with comments | « media/cdm/cdm_wrapper.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698