| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com> | 3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com> |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 #include "core/dom/MutationObserverRegistration.h" | 25 #include "core/dom/MutationObserverRegistration.h" |
| 26 #include "core/dom/NodeListsNodeData.h" | 26 #include "core/dom/NodeListsNodeData.h" |
| 27 #include "platform/heap/Handle.h" | 27 #include "platform/heap/Handle.h" |
| 28 #include "wtf/HashSet.h" | 28 #include "wtf/HashSet.h" |
| 29 #include "wtf/OwnPtr.h" | 29 #include "wtf/OwnPtr.h" |
| 30 #include "wtf/PassOwnPtr.h" | 30 #include "wtf/PassOwnPtr.h" |
| 31 | 31 |
| 32 namespace blink { | 32 namespace blink { |
| 33 | 33 |
| 34 class NodeMutationObserverData final : public NoBaseWillBeGarbageCollected<NodeM
utationObserverData> { | 34 class NodeMutationObserverData final : public GarbageCollected<NodeMutationObser
verData> { |
| 35 WTF_MAKE_NONCOPYABLE(NodeMutationObserverData); | 35 WTF_MAKE_NONCOPYABLE(NodeMutationObserverData); |
| 36 USING_FAST_MALLOC_WILL_BE_REMOVED(NodeMutationObserverData); | |
| 37 public: | 36 public: |
| 38 WillBeHeapVector<OwnPtrWillBeMember<MutationObserverRegistration>> registry; | 37 HeapVector<Member<MutationObserverRegistration>> registry; |
| 39 WillBeHeapHashSet<RawPtrWillBeMember<MutationObserverRegistration>> transien
tRegistry; | 38 HeapHashSet<Member<MutationObserverRegistration>> transientRegistry; |
| 40 | 39 |
| 41 static PassOwnPtrWillBeRawPtr<NodeMutationObserverData> create() | 40 static RawPtr<NodeMutationObserverData> create() |
| 42 { | 41 { |
| 43 return adoptPtrWillBeNoop(new NodeMutationObserverData); | 42 return adoptPtrWillBeNoop(new NodeMutationObserverData); |
| 44 } | 43 } |
| 45 | 44 |
| 46 DEFINE_INLINE_TRACE() | 45 DEFINE_INLINE_TRACE() |
| 47 { | 46 { |
| 48 #if ENABLE(OILPAN) | 47 #if ENABLE(OILPAN) |
| 49 visitor->trace(registry); | 48 visitor->trace(registry); |
| 50 visitor->trace(transientRegistry); | 49 visitor->trace(transientRegistry); |
| 51 #endif | 50 #endif |
| 52 } | 51 } |
| 53 | 52 |
| 54 private: | 53 private: |
| 55 NodeMutationObserverData() { } | 54 NodeMutationObserverData() { } |
| 56 }; | 55 }; |
| 57 | 56 |
| 58 class NodeRareData : public NoBaseWillBeGarbageCollectedFinalized<NodeRareData>,
public NodeRareDataBase { | 57 class NodeRareData : public GarbageCollectedFinalized<NodeRareData>, public Node
RareDataBase { |
| 59 WTF_MAKE_NONCOPYABLE(NodeRareData); | 58 WTF_MAKE_NONCOPYABLE(NodeRareData); |
| 60 USING_FAST_MALLOC_WILL_BE_REMOVED(NodeRareData); | |
| 61 public: | 59 public: |
| 62 static NodeRareData* create(LayoutObject* layoutObject) | 60 static NodeRareData* create(LayoutObject* layoutObject) |
| 63 { | 61 { |
| 64 return new NodeRareData(layoutObject); | 62 return new NodeRareData(layoutObject); |
| 65 } | 63 } |
| 66 | 64 |
| 67 void clearNodeLists() { m_nodeLists.clear(); } | 65 void clearNodeLists() { m_nodeLists.clear(); } |
| 68 NodeListsNodeData* nodeLists() const { return m_nodeLists.get(); } | 66 NodeListsNodeData* nodeLists() const { return m_nodeLists.get(); } |
| 69 NodeListsNodeData& ensureNodeLists() | 67 NodeListsNodeData& ensureNodeLists() |
| 70 { | 68 { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 protected: | 108 protected: |
| 111 explicit NodeRareData(LayoutObject* layoutObject) | 109 explicit NodeRareData(LayoutObject* layoutObject) |
| 112 : NodeRareDataBase(layoutObject) | 110 : NodeRareDataBase(layoutObject) |
| 113 , m_connectedFrameCount(0) | 111 , m_connectedFrameCount(0) |
| 114 , m_elementFlags(0) | 112 , m_elementFlags(0) |
| 115 , m_restyleFlags(0) | 113 , m_restyleFlags(0) |
| 116 , m_isElementRareData(false) | 114 , m_isElementRareData(false) |
| 117 { } | 115 { } |
| 118 | 116 |
| 119 private: | 117 private: |
| 120 OwnPtrWillBeMember<NodeListsNodeData> m_nodeLists; | 118 Member<NodeListsNodeData> m_nodeLists; |
| 121 OwnPtrWillBeMember<NodeMutationObserverData> m_mutationObserverData; | 119 Member<NodeMutationObserverData> m_mutationObserverData; |
| 122 | 120 |
| 123 unsigned m_connectedFrameCount : ConnectedFrameCountBits; | 121 unsigned m_connectedFrameCount : ConnectedFrameCountBits; |
| 124 unsigned m_elementFlags : NumberOfElementFlags; | 122 unsigned m_elementFlags : NumberOfElementFlags; |
| 125 unsigned m_restyleFlags : NumberOfDynamicRestyleFlags; | 123 unsigned m_restyleFlags : NumberOfDynamicRestyleFlags; |
| 126 protected: | 124 protected: |
| 127 unsigned m_isElementRareData : 1; | 125 unsigned m_isElementRareData : 1; |
| 128 }; | 126 }; |
| 129 | 127 |
| 130 } // namespace blink | 128 } // namespace blink |
| 131 | 129 |
| 132 #endif // NodeRareData_h | 130 #endif // NodeRareData_h |
| OLD | NEW |