Commit a3516ab6 authored by Navid Zolghadr's avatar Navid Zolghadr Committed by Commit Bot

Move LayoutBoxRareData to Oilpan

https://docs.google.com/document/d/1AJ1XCtiYbaw64KhPX_a_TiNDOqeYV-MO30I1C-8VzPk/edit#heading=h.p9sgjwxtsd3c

Change-Id: Ic3a1ae8c3cc4a0f473c3309e2ef0de47db40bf6f
Bug: 1030176
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1974727Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Navid Zolghadr <nzolghadr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726273}
parent 52dc379f
......@@ -108,7 +108,8 @@ struct SameSizeAsLayoutBox : public LayoutBoxModelObject {
LayoutUnit intrinsic_content_logical_height;
LayoutRectOutsets margin_box_outsets;
LayoutUnit preferred_logical_width[2];
void* pointers[5];
void* pointers[4];
Persistent<void*> rare_data;
};
static_assert(sizeof(LayoutBox) == sizeof(SameSizeAsLayoutBox),
......@@ -135,6 +136,10 @@ LayoutBoxRareData::LayoutBoxRareData()
snap_container_(nullptr),
snap_areas_(nullptr) {}
void LayoutBoxRareData::Trace(Visitor* visitor) {
visitor->Trace(layout_child_);
}
LayoutBox::LayoutBox(ContainerNode* node)
: LayoutBoxModelObject(node),
intrinsic_content_logical_height_(-1),
......
......@@ -66,12 +66,12 @@ enum ShouldComputePreferred { kComputeActual, kComputePreferred };
using SnapAreaSet = HashSet<LayoutBox*>;
struct LayoutBoxRareData {
USING_FAST_MALLOC(LayoutBoxRareData);
struct LayoutBoxRareData final : public GarbageCollected<LayoutBoxRareData> {
public:
LayoutBoxRareData();
void Trace(Visitor* visitor);
// For spanners, the spanner placeholder that lays us out within the multicol
// container.
LayoutMultiColumnSpannerPlaceholder* spanner_placeholder_;
......@@ -115,7 +115,7 @@ struct LayoutBoxRareData {
// Used by CSSLayoutDefinition::Instance::Layout. Represents the script
// object for this box that web developers can query style, and perform
// layout upon. Only created if IsCustomItem() is true.
Persistent<CustomLayoutChild> layout_child_;
Member<CustomLayoutChild> layout_child_;
DISALLOW_COPY_AND_ASSIGN(LayoutBoxRareData);
};
......@@ -1768,8 +1768,8 @@ class CORE_EXPORT LayoutBox : public LayoutBoxModelObject {
LayoutBoxRareData& EnsureRareData() {
if (!rare_data_)
rare_data_ = std::make_unique<LayoutBoxRareData>();
return *rare_data_.get();
rare_data_ = MakeGarbageCollected<LayoutBoxRareData>();
return *rare_data_.Get();
}
bool LogicalHeightComputesAsNone(SizeType) const;
......@@ -1894,7 +1894,7 @@ class CORE_EXPORT LayoutBox : public LayoutBoxModelObject {
wtf_size_t first_fragment_item_index_;
};
std::unique_ptr<LayoutBoxRareData> rare_data_;
Persistent<LayoutBoxRareData> rare_data_;
scoped_refptr<const NGLayoutResult> cached_layout_result_;
};
......
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