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

Unified Diff: Source/core/rendering/RenderView.cpp

Issue 196533012: Make LayoutState always be RAII (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated to ToT Created 6 years, 9 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/rendering/RenderView.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderView.cpp
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp
index 8f43eaf3883078874dc0b71d86c4e88914d47460..9f98e8d92ecf23e9d19647615bcfc23b1739a586 100644
--- a/Source/core/rendering/RenderView.cpp
+++ b/Source/core/rendering/RenderView.cpp
@@ -161,7 +161,7 @@ void RenderView::positionDialogs()
}
}
-void RenderView::layoutContent(const LayoutState& state)
+void RenderView::layoutContent()
{
ASSERT(needsLayout());
@@ -172,27 +172,27 @@ void RenderView::layoutContent(const LayoutState& state)
positionDialogs();
#ifndef NDEBUG
- checkLayoutState(state);
+ checkLayoutState();
#endif
}
#ifndef NDEBUG
-void RenderView::checkLayoutState(const LayoutState& state)
+void RenderView::checkLayoutState()
{
if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) {
ASSERT(layoutDeltaMatches(LayoutSize()));
}
ASSERT(!m_layoutStateDisableCount);
- ASSERT(m_layoutState == &state);
+ ASSERT(!m_layoutState->m_next);
}
#endif
-void RenderView::initializeLayoutState(LayoutState& state)
+void RootLayoutStateScope::initializeLayoutState()
{
- state.m_clipped = false;
- state.m_pageLogicalHeight = m_pageLogicalHeight;
- state.m_pageLogicalHeightChanged = m_pageLogicalHeightChanged;
- state.m_isPaginated = state.m_pageLogicalHeight;
+ m_rootLayoutState.m_clipped = false;
+ m_rootLayoutState.m_pageLogicalHeight = m_view.m_pageLogicalHeight;
+ m_rootLayoutState.m_pageLogicalHeightChanged = m_view.m_pageLogicalHeightChanged;
+ m_rootLayoutState.m_isPaginated = m_rootLayoutState.m_pageLogicalHeight;
}
void RenderView::layout()
@@ -228,18 +228,15 @@ void RenderView::layout()
if (!needsLayout())
return;
- LayoutState state;
- initializeLayoutState(state);
+ RootLayoutStateScope rootLayoutStateScope(*this);
m_pageLogicalHeightChanged = false;
- m_layoutState = &state;
- layoutContent(state);
+ layoutContent();
#ifndef NDEBUG
- checkLayoutState(state);
+ checkLayoutState();
#endif
- m_layoutState = 0;
clearNeedsLayout();
}
« no previous file with comments | « Source/core/rendering/RenderView.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698