Chromium Code Reviews| 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. |