Commit 6df6a546 authored by Aleks Totic's avatar Aleks Totic Committed by Commit Bot

[LayoutNG] avoid some memcpy's

While stepping throught the code, I've noticed that AddOutOfFlowDescendant
was doing a memcpy.

Change-Id: I97fd39e91656dc31a26ae744780ded3ca4ee9be6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1663184
Auto-Submit: Aleks Totic <atotic@chromium.org>
Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#670225}
parent 0e19d2f2
......@@ -202,7 +202,7 @@ NGContainerFragmentBuilder::AddOutOfFlowChildCandidate(
}
NGContainerFragmentBuilder& NGContainerFragmentBuilder::AddOutOfFlowDescendant(
NGOutOfFlowPositionedDescendant descendant) {
const NGOutOfFlowPositionedDescendant& descendant) {
oof_positioned_descendants_.push_back(descendant);
return *this;
}
......
......@@ -136,7 +136,7 @@ class CORE_EXPORT NGContainerFragmentBuilder : public NGFragmentBuilder {
base::Optional<TextDirection> container_direction = base::nullopt);
NGContainerFragmentBuilder& AddOutOfFlowDescendant(
NGOutOfFlowPositionedDescendant descendant);
const NGOutOfFlowPositionedDescendant& descendant);
void GetAndClearOutOfFlowDescendantCandidates(
Vector<NGOutOfFlowPositionedDescendant>* descendant_candidates,
......@@ -217,8 +217,9 @@ class CORE_EXPORT NGContainerFragmentBuilder : public NGFragmentBuilder {
NGOutOfFlowPositionedDescendant descendant;
LogicalOffset child_offset; // Logical offset of child's top left vertex.
NGOutOfFlowPositionedCandidate(NGOutOfFlowPositionedDescendant descendant,
LogicalOffset child_offset)
NGOutOfFlowPositionedCandidate(
const NGOutOfFlowPositionedDescendant& descendant,
LogicalOffset child_offset)
: descendant(descendant), child_offset(child_offset) {}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment