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

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: new implementation Created 4 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
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 7dda64bb56d55bc2b799c5290a8a9b9f2c420e88..bc1d6282bb60ee76a6077df46ff25223e5b492a5 100644
--- a/third_party/WebKit/Source/core/html/AutoplayUmaHelper.h
+++ b/third_party/WebKit/Source/core/html/AutoplayUmaHelper.h
@@ -8,6 +8,8 @@
#include "core/events/EventListener.h"
#include "platform/heap/Handle.h"
+#include <set>
+
namespace blink {
// These values are used for histograms. Do not reorder.
@@ -36,6 +38,12 @@ enum AutoplayBlockedReason {
AutoplayBlockedReasonMax = 3
};
+enum class AutoplayCrossOriginExperimentMetric {
whywhat 2016/11/29 21:42:04 nit: I think we could avoid having experiment and
Zhiqiang Zhang (Slow) 2016/11/30 17:30:52 Done.
+ AutoplayAllowed,
+ AutoplayBlocked,
+ PlayedWithGesture,
+};
+
class Document;
class ElementVisibilityObserver;
class HTMLMediaElement;
@@ -50,6 +58,7 @@ class AutoplayUmaHelper final : public EventListener {
void onAutoplayInitiated(AutoplaySource);
+ void recordCrossOriginExperimentMetric(AutoplayCrossOriginExperimentMetric);
void recordAutoplayUnmuteStatus(AutoplayUnmuteActionStatus);
void didMoveToNewDocument(Document& oldDocument);
@@ -108,6 +117,9 @@ class AutoplayUmaHelper final : public EventListener {
// Whether an autoplaying muted video is visible.
bool m_isVisible;
+ std::set<AutoplayCrossOriginExperimentMetric>
+ m_recordedCrossOriginExperimentMetrics;
+
// 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.

Powered by Google App Engine
This is Rietveld 408576698