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/frame/FrameView.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/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 2deec3bb175e6b96f626dcea17993d05e0034530..8e5a9be6d0cfbd939881e1cbf14a6d8c67e4bc10 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -1092,6 +1092,28 @@ void FrameView::invalidateTreeIfNeeded(PaintInvalidationState& paintInvalidation
m_doFullPaintInvalidation = false;
lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean);
+
+ // Temporary callback for crbug.com/487345,402044
+ // TODO(ojan): Make this more general to be used by PositionObserver
+ // and rAF throttling.
+ IntRect visibleRect = rootFrameToContents(computeVisibleArea());
+ rootForPaintInvalidation.sendMediaPositionChangeNotifications(visibleRect);
+}
+
+IntRect FrameView::computeVisibleArea()
+{
+ // Return our clipping bounds in the root frame.
+ IntRect us(frameRect());
+ if (FrameView* parent = parentFrameView()) {
+ us = parent->contentsToRootFrame(us);
+ IntRect parentRect = parent->computeVisibleArea();
+ if (parentRect.isEmpty())
+ return IntRect();
+
+ us.intersect(parentRect);
+ }
+
+ return us;
}
DocumentLifecycle& FrameView::lifecycle() const
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/html/AutoplayExperimentConfig.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698