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

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

Issue 2173353002: Simplify ElementVisibilityObserver implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adjust visibility Created 4 years, 5 months 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/HTMLMediaElement.h
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.h b/third_party/WebKit/Source/core/html/HTMLMediaElement.h
index 2505616af94ea7ca993426a45f40c022475b1f5b..72d6c1d066549d9349c4c8f913fde74ca1bdc3d7 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.h
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.h
@@ -30,6 +30,7 @@
#include "bindings/core/v8/ScriptPromise.h"
#include "core/CoreExport.h"
#include "core/dom/ActiveDOMObject.h"
+#include "core/dom/ElementVisibilityObserver.h"
#include "core/dom/ExceptionCode.h"
#include "core/events/GenericEventQueue.h"
#include "core/html/AutoplayExperimentHelper.h"
@@ -70,7 +71,7 @@ class WebInbandTextTrack;
class WebLayer;
class WebRemotePlaybackClient;
-class CORE_EXPORT HTMLMediaElement : public HTMLElement, public Supplementable<HTMLMediaElement>, public ActiveScriptWrappable, public ActiveDOMObject, private WebMediaPlayerClient {
+class CORE_EXPORT HTMLMediaElement : public HTMLElement, public Supplementable<HTMLMediaElement>, public ActiveScriptWrappable, public ActiveDOMObject, private WebMediaPlayerClient, private ElementVisibilityObserver::Client {
DEFINE_WRAPPERTYPEINFO();
USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElement);
USING_PRE_FINALIZER(HTMLMediaElement, dispose);
@@ -502,7 +503,9 @@ private:
void recordAutoplaySourceMetric(int source);
void recordAutoplayUnmuteStatus(AutoplayUnmuteActionStatus);
- void onVisibilityChangedForAutoplay(bool isVisible);
+ // ElementVisibilityObserver::Client implementation
+ void onVisibilityChanged(bool isVisible) override;
+ ExecutionContext* getElementVisibilityExecutionContext() const override { return getExecutionContext(); }
UnthrottledTimer<HTMLMediaElement> m_loadTimer;
UnthrottledTimer<HTMLMediaElement> m_progressEventTimer;
« no previous file with comments | « third_party/WebKit/Source/core/dom/IntersectionObserver.h ('k') | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698