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

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

Issue 2475643004: Monitor the intersection of video and viewport. (Closed)
Patch Set: Add ElementViewportRatioObserver. 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..8ed995fdf2d2d49f3dcfe13e667d6defd153c0eb 100644
--- a/third_party/WebKit/Source/core/html/AutoplayUmaHelper.h
+++ b/third_party/WebKit/Source/core/html/AutoplayUmaHelper.h
@@ -58,6 +58,8 @@ class AutoplayUmaHelper final : public EventListener {
bool hasSource() const { return m_source != AutoplaySource::NumberOfSources; }
+ void visibilityMightChangedforMutedVideo(bool isVisible);
miu 2016/11/09 22:02:08 naming: s/Might/Maybe/
xjz 2016/11/11 01:07:29 Done.
+
DECLARE_VIRTUAL_TRACE();
private:
@@ -77,9 +79,6 @@ class AutoplayUmaHelper final : public EventListener {
void maybeStartRecordingMutedVideoOffscreenDuration();
void maybeStopRecordingMutedVideoOffscreenDuration();
- void onVisibilityChangedForMutedVideoOffscreenDuration(bool isVisibile);
- void onVisibilityChangedForMutedVideoPlayMethodBecomeVisible(bool isVisible);
-
bool shouldListenToUnloadEvent() const;
// The autoplay source. Use AutoplaySource::NumberOfSources for invalid
@@ -88,10 +87,10 @@ class AutoplayUmaHelper final : public EventListener {
// The media element this UMA helper is attached to. |m_element| owns |this|.
Member<HTMLMediaElement> m_element;
- // 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;
+ // Indicates whether is observing the visibility of a muted video autoplayed
+ // from 'play()' method. The UMA is pending for recording as long as this is
+ // true.
+ bool m_isObservingVisibilityOfMutedAutoplayVideo = false;
// -----------------------------------------------------------------------
// Variables used for recording the duration of autoplay muted video playing
@@ -108,11 +107,10 @@ class AutoplayUmaHelper final : public EventListener {
// Whether an autoplaying muted video is visible.
bool m_isVisible;
- // 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.
- Member<ElementVisibilityObserver>
- m_mutedVideoOffscreenDurationVisibilityObserver;
+ // Indicates whether is observing the visibility of a muted autoplay video for
+ // offscreen duration UMA. The UMA is pending for recording as long as this
+ // is true.
+ bool m_isObservingVisibilityOfMutedVideoOffscreenDuration = false;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698