Chromium Code Reviews| 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 #ifndef NGFragment_h | 5 #ifndef NGFragment_h |
| 6 #define NGFragment_h | 6 #define NGFragment_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/layout/ng/ng_fragment_base.h" | 9 #include "core/layout/ng/ng_fragment_base.h" |
| 10 #include "core/layout/ng/ng_constraint_space.h" | 10 #include "core/layout/ng/ng_constraint_space.h" |
| 11 #include "core/layout/ng/ng_units.h" | |
| 11 #include "platform/LayoutUnit.h" | 12 #include "platform/LayoutUnit.h" |
| 12 #include "platform/heap/Handle.h" | 13 #include "platform/heap/Handle.h" |
| 13 #include "wtf/Vector.h" | 14 #include "wtf/Vector.h" |
| 14 | 15 |
| 15 namespace blink { | 16 namespace blink { |
| 16 | 17 |
| 17 class CORE_EXPORT NGFragment final : public NGFragmentBase { | 18 class CORE_EXPORT NGFragment final : public NGFragmentBase { |
| 18 public: | 19 public: |
| 19 NGFragment(LayoutUnit inlineSize, | 20 NGFragment(NGLogicalSize size, |
| 20 LayoutUnit blockSize, | 21 NGLogicalSize overflow, |
| 21 LayoutUnit inlineOverflow, | |
| 22 LayoutUnit blockOverflow, | |
| 23 NGWritingMode writingMode, | 22 NGWritingMode writingMode, |
| 24 NGDirection direction) | 23 NGDirection direction) |
| 25 : NGFragmentBase(inlineSize, | 24 : NGFragmentBase(size, overflow, writingMode, direction, FragmentBox) {} |
| 26 blockSize, | |
| 27 inlineOverflow, | |
| 28 blockOverflow, | |
| 29 writingMode, | |
| 30 direction, | |
| 31 FragmentBox) {} | |
| 32 | 25 |
| 33 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { | 26 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { |
| 34 visitor->trace(m_children); | 27 visitor->trace(children_); |
| 35 NGFragmentBase::traceAfterDispatch(visitor); | 28 NGFragmentBase::traceAfterDispatch(visitor); |
| 36 } | 29 } |
| 37 | 30 |
| 38 void swapChildren(HeapVector<Member<const NGFragmentBase>>& children) { | 31 void SwapChildren(HeapVector<Member<const NGFragmentBase>>& children) { |
|
eae
2016/08/23 22:10:27
It would be great if we could move populating the
| |
| 39 m_children.swap(children); | 32 children_.swap(children); |
| 40 } | 33 } |
| 41 | 34 |
| 42 private: | 35 private: |
| 43 HeapVector<Member<const NGFragmentBase>> m_children; | 36 HeapVector<Member<const NGFragmentBase>> children_; |
| 44 }; | 37 }; |
| 45 | 38 |
| 46 } // namespace blink | 39 } // namespace blink |
| 47 | 40 |
| 48 #endif // NGFragment_h | 41 #endif // NGFragment_h |
| OLD | NEW |