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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutView.cpp

Issue 1370723002: Include viewport visibility checks for autoplay experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased. Created 5 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/layout/LayoutView.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp
index 3056632e4b2a3752155b6093ba48bd3bbcd180bc..5313853971f78c318f8c62e23ac8dded92e9d190 100644
--- a/third_party/WebKit/Source/core/layout/LayoutView.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp
@@ -29,10 +29,12 @@
#include "core/frame/Settings.h"
#include "core/html/HTMLFrameOwnerElement.h"
#include "core/html/HTMLIFrameElement.h"
+#include "core/html/HTMLVideoElement.h"
#include "core/inspector/InspectorTraceEvents.h"
#include "core/layout/HitTestResult.h"
#include "core/layout/LayoutFlowThread.h"
#include "core/layout/LayoutGeometryMap.h"
+#include "core/layout/LayoutMedia.h"
#include "core/layout/LayoutPart.h"
#include "core/layout/LayoutQuote.h"
#include "core/layout/LayoutScrollbarPart.h"
@@ -947,4 +949,24 @@ void LayoutView::willBeDestroyed()
m_compositor.clear();
}
+void LayoutView::registerMediaForPositionChangeNotification(LayoutMedia& media)
+{
+ if (!m_mediaForPositionNotification.contains(&media))
+ m_mediaForPositionNotification.append(&media);
+}
+
+void LayoutView::unregisterMediaForPositionChangeNotification(LayoutMedia& media)
+{
+ size_t at = m_mediaForPositionNotification.find(&media);
+ if (at != kNotFound)
+ m_mediaForPositionNotification.remove(at);
+}
+
+void LayoutView::sendMediaPositionChangeNotifications(const IntRect& visibleRect)
+{
+ for (auto& media : m_mediaForPositionNotification) {
+ media->notifyPositionMayHaveChanged(visibleRect);
+ }
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutView.h ('k') | third_party/WebKit/Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698