OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 template <typename NodeType> | 43 template <typename NodeType> |
44 class StaticNodeTypeList final : public NodeList { | 44 class StaticNodeTypeList final : public NodeList { |
45 public: | 45 public: |
46 static PassRefPtrWillBeRawPtr<StaticNodeTypeList> adopt(WillBeHeapVector<Ref
PtrWillBeMember<NodeType>>& nodes); | 46 static PassRefPtrWillBeRawPtr<StaticNodeTypeList> adopt(WillBeHeapVector<Ref
PtrWillBeMember<NodeType>>& nodes); |
47 | 47 |
48 static PassRefPtrWillBeRawPtr<StaticNodeTypeList> createEmpty() | 48 static PassRefPtrWillBeRawPtr<StaticNodeTypeList> createEmpty() |
49 { | 49 { |
50 return adoptRefWillBeNoop(new StaticNodeTypeList); | 50 return adoptRefWillBeNoop(new StaticNodeTypeList); |
51 } | 51 } |
52 | 52 |
53 virtual ~StaticNodeTypeList(); | 53 ~StaticNodeTypeList() override; |
54 | 54 |
55 virtual unsigned length() const override; | 55 unsigned length() const override; |
56 virtual NodeType* item(unsigned index) const override; | 56 NodeType* item(unsigned index) const override; |
57 | 57 |
58 DECLARE_VIRTUAL_TRACE(); | 58 DECLARE_VIRTUAL_TRACE(); |
59 | 59 |
60 private: | 60 private: |
61 ptrdiff_t AllocationSize() | 61 ptrdiff_t AllocationSize() |
62 { | 62 { |
63 return m_nodes.capacity() * sizeof(RefPtrWillBeMember<NodeType>); | 63 return m_nodes.capacity() * sizeof(RefPtrWillBeMember<NodeType>); |
64 } | 64 } |
65 | 65 |
66 WillBeHeapVector<RefPtrWillBeMember<NodeType>> m_nodes; | 66 WillBeHeapVector<RefPtrWillBeMember<NodeType>> m_nodes; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 template <typename VisitorDispatcher> | 107 template <typename VisitorDispatcher> |
108 ALWAYS_INLINE void StaticNodeTypeList<NodeType>::traceImpl(VisitorDispatcher vis
itor) | 108 ALWAYS_INLINE void StaticNodeTypeList<NodeType>::traceImpl(VisitorDispatcher vis
itor) |
109 { | 109 { |
110 visitor->trace(m_nodes); | 110 visitor->trace(m_nodes); |
111 NodeList::trace(visitor); | 111 NodeList::trace(visitor); |
112 } | 112 } |
113 | 113 |
114 } // namespace blink | 114 } // namespace blink |
115 | 115 |
116 #endif // StaticNodeList_h | 116 #endif // StaticNodeList_h |
OLD | NEW |