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 edfca0b8d490f2fa15796a60997b9947d360f61d..6ce1f921d995d99c71e3d83b94fb50c63950587c 100644 |
| --- a/third_party/WebKit/Source/core/html/AutoplayUmaHelper.h |
| +++ b/third_party/WebKit/Source/core/html/AutoplayUmaHelper.h |
| @@ -43,8 +43,6 @@ public: |
| void recordAutoplayUnmuteStatus(AutoplayUnmuteActionStatus); |
| - void onVisibilityChangedForVideoMutedPlayMethod(bool isVisible); |
| - |
| void didMoveToNewDocument(Document& oldDocument); |
| DECLARE_VIRTUAL_TRACE(); |
| @@ -55,14 +53,46 @@ private: |
| void handleEvent(ExecutionContext*, Event*) override; |
| void handlePlayingEvent(); |
| + void handlePauseEvent(); |
| void handleUnloadEvent(); |
| + void maybeUnregisterUnloadListener(); |
| + |
| + void maybeStartRecordingMutedVideoPlayMethodBecomeVisible(); |
| + void maybeStopRecordingMutedVideoPlayMethodBecomeVisible(bool isVisible); |
| + |
| + void maybeStartRecordingMutedVideoOffscreenDuration(); |
| + void maybeStopRecordingMutedVideoOffscreenDuration(); |
| + |
| + void onVisibilityChangedForMutedVideoOffscreenDuration(bool isVisibile); |
| + void onVisibilityChangedForMutedVideoPlayMethodBecomeVisible(bool isVisible); |
| + |
| + bool shouldListenToUnloadEvent() const; |
| + |
| // The autoplay source. Use AutoplaySource::NumberOfSources for invalid source. |
| AutoplaySource m_source; |
| // The media element this UMA helper is attached to. |m_element| owns |this|. |
| WeakMember<HTMLMediaElement> m_element; |
| - // The observer is used to observe whether a muted video autoplaying by play() method become visible at some point. |
| - Member<ElementVisibilityObserver> m_videoMutedPlayMethodVisibilityObserver; |
| + |
| + // The observer is used to observe whether a muted video autoplaying by play() |
| + // method become visible at some point. |
| + // The UMA is pending for recording as long as this observer is non-null. |
| + Member<ElementVisibilityObserver> m_mutedVideoPlayMethodVisibilityObserver; |
| + |
| + // Variables used for recording the duration of autoplay muted video playing offscreen. |
| + // The variables are valid when |m_autoplayOffscrenVisibilityObserver| is non-null. |
| + // The recording stops whenever the playback pauses or the page is unloaded. |
| + |
| + // The starting time of autoplaying muted video. |
| + double m_mutedVideoAutoplayStartTimeMS; |
|
mlamouri (slow - plz ping)
2016/08/17 19:27:15
Should this be specific to not visible playback?
Zhiqiang Zhang (Slow)
2016/08/18 10:52:43
Done.
|
| + // The duration an autoplaying muted video has been in offscreen. |
| + double m_mutedVideoAutoplayOffscreenDurationMS; |
| + // Whether an autoplaying muted video is visible. |
| + bool m_isVisible; |
| + // The observer is used to whether a autoplaying video autoplaying changes it's visibility, |
|
mlamouri (slow - plz ping)
2016/08/17 19:27:15
nit: "used to whether" -- a word is missing maybe?
Zhiqiang Zhang (Slow)
2016/08/18 10:52:43
Done.
|
| + // which is used for offscreen duration UMA. |
| + // The UMA is pending for recording as long as this observer is non-null. |
| + Member<ElementVisibilityObserver> m_mutedVideoOffscreenDurationVisibilityObserver; |
| }; |
| } // namespace blink |