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

Unified Diff: third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp

Issue 2706593002: [Blink>Media] Adding rappor metrics to record autoplay muted by attribute usage (Closed)
Patch Set: record separately Created 3 years, 10 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/rappor/rappor.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp
diff --git a/third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp b/third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp
index 5fc56a2b056e249db05da4372a308268df3abefd..f35884ba50cd80e3eb39b2766b74f7eac198b166 100644
--- a/third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp
+++ b/third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp
@@ -74,6 +74,21 @@ void AutoplayUmaHelper::onAutoplayInitiated(AutoplaySource source) {
audioHistogram.count(static_cast<int>(m_source));
}
+ // Record the child frame and top-level frame URLs for autoplay muted videos
+ // by attribute.
+ if (m_element->isHTMLVideoElement() && m_element->muted()) {
+ if (source == AutoplaySource::Attribute) {
+ Platform::current()->recordRapporURL(
+ "Media.Video.Autoplay.Muted.Attribute.Frame",
+ m_element->document().url());
+ } else {
+ DCHECK(source == AutoplaySource::Method);
+ Platform::current()->recordRapporURL(
+ "Media.Video.Autoplay.Muted.PlayMethod.Frame",
+ m_element->document().url());
+ }
+ }
+
// Record if it will be blocked by Data Saver or Autoplay setting.
if (m_element->isHTMLVideoElement() && m_element->muted() &&
RuntimeEnabledFeatures::autoplayMutedVideosEnabled()) {
« no previous file with comments | « no previous file | tools/metrics/rappor/rappor.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698