| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 transient_registry_; | 91 transient_registry_; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 DEFINE_TRAIT_FOR_TRACE_WRAPPERS(NodeMutationObserverData); | 94 DEFINE_TRAIT_FOR_TRACE_WRAPPERS(NodeMutationObserverData); |
| 95 | 95 |
| 96 class NodeRareData : public GarbageCollectedFinalized<NodeRareData>, | 96 class NodeRareData : public GarbageCollectedFinalized<NodeRareData>, |
| 97 public NodeRareDataBase { | 97 public NodeRareDataBase { |
| 98 WTF_MAKE_NONCOPYABLE(NodeRareData); | 98 WTF_MAKE_NONCOPYABLE(NodeRareData); |
| 99 | 99 |
| 100 public: | 100 public: |
| 101 static NodeRareData* Create(LayoutObject* layout_object) { | 101 static NodeRareData* Create(NodeLayoutData* node_layout_data) { |
| 102 return new NodeRareData(layout_object); | 102 return new NodeRareData(node_layout_data); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void ClearNodeLists() { node_lists_.Clear(); } | 105 void ClearNodeLists() { node_lists_.Clear(); } |
| 106 NodeListsNodeData* NodeLists() const { return node_lists_.Get(); } | 106 NodeListsNodeData* NodeLists() const { return node_lists_.Get(); } |
| 107 // ensureNodeLists() and a following NodeListsNodeData functions must be | 107 // ensureNodeLists() and a following NodeListsNodeData functions must be |
| 108 // wrapped with a ThreadState::GCForbiddenScope in order to avoid an | 108 // wrapped with a ThreadState::GCForbiddenScope in order to avoid an |
| 109 // initialized m_nodeLists is cleared by NodeRareData::traceAfterDispatch(). | 109 // initialized m_nodeLists is cleared by NodeRareData::traceAfterDispatch(). |
| 110 NodeListsNodeData& EnsureNodeLists() { | 110 NodeListsNodeData& EnsureNodeLists() { |
| 111 DCHECK(ThreadState::Current()->IsGCForbidden()); | 111 DCHECK(ThreadState::Current()->IsGCForbidden()); |
| 112 if (!node_lists_) { | 112 if (!node_lists_) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 DECLARE_TRACE(); | 157 DECLARE_TRACE(); |
| 158 | 158 |
| 159 DECLARE_TRACE_AFTER_DISPATCH(); | 159 DECLARE_TRACE_AFTER_DISPATCH(); |
| 160 void FinalizeGarbageCollectedObject(); | 160 void FinalizeGarbageCollectedObject(); |
| 161 | 161 |
| 162 DECLARE_TRACE_WRAPPERS(); | 162 DECLARE_TRACE_WRAPPERS(); |
| 163 DECLARE_TRACE_WRAPPERS_AFTER_DISPATCH(); | 163 DECLARE_TRACE_WRAPPERS_AFTER_DISPATCH(); |
| 164 | 164 |
| 165 protected: | 165 protected: |
| 166 explicit NodeRareData(LayoutObject* layout_object) | 166 explicit NodeRareData(NodeLayoutData* node_layout_data) |
| 167 : NodeRareDataBase(layout_object), | 167 : NodeRareDataBase(node_layout_data), |
| 168 connected_frame_count_(0), | 168 connected_frame_count_(0), |
| 169 element_flags_(0), | 169 element_flags_(0), |
| 170 restyle_flags_(0), | 170 restyle_flags_(0), |
| 171 is_element_rare_data_(false) {} | 171 is_element_rare_data_(false) { |
| 172 CHECK_NE(node_layout_data, nullptr); |
| 173 } |
| 172 | 174 |
| 173 private: | 175 private: |
| 174 Member<NodeListsNodeData> node_lists_; | 176 Member<NodeListsNodeData> node_lists_; |
| 175 Member<NodeMutationObserverData> mutation_observer_data_; | 177 Member<NodeMutationObserverData> mutation_observer_data_; |
| 176 | 178 |
| 177 unsigned connected_frame_count_ : kConnectedFrameCountBits; | 179 unsigned connected_frame_count_ : kConnectedFrameCountBits; |
| 178 unsigned element_flags_ : kNumberOfElementFlags; | 180 unsigned element_flags_ : kNumberOfElementFlags; |
| 179 unsigned restyle_flags_ : kNumberOfDynamicRestyleFlags; | 181 unsigned restyle_flags_ : kNumberOfDynamicRestyleFlags; |
| 180 | 182 |
| 181 protected: | 183 protected: |
| 182 unsigned is_element_rare_data_ : 1; | 184 unsigned is_element_rare_data_ : 1; |
| 183 }; | 185 }; |
| 184 | 186 |
| 185 DEFINE_TRAIT_FOR_TRACE_WRAPPERS(NodeRareData); | 187 DEFINE_TRAIT_FOR_TRACE_WRAPPERS(NodeRareData); |
| 186 | 188 |
| 187 } // namespace blink | 189 } // namespace blink |
| 188 | 190 |
| 189 #endif // NodeRareData_h | 191 #endif // NodeRareData_h |
| OLD | NEW |