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

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

Issue 2676533003: [LayoutNG] Convert physical fragments to being RefCounted. (Closed)
Patch Set: address comments. Created 3 years, 10 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_physical_fragment.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.cc b/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.cc
index 147049b9e4c616c35a2669af5bc216fd6106df08..b0491072de14b24adf55512075d5a8cfe33f2da9 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.cc
@@ -15,10 +15,11 @@ NGPhysicalFragment::NGPhysicalFragment(
NGPhysicalSize size,
NGPhysicalSize overflow,
NGFragmentType type,
- HeapLinkedHashSet<WeakMember<NGBlockNode>>& out_of_flow_descendants,
+ PersistentHeapLinkedHashSet<WeakMember<NGBlockNode>>&
+ out_of_flow_descendants,
Vector<NGStaticPosition> out_of_flow_positions,
- HeapVector<Member<NGFloatingObject>>& unpositioned_floats,
- HeapVector<Member<NGFloatingObject>>& positioned_floats,
+ Vector<Persistent<NGFloatingObject>>& unpositioned_floats,
+ Vector<Persistent<NGFloatingObject>>& positioned_floats,
NGBreakToken* break_token)
: layout_object_(layout_object),
size_(size),
@@ -32,25 +33,11 @@ NGPhysicalFragment::NGPhysicalFragment(
positioned_floats_.swap(positioned_floats);
}
-DEFINE_TRACE(NGPhysicalFragment) {
+void NGPhysicalFragment::destroy() const {
if (Type() == kFragmentText)
- static_cast<NGPhysicalTextFragment*>(this)->traceAfterDispatch(visitor);
+ delete static_cast<const NGPhysicalTextFragment*>(this);
else
- static_cast<NGPhysicalBoxFragment*>(this)->traceAfterDispatch(visitor);
-}
-
-void NGPhysicalFragment::finalizeGarbageCollectedObject() {
- if (Type() == kFragmentText)
- static_cast<NGPhysicalTextFragment*>(this)->~NGPhysicalTextFragment();
- else
- static_cast<NGPhysicalBoxFragment*>(this)->~NGPhysicalBoxFragment();
-}
-
-DEFINE_TRACE_AFTER_DISPATCH(NGPhysicalFragment) {
- visitor->trace(out_of_flow_descendants_);
- visitor->trace(break_token_);
- visitor->trace(unpositioned_floats_);
- visitor->trace(positioned_floats_);
+ delete static_cast<const NGPhysicalBoxFragment*>(this);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698