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

Move LayoutBlockFlowRareData to Oilpan

Change-Id: I2ed7bec198b96a5533770da9987176205478bd69
Bug: 1030176
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1980521Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Commit-Queue: Navid Zolghadr <nzolghadr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728402}
parent 209ad984
......@@ -77,7 +77,8 @@ bool LayoutBlockFlow::can_propagate_float_into_sibling_ = false;
struct SameSizeAsLayoutBlockFlow : public LayoutBlock {
LineBoxList line_boxes;
void* pointers[2];
void* pointers[1];
Persistent<void*> persistent[1];
};
static_assert(sizeof(LayoutBlockFlow) == sizeof(SameSizeAsLayoutBlockFlow),
......@@ -2241,7 +2242,7 @@ void LayoutBlockFlow::SetMaxMarginBeforeValues(LayoutUnit pos, LayoutUnit neg) {
if (pos == LayoutBlockFlowRareData::PositiveMarginBeforeDefault(this) &&
neg == LayoutBlockFlowRareData::NegativeMarginBeforeDefault(this))
return;
rare_data_ = std::make_unique<LayoutBlockFlowRareData>(this);
rare_data_ = MakeGarbageCollected<LayoutBlockFlowRareData>(this);
}
rare_data_->margins_.SetPositiveMarginBefore(pos);
rare_data_->margins_.SetNegativeMarginBefore(neg);
......@@ -2252,7 +2253,7 @@ void LayoutBlockFlow::SetMaxMarginAfterValues(LayoutUnit pos, LayoutUnit neg) {
if (pos == LayoutBlockFlowRareData::PositiveMarginAfterDefault(this) &&
neg == LayoutBlockFlowRareData::NegativeMarginAfterDefault(this))
return;
rare_data_ = std::make_unique<LayoutBlockFlowRareData>(this);
rare_data_ = MakeGarbageCollected<LayoutBlockFlowRareData>(this);
}
rare_data_->margins_.SetPositiveMarginAfter(pos);
rare_data_->margins_.SetNegativeMarginAfter(neg);
......@@ -4193,7 +4194,7 @@ void LayoutBlockFlow::SetPaginationStrutPropagatedFromChild(LayoutUnit strut) {
if (!rare_data_) {
if (!strut)
return;
rare_data_ = std::make_unique<LayoutBlockFlowRareData>(this);
rare_data_ = MakeGarbageCollected<LayoutBlockFlowRareData>(this);
}
rare_data_->pagination_strut_propagated_from_child_ = strut;
}
......@@ -4202,7 +4203,7 @@ void LayoutBlockFlow::SetFirstForcedBreakOffset(LayoutUnit block_offset) {
if (!rare_data_) {
if (!block_offset)
return;
rare_data_ = std::make_unique<LayoutBlockFlowRareData>(this);
rare_data_ = MakeGarbageCollected<LayoutBlockFlowRareData>(this);
}
rare_data_->first_forced_break_offset_ = block_offset;
}
......@@ -4317,7 +4318,7 @@ LayoutBlockFlow::LayoutBlockFlowRareData& LayoutBlockFlow::EnsureRareData() {
if (rare_data_)
return *rare_data_;
rare_data_ = std::make_unique<LayoutBlockFlowRareData>(this);
rare_data_ = MakeGarbageCollected<LayoutBlockFlowRareData>(this);
return *rare_data_;
}
......
......@@ -733,9 +733,8 @@ class CORE_EXPORT LayoutBlockFlow : public LayoutBlock {
MarginValues MarginValuesForChild(LayoutBox& child) const;
// Allocated only when some of these fields have non-default values
struct LayoutBlockFlowRareData {
USING_FAST_MALLOC(LayoutBlockFlowRareData);
struct LayoutBlockFlowRareData final
: public GarbageCollected<LayoutBlockFlowRareData> {
public:
explicit LayoutBlockFlowRareData(const LayoutBlockFlow* block);
~LayoutBlockFlowRareData();
......@@ -755,6 +754,8 @@ class CORE_EXPORT LayoutBlockFlow : public LayoutBlock {
return (-block->MarginAfter()).ClampNegativeToZero();
}
void Trace(Visitor*) {}
MarginValues margins_;
LayoutUnit pagination_strut_propagated_from_child_;
......@@ -911,7 +912,7 @@ class CORE_EXPORT LayoutBlockFlow : public LayoutBlock {
bool CheckIfIsSelfCollapsingBlock() const;
protected:
std::unique_ptr<LayoutBlockFlowRareData> rare_data_;
Persistent<LayoutBlockFlowRareData> rare_data_;
std::unique_ptr<FloatingObjects> floating_objects_;
friend class MarginInfo;
......
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