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

Unified Diff: third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp

Issue 2824643002: media: Add UMA to record whether encrypted media is enabled (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp b/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
index 5fceee8b952698482f3d800676b45d95a08a27e7..1dee6dab1de4e873acbb3c290398994b5a5ee879 100644
--- a/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
+++ b/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
@@ -278,9 +278,20 @@ ScriptPromise NavigatorRequestMediaKeySystemAccess::requestMediaKeySystemAccess(
//
// Do not check settings for Clear Key.
if (key_system != "org.w3.clearkey") {
- // For other key systems, check settings.
- if (!document->GetSettings() ||
- !document->GetSettings()->GetEncryptedMediaEnabled()) {
+ // For other key systems, check settings and report UMA.
+ bool encypted_media_enabled =
+ document->GetSettings() &&
+ document->GetSettings()->GetEncryptedMediaEnabled();
+
+ static bool has_reported_uma = false;
+ if (!has_reported_uma) {
+ has_reported_uma = true;
+ DEFINE_STATIC_LOCAL(BooleanHistogram, histogram,
+ ("Media.EME.EncryptedMediaEnabled"));
+ histogram.Count(encypted_media_enabled);
+ }
+
+ if (!encypted_media_enabled) {
return ScriptPromise::RejectWithDOMException(
script_state,
DOMException::Create(kNotSupportedError, "Unsupported keySystem"));
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698