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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc

Issue 2664403003: [LayoutNG] Stack allocate NGLayoutOpportunityIterator. (Closed)
Patch Set: rebase Created 3 years, 11 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 | third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
index 80c877909c1f43faad520520ecb33c2e8f2a44a0..8aae66ee05dfdd52563b6002f1d539bc1fdaf49a 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
@@ -131,10 +131,9 @@ const NGLayoutOpportunity FindLayoutOpportunityForFragment(
NGLogicalOffset adjusted_origin_point =
AdjustToTopEdgeAlignmentRule(*space, origin_point);
- NGLayoutOpportunityIterator* opportunity_iter =
- space->LayoutOpportunities(adjusted_origin_point);
+ NGLayoutOpportunityIterator opportunity_iter(space, adjusted_origin_point);
NGLayoutOpportunity opportunity;
- NGLayoutOpportunity opportunity_candidate = opportunity_iter->Next();
+ NGLayoutOpportunity opportunity_candidate = opportunity_iter.Next();
while (!opportunity_candidate.IsEmpty()) {
opportunity = opportunity_candidate;
@@ -143,7 +142,8 @@ const NGLayoutOpportunity FindLayoutOpportunityForFragment(
auto fragment_inline_size = fragment.InlineSize() + margins.InlineSum();
if (opportunity.size.inline_size >= fragment_inline_size)
break;
- opportunity_candidate = opportunity_iter->Next();
+
+ opportunity_candidate = opportunity_iter.Next();
}
return opportunity;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698