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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2023033003: scheduler: Throttle timers in out-of-view frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests Created 4 years, 6 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/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 92177225f6e30dbaa865f5197f386664f36000e4..08d9e245e19cc96f78da23ad67914bd5994501f9 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -4121,7 +4121,7 @@ void FrameView::updateViewportIntersectionsForSubtree(LifeCycleUpdateOption phas
// Adjust render throttling for iframes based on visibility
bool shouldNotify = !hadValidIntersection || hadEmptyIntersection != m_viewportIntersection.isEmpty();
if (shouldNotify && !m_renderThrottlingObserverNotificationFactory->isPending())
- m_frame->frameScheduler()->timerTaskRunner()->postTask(BLINK_FROM_HERE, m_renderThrottlingObserverNotificationFactory->cancelAndCreate());
+ m_frame->frameScheduler()->defaultTaskRunner()->postTask(BLINK_FROM_HERE, m_renderThrottlingObserverNotificationFactory->cancelAndCreate());
if (!m_needsUpdateViewportIntersectionInSubtree)
return;
@@ -4139,6 +4139,7 @@ void FrameView::updateThrottlingStatus()
{
// Only offscreen frames can be throttled.
m_hiddenForThrottling = m_viewportIntersectionValid && m_viewportIntersection.isEmpty();
+ m_frame->frameScheduler()->setFrameVisible(!m_hiddenForThrottling);
// We only throttle the rendering pipeline in cross-origin frames. This is
// to avoid a situation where an ancestor frame directly depends on the
@@ -4159,6 +4160,7 @@ void FrameView::updateThrottlingStatus()
if (parentFrame->isLocalFrame() && toLocalFrame(parentFrame)->view() && toLocalFrame(parentFrame)->view()->canThrottleRendering())
m_subtreeThrottled = true;
}
+ m_frame->frameScheduler()->setCrossOrigin(m_crossOriginForThrottling);
}
void FrameView::notifyRenderThrottlingObserversForTesting()

Powered by Google App Engine
This is Rietveld 408576698