| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/layout/ng/ng_physical_fragment.h" | 5 #include "core/layout/ng/ng_physical_fragment.h" |
| 6 | 6 |
| 7 #include "core/layout/ng/ng_break_token.h" | 7 #include "core/layout/ng/ng_break_token.h" |
| 8 #include "core/layout/ng/ng_physical_box_fragment.h" | 8 #include "core/layout/ng/ng_physical_box_fragment.h" |
| 9 #include "core/layout/ng/ng_physical_text_fragment.h" | 9 #include "core/layout/ng/ng_physical_text_fragment.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 NGPhysicalFragment::NGPhysicalFragment( | 13 NGPhysicalFragment::NGPhysicalFragment( |
| 14 NGPhysicalSize size, | 14 NGPhysicalSize size, |
| 15 NGPhysicalSize overflow, | 15 NGPhysicalSize overflow, |
| 16 NGFragmentType type, | 16 NGFragmentType type, |
| 17 HeapLinkedHashSet<WeakMember<NGBlockNode>>& out_of_flow_descendants, | 17 HeapLinkedHashSet<WeakMember<NGBlockNode>>& out_of_flow_descendants, |
| 18 Vector<NGStaticPosition> out_of_flow_positions, | 18 Vector<NGStaticPosition> out_of_flow_positions, |
| 19 HeapVector<Member<NGFloatingObject>>& unpositioned_floats, |
| 20 HeapVector<Member<NGFloatingObject>>& positioned_floats, |
| 19 NGBreakToken* break_token) | 21 NGBreakToken* break_token) |
| 20 : size_(size), | 22 : size_(size), |
| 21 overflow_(overflow), | 23 overflow_(overflow), |
| 22 break_token_(break_token), | 24 break_token_(break_token), |
| 23 type_(type), | 25 type_(type), |
| 24 has_been_placed_(false) { | 26 is_placed_(false) { |
| 25 out_of_flow_descendants_.swap(out_of_flow_descendants); | 27 out_of_flow_descendants_.swap(out_of_flow_descendants); |
| 26 out_of_flow_positions_.swap(out_of_flow_positions); | 28 out_of_flow_positions_.swap(out_of_flow_positions); |
| 29 unpositioned_floats_.swap(unpositioned_floats); |
| 30 positioned_floats_.swap(positioned_floats); |
| 27 } | 31 } |
| 28 | 32 |
| 29 DEFINE_TRACE(NGPhysicalFragment) { | 33 DEFINE_TRACE(NGPhysicalFragment) { |
| 30 if (Type() == kFragmentText) | 34 if (Type() == kFragmentText) |
| 31 static_cast<NGPhysicalTextFragment*>(this)->traceAfterDispatch(visitor); | 35 static_cast<NGPhysicalTextFragment*>(this)->traceAfterDispatch(visitor); |
| 32 else | 36 else |
| 33 static_cast<NGPhysicalBoxFragment*>(this)->traceAfterDispatch(visitor); | 37 static_cast<NGPhysicalBoxFragment*>(this)->traceAfterDispatch(visitor); |
| 34 } | 38 } |
| 35 | 39 |
| 36 void NGPhysicalFragment::finalizeGarbageCollectedObject() { | 40 void NGPhysicalFragment::finalizeGarbageCollectedObject() { |
| 37 if (Type() == kFragmentText) | 41 if (Type() == kFragmentText) |
| 38 static_cast<NGPhysicalTextFragment*>(this)->~NGPhysicalTextFragment(); | 42 static_cast<NGPhysicalTextFragment*>(this)->~NGPhysicalTextFragment(); |
| 39 else | 43 else |
| 40 static_cast<NGPhysicalBoxFragment*>(this)->~NGPhysicalBoxFragment(); | 44 static_cast<NGPhysicalBoxFragment*>(this)->~NGPhysicalBoxFragment(); |
| 41 } | 45 } |
| 42 | 46 |
| 43 DEFINE_TRACE_AFTER_DISPATCH(NGPhysicalFragment) { | 47 DEFINE_TRACE_AFTER_DISPATCH(NGPhysicalFragment) { |
| 44 visitor->trace(out_of_flow_descendants_); | 48 visitor->trace(out_of_flow_descendants_); |
| 45 visitor->trace(break_token_); | 49 visitor->trace(break_token_); |
| 50 visitor->trace(unpositioned_floats_); |
| 51 visitor->trace(positioned_floats_); |
| 46 } | 52 } |
| 47 | 53 |
| 48 } // namespace blink | 54 } // namespace blink |
| OLD | NEW |