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

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

Issue 2524443002: Adding Rappor metrics for disabling cross-origin autoplay with sound experiment (Closed)
Patch Set: rebased Created 4 years 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 | third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp » ('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.h
diff --git a/third_party/WebKit/Source/core/html/AutoplayUmaHelper.h b/third_party/WebKit/Source/core/html/AutoplayUmaHelper.h
index 706dd56183f0ea03aad7098bc37ec2557184ecfc..aafa273d334da41fd19acad85f93c779e6dacb64 100644
--- a/third_party/WebKit/Source/core/html/AutoplayUmaHelper.h
+++ b/third_party/WebKit/Source/core/html/AutoplayUmaHelper.h
@@ -10,6 +10,8 @@
#include "core/events/EventListener.h"
#include "platform/heap/Handle.h"
+#include <set>
+
namespace blink {
// These values are used for histograms. Do not reorder.
@@ -38,6 +40,12 @@ enum AutoplayBlockedReason {
AutoplayBlockedReasonMax = 3
};
+enum class CrossOriginAutoplayResult {
+ AutoplayAllowed,
+ AutoplayBlocked,
+ PlayedWithGesture,
+};
+
class Document;
class ElementVisibilityObserver;
class HTMLMediaElement;
@@ -57,6 +65,7 @@ class CORE_EXPORT AutoplayUmaHelper : public EventListener,
void onAutoplayInitiated(AutoplaySource);
+ void recordCrossOriginAutoplayResult(CrossOriginAutoplayResult);
void recordAutoplayUnmuteStatus(AutoplayUnmuteActionStatus);
void didMoveToNewDocument(Document& oldDocument);
@@ -115,6 +124,8 @@ class CORE_EXPORT AutoplayUmaHelper : public EventListener,
// Whether an autoplaying muted video is visible.
bool m_isVisible;
+ std::set<CrossOriginAutoplayResult> m_recordedCrossOriginAutoplayResults;
+
// The observer is used to observer an autoplaying muted video changing it's
// visibility, which is used for offscreen duration UMA. The UMA is pending
// for recording as long as this observer is non-null.
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698