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

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

Issue 2724133003: [LayoutNG] Switch NGConstraintSpace to being RefCounted. (Closed)
Patch Set: moar. Created 3 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
Index: third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
index 07cc12d7dda721bf8a35f463c8fa819c6effbe9a..0b8ecfcf37bfd24874ee814ce52639a612b8fb0b 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
@@ -116,21 +116,21 @@ MinAndMaxContentSizes NGBlockNode::ComputeMinAndMaxContentSizes() {
return sizes;
}
- NGConstraintSpace* constraint_space =
+ RefPtr<NGConstraintSpace> constraint_space =
NGConstraintSpaceBuilder(
FromPlatformWritingMode(Style().getWritingMode()))
.SetTextDirection(Style().direction())
.ToConstraintSpace(FromPlatformWritingMode(Style().getWritingMode()));
// TODO(cbiesinger): For orthogonal children, we need to always synthesize.
- NGBlockLayoutAlgorithm minmax_algorithm(this, constraint_space);
+ NGBlockLayoutAlgorithm minmax_algorithm(this, constraint_space.get());
Optional<MinAndMaxContentSizes> maybe_sizes =
minmax_algorithm.ComputeMinAndMaxContentSizes();
if (maybe_sizes.has_value())
return *maybe_sizes;
// Have to synthesize this value.
- RefPtr<NGLayoutResult> layout_result = Layout(constraint_space);
+ RefPtr<NGLayoutResult> layout_result = Layout(constraint_space.get());
NGPhysicalFragment* physical_fragment =
layout_result->PhysicalFragment().get();
NGBoxFragment min_fragment(FromPlatformWritingMode(Style().getWritingMode()),
@@ -146,7 +146,7 @@ MinAndMaxContentSizes NGBlockNode::ComputeMinAndMaxContentSizes() {
.SetPercentageResolutionSize({LayoutUnit(), LayoutUnit()})
.ToConstraintSpace(FromPlatformWritingMode(Style().getWritingMode()));
- layout_result = Layout(constraint_space);
+ layout_result = Layout(constraint_space.get());
physical_fragment = layout_result->PhysicalFragment().get();
NGBoxFragment max_fragment(FromPlatformWritingMode(Style().getWritingMode()),
toNGPhysicalBoxFragment(physical_fragment));

Powered by Google App Engine
This is Rietveld 408576698