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

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

Issue 2752123002: [LayoutNG] Move NGFloatingObject off Oilpan (Closed)
Patch Set: more comments Created 3 years, 9 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_fragment_builder.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc
index cabf376d5f97b497efb1cfb7f51d2f62a435872e..7348e7eafef395d96fd3c677172ae6fa200444a3 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc
@@ -91,7 +91,7 @@ NGFragmentBuilder& NGFragmentBuilder::AddChild(
}
NGFragmentBuilder& NGFragmentBuilder::AddFloatingObject(
- NGFloatingObject* floating_object,
+ RefPtr<NGFloatingObject> floating_object,
const NGLogicalOffset& floating_object_offset) {
positioned_floats_.push_back(floating_object);
floating_object_offsets_.push_back(floating_object_offset);
@@ -117,8 +117,8 @@ NGFragmentBuilder& NGFragmentBuilder::AddOutOfFlowChildCandidate(
}
NGFragmentBuilder& NGFragmentBuilder::AddUnpositionedFloat(
- NGFloatingObject* floating_object) {
- unpositioned_floats_.push_back(floating_object);
+ RefPtr<NGFloatingObject> floating_object) {
+ unpositioned_floats_.push_back(std::move(floating_object));
return *this;
}
@@ -173,9 +173,6 @@ RefPtr<NGLayoutResult> NGFragmentBuilder::ToBoxFragment() {
writing_mode_, direction_, physical_size, child->Size()));
}
- Vector<Persistent<NGFloatingObject>> positioned_floats;
- positioned_floats.reserveCapacity(positioned_floats_.size());
-
RefPtr<NGBreakToken> break_token;
if (did_break_) {
break_token = NGBlockBreakToken::create(
@@ -185,11 +182,10 @@ RefPtr<NGLayoutResult> NGFragmentBuilder::ToBoxFragment() {
}
for (size_t i = 0; i < positioned_floats_.size(); ++i) {
- Persistent<NGFloatingObject>& floating_object = positioned_floats_[i];
+ RefPtr<NGFloatingObject>& floating_object = positioned_floats_[i];
NGPhysicalFragment* floating_fragment = floating_object->fragment.get();
floating_fragment->SetOffset(floating_object_offsets_[i].ConvertToPhysical(
writing_mode_, direction_, physical_size, floating_fragment->Size()));
- positioned_floats.push_back(floating_object);
}
RefPtr<NGPhysicalBoxFragment> fragment = adoptRef(new NGPhysicalBoxFragment(
@@ -210,9 +206,6 @@ RefPtr<NGPhysicalTextFragment> NGFragmentBuilder::ToTextFragment(
DCHECK(children_.isEmpty());
DCHECK(offsets_.isEmpty());
- Vector<Persistent<NGFloatingObject>> empty_unpositioned_floats;
- Vector<Persistent<NGFloatingObject>> empty_positioned_floats;
-
return adoptRef(new NGPhysicalTextFragment(
node_->GetLayoutObject(), toNGInlineNode(node_), index, start_offset,
end_offset, size_.ConvertToPhysical(writing_mode_),

Powered by Google App Engine
This is Rietveld 408576698