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

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

Issue 335963002: Change LayoutState to be stack-allocated (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 6 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
« no previous file with comments | « no previous file | Source/core/rendering/LayoutState.h » ('j') | Source/core/rendering/LayoutState.h » ('J')
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 060b1587d439f485b2557b0e3d6b4e93227b9769..9d4013f04454791abf07828416e8f9d4f230214e 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -104,33 +104,6 @@ static RenderLayer::UpdateLayerPositionsFlags updateLayerPositionFlags(RenderLay
return flags;
}
-class FrameViewLayoutStateMaintainer {
- WTF_MAKE_NONCOPYABLE(FrameViewLayoutStateMaintainer);
-public:
- FrameViewLayoutStateMaintainer(RenderObject& root, bool inSubtreeLayout)
- : m_view(*root.view())
- , m_inSubtreeLayout(inSubtreeLayout)
- , m_disabled(inSubtreeLayout && m_view.shouldDisableLayoutStateForSubtree(root))
- {
- if (m_inSubtreeLayout)
- m_view.pushLayoutState(root);
- if (m_disabled)
- m_view.disableLayoutState();
- }
-
- ~FrameViewLayoutStateMaintainer()
- {
- if (m_disabled)
- m_view.enableLayoutState();
- if (m_inSubtreeLayout)
- m_view.popLayoutState();
- }
-private:
- RenderView& m_view;
- bool m_inSubtreeLayout;
- bool m_disabled;
-};
-
FrameView::FrameView(LocalFrame* frame)
: m_frame(frame)
, m_canHaveScrollbars(true)
@@ -792,7 +765,8 @@ void FrameView::performLayout(RenderObject* rootForThisLayout, bool inSubtreeLay
// FIXME: The 300 other lines in layout() probably belong in other helper functions
// so that a single human could understand what layout() is actually doing.
- FrameViewLayoutStateMaintainer statePusher(*rootForThisLayout, inSubtreeLayout);
+ LayoutState layoutState(*rootForThisLayout);
+
forceLayoutParentViewIfNeeded();
// FIXME (crbug.com/256657): Do not do two layouts for text autosizing.
@@ -1042,7 +1016,7 @@ void FrameView::invalidateTree(RenderObject* root)
// Until those states are fully fledged, I'll just disable the ASSERTS.
DisableCompositingQueryAsserts compositingQueryAssertsDisabler;
- RootLayoutStateScope rootLayoutStateScope(*root);
+ LayoutState rootLayoutStateScope(*root);
esprehn 2014/06/14 03:08:26 rootLayoutState
root->invalidateTreeAfterLayout(*root->containerForPaintInvalidation());
« no previous file with comments | « no previous file | Source/core/rendering/LayoutState.h » ('j') | Source/core/rendering/LayoutState.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698