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

Unified Diff: Source/core/html/HTMLMediaElement.cpp

Issue 719413002: Added new AutoplayEnabledThroughLoad entry to the Blink.MediaElement.Autoplay histogram (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 83501f963528b688a2843f831a48733b5a6ecb3b..88e39384ea252ce0413015723eec8c1f678e60a2 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -276,6 +276,8 @@ enum AutoplayMetrics {
AutoplayBailout = 2,
// Autoplay disabled but user manually started media.
AutoplayManualStart = 3,
+ // Autoplay was (re)enabled through a user-gesture triggered load()
+ AutoplayEnabledThroughLoad = 4,
// This enum value must be last.
NumberOfAutoplayMetrics,
};
@@ -740,8 +742,10 @@ void HTMLMediaElement::load()
{
WTF_LOG(Media, "HTMLMediaElement::load(%p)", this);
- if (UserGestureIndicator::processingUserGesture())
+ if (UserGestureIndicator::processingUserGesture()) {
+ recordAutoplayMetric(AutoplayEnabledThroughLoad);
m_userGestureRequiredForPlay = false;
+ }
prepareForLoad();
loadInternal();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698