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

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: 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..d08059cdb9825206a3cb180b7659ae1a3b042b22 100644
--- a/third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp
+++ b/third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp
@@ -74,6 +74,18 @@ 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_elemnet->isHTMLVideoElement() && m_element->muted() &&
+ source == AutoplaySource::Attribute) {
+ Platform::current()->recordRapporURL(
+ "Media.Video.Autoplay.Muted.Attribute.ChildFrame",
+ m_element->document().url());
+ Platform::current()->recordRapporURL(
+ "Media.Video.Autoplay.Muted.Attribute.TopLevelFrame",
+ m_element->document().topDocument().url());
mlamouri (slow - plz ping) 2017/02/20 11:23:43 FWIW, I'm not sure if that's the right thing to do
Zhiqiang Zhang (Slow) 2017/02/20 17:49:43 Maybe we just don't record the top-level frames at
+ }
+
// 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