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