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

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: identical to PS4 on 1329853004 (probably rebased) 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)
esprehn 2015/10/01 07:04:15 reference
liberato (no reviews please) 2015/10/01 22:49:03 done, though the vector must still be LayoutMedia*
+{
+ if (!m_mediaForPositionNotification.contains(media))
+ m_mediaForPositionNotification.append(media);
+}
+
+void LayoutView::unregisterMediaForPositionChangeNotification(LayoutMedia* media)
esprehn 2015/10/01 07:04:15 reference
liberato (no reviews please) 2015/10/01 22:49:03 ditto.
+{
+ size_t at = m_mediaForPositionNotification.find(media);
+ if (at != kNotFound)
+ m_mediaForPositionNotification.remove(at);
+}
+
+void LayoutView::sendMediaPositionChangeNotifications()
+{
+ for (auto& media : m_mediaForPositionNotification) {
+ media->notifyPositionMayHaveChanged();
esprehn 2015/10/01 07:04:15 This isn't really the same timing as intersection
liberato (no reviews please) 2015/10/01 22:49:03 One of the objections to a prior iteration of this
+ }
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698