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

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

Issue 1329853004: Include viewport visibility checks for autoplay experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@autoplay_step1
Patch Set: Rebased onto merged blink repo. Created 5 years, 3 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/layout/LayoutView.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp
index aa3ccf3f2599d681445a8a682a191d7b98273321..abb0c2cd2e5c0f779882692664a1c00481c8ef37 100644
--- a/third_party/WebKit/Source/core/layout/LayoutView.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp
@@ -28,10 +28,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"
@@ -954,4 +956,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()
+{
+ for (auto& media : m_mediaForPositionNotification) {
+ media->notifyPositionMayHaveChanged();
+ }
+}
+
} // 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