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

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

Issue 145663012: Remove the layout timer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updateLayout Created 6 years, 10 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
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/html/HTMLPlugInElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 7e36f9e5f3dc84acc5367a2e73adb07ca8f705d8..6fbb16e0d01bddf93e854a636b9dbb6e7ca13be1 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -137,7 +137,7 @@ FrameView::FrameView(Frame* frame)
: m_frame(frame)
, m_canHaveScrollbars(true)
, m_slowRepaintObjectCount(0)
- , m_layoutTimer(this, &FrameView::layoutTimerFired)
+ , m_hasPendingLayout(false)
, m_layoutSubtreeRoot(0)
, m_inSynchronousPostLayout(false)
, m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired)
@@ -221,7 +221,7 @@ void FrameView::reset()
m_cannotBlitToWindow = false;
m_isOverlapped = false;
m_contentIsOpaque = false;
- m_layoutTimer.stop();
+ m_hasPendingLayout = false;
m_layoutSubtreeRoot = 0;
m_delayedLayout = false;
m_doFullRepaint = true;
@@ -909,7 +909,7 @@ void FrameView::layout(bool allowSubtree)
// Every scroll that happens during layout is programmatic.
TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, true);
- m_layoutTimer.stop();
+ m_hasPendingLayout = false;
m_delayedLayout = false;
// we shouldn't enter layout() while painting
@@ -1791,11 +1791,6 @@ void FrameView::handleLoadCompleted()
autoSizeIfEnabled();
}
-void FrameView::layoutTimerFired(Timer<FrameView>*)
-{
- layout();
-}
-
void FrameView::scheduleRelayout()
{
ASSERT(m_frame->view() == this);
@@ -1813,13 +1808,14 @@ void FrameView::scheduleRelayout()
InspectorInstrumentation::didInvalidateLayout(m_frame.get());
int delay = m_frame->document()->minimumLayoutDelay();
- if (m_layoutTimer.isActive() && m_delayedLayout && !delay)
+ if (m_hasPendingLayout && m_delayedLayout && !delay)
unscheduleRelayout();
- if (m_layoutTimer.isActive())
+ if (m_hasPendingLayout)
return;
m_delayedLayout = delay != 0;
- m_layoutTimer.startOneShot(delay * 0.001);
+ m_hasPendingLayout = true;
+ scheduleAnimation();
}
static bool isObjectAncestorContainerOf(RenderObject* ancestor, RenderObject* descendant)
@@ -1869,13 +1865,14 @@ void FrameView::scheduleRelayoutOfSubtree(RenderObject* relayoutRoot)
ASSERT(!m_layoutSubtreeRoot->container() || !m_layoutSubtreeRoot->container()->needsLayout());
InspectorInstrumentation::didInvalidateLayout(m_frame.get());
m_delayedLayout = delay != 0;
- m_layoutTimer.startOneShot(delay * 0.001);
+ m_hasPendingLayout = true;
+ scheduleAnimation();
}
}
bool FrameView::layoutPending() const
{
- return m_layoutTimer.isActive();
+ return m_hasPendingLayout;
}
bool FrameView::needsLayout() const
@@ -1898,10 +1895,10 @@ void FrameView::setNeedsLayout()
void FrameView::unscheduleRelayout()
{
- if (!m_layoutTimer.isActive())
+ if (!m_hasPendingLayout)
return;
- m_layoutTimer.stop();
+ m_hasPendingLayout = false;
m_delayedLayout = false;
}
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/html/HTMLPlugInElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698