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

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

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.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.h b/third_party/WebKit/Source/core/layout/LayoutView.h
index e43417f7256b63f73e7e389f8df51b3baaf47dd5..ce1a1c41b2761644ddd4d9d28169897918877093 100644
--- a/third_party/WebKit/Source/core/layout/LayoutView.h
+++ b/third_party/WebKit/Source/core/layout/LayoutView.h
@@ -39,6 +39,7 @@ namespace blink {
class FrameView;
class PaintLayerCompositor;
class LayoutQuote;
+class LayoutMedia;
// LayoutView is the root of the layout tree and the Document's LayoutObject.
//
@@ -199,6 +200,16 @@ public:
// TODO(skobes): This is not quite the ideal behavior, see http://crbug.com/250514 and http://crbug.com/249860.
bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const override { return false; }
+ // Some LayoutMedias want to know about their viewport visibility for
+ // crbug.com/487345,402044 . This facility will be removed once those
+ // experiments complete.
+ // TODO(ojan): Merge this with IntersectionObserver once it lands.
+ void registerMediaForPositionChangeNotification(LayoutMedia&);
+ void unregisterMediaForPositionChangeNotification(LayoutMedia&);
+ // Notify all registered LayoutMedias that their position on-screen might
+ // have changed. visibleRect is the clipping boundary.
+ void sendMediaPositionChangeNotifications(const IntRect& visibleRect);
+
private:
void mapLocalToContainer(const LayoutBoxModelObject* paintInvalidationContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = nullptr, const PaintInvalidationState* = nullptr) const override;
@@ -261,6 +272,8 @@ private:
unsigned m_hitTestCount;
unsigned m_hitTestCacheHits;
OwnPtrWillBePersistent<HitTestCache> m_hitTestCache;
+
+ Vector<LayoutMedia*> m_mediaForPositionNotification;
};
DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutView, isLayoutView());
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutVideo.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698