| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 void trace(Visitor* visitor) | 225 void trace(Visitor* visitor) |
| 226 { | 226 { |
| 227 visitor->trace(registry); | 227 visitor->trace(registry); |
| 228 visitor->trace(transientRegistry); | 228 visitor->trace(transientRegistry); |
| 229 } | 229 } |
| 230 | 230 |
| 231 private: | 231 private: |
| 232 NodeMutationObserverData() { } | 232 NodeMutationObserverData() { } |
| 233 }; | 233 }; |
| 234 | 234 |
| 235 class NodeRareData : public NodeRareDataBase { | 235 class NodeRareData : public NoBaseWillBeGarbageCollectedFinalized<NodeRareData>,
public NodeRareDataBase { |
| 236 WTF_MAKE_NONCOPYABLE(NodeRareData); WTF_MAKE_FAST_ALLOCATED; | 236 WTF_MAKE_NONCOPYABLE(NodeRareData); |
| 237 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| 237 public: | 238 public: |
| 238 static PassOwnPtr<NodeRareData> create(RenderObject* renderer) | 239 static NodeRareData* create(RenderObject* renderer) |
| 239 { | 240 { |
| 240 return adoptPtr(new NodeRareData(renderer)); | 241 return new NodeRareData(renderer); |
| 241 } | 242 } |
| 242 | 243 |
| 243 void dispose(); | |
| 244 | |
| 245 void clearNodeLists() { m_nodeLists.clear(); } | 244 void clearNodeLists() { m_nodeLists.clear(); } |
| 246 NodeListsNodeData* nodeLists() const { return m_nodeLists.get(); } | 245 NodeListsNodeData* nodeLists() const { return m_nodeLists.get(); } |
| 247 NodeListsNodeData& ensureNodeLists() | 246 NodeListsNodeData& ensureNodeLists() |
| 248 { | 247 { |
| 249 if (!m_nodeLists) | 248 if (!m_nodeLists) |
| 250 m_nodeLists = NodeListsNodeData::create(); | 249 m_nodeLists = NodeListsNodeData::create(); |
| 251 return *m_nodeLists; | 250 return *m_nodeLists; |
| 252 } | 251 } |
| 253 | 252 |
| 254 NodeMutationObserverData* mutationObserverData() { return m_mutationObserver
Data.get(); } | 253 NodeMutationObserverData* mutationObserverData() { return m_mutationObserver
Data.get(); } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 277 | 276 |
| 278 bool hasRestyleFlag(DynamicRestyleFlags mask) const { return m_restyleFlags
& mask; } | 277 bool hasRestyleFlag(DynamicRestyleFlags mask) const { return m_restyleFlags
& mask; } |
| 279 void setRestyleFlag(DynamicRestyleFlags mask) { m_restyleFlags |= mask; RELE
ASE_ASSERT(m_restyleFlags); } | 278 void setRestyleFlag(DynamicRestyleFlags mask) { m_restyleFlags |= mask; RELE
ASE_ASSERT(m_restyleFlags); } |
| 280 bool hasRestyleFlags() const { return m_restyleFlags; } | 279 bool hasRestyleFlags() const { return m_restyleFlags; } |
| 281 void clearRestyleFlags() { m_restyleFlags = 0; } | 280 void clearRestyleFlags() { m_restyleFlags = 0; } |
| 282 | 281 |
| 283 enum { | 282 enum { |
| 284 ConnectedFrameCountBits = 10, // Must fit Page::maxNumberOfFrames. | 283 ConnectedFrameCountBits = 10, // Must fit Page::maxNumberOfFrames. |
| 285 }; | 284 }; |
| 286 | 285 |
| 286 void trace(Visitor*); |
| 287 |
| 288 void traceAfterDispatch(Visitor*); |
| 289 void finalizeGarbageCollectedObject(); |
| 290 |
| 287 protected: | 291 protected: |
| 288 NodeRareData(RenderObject* renderer) | 292 NodeRareData(RenderObject* renderer) |
| 289 : NodeRareDataBase(renderer) | 293 : NodeRareDataBase(renderer) |
| 290 , m_connectedFrameCount(0) | 294 , m_connectedFrameCount(0) |
| 291 , m_elementFlags(0) | 295 , m_elementFlags(0) |
| 292 , m_restyleFlags(0) | 296 , m_restyleFlags(0) |
| 297 , m_isElementRareData(false) |
| 293 { } | 298 { } |
| 294 | 299 |
| 295 private: | 300 private: |
| 296 OwnPtr<NodeListsNodeData> m_nodeLists; | 301 OwnPtr<NodeListsNodeData> m_nodeLists; |
| 297 OwnPtrWillBePersistent<NodeMutationObserverData> m_mutationObserverData; | 302 OwnPtrWillBeMember<NodeMutationObserverData> m_mutationObserverData; |
| 298 | 303 |
| 299 unsigned m_connectedFrameCount : ConnectedFrameCountBits; | 304 unsigned m_connectedFrameCount : ConnectedFrameCountBits; |
| 300 unsigned m_elementFlags : NumberOfElementFlags; | 305 unsigned m_elementFlags : NumberOfElementFlags; |
| 301 unsigned m_restyleFlags : NumberOfDynamicRestyleFlags; | 306 unsigned m_restyleFlags : NumberOfDynamicRestyleFlags; |
| 307 protected: |
| 308 unsigned m_isElementRareData : 1; |
| 302 }; | 309 }; |
| 303 | 310 |
| 304 inline bool NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLas
tList(Node& ownerNode) | 311 inline bool NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLas
tList(Node& ownerNode) |
| 305 { | 312 { |
| 306 ASSERT(ownerNode.nodeLists() == this); | 313 ASSERT(ownerNode.nodeLists() == this); |
| 307 if ((m_childNodeList ? 1 : 0) + m_atomicNameCaches.size() + m_tagCollectionC
acheNS.size() != 1) | 314 if ((m_childNodeList ? 1 : 0) + m_atomicNameCaches.size() + m_tagCollectionC
acheNS.size() != 1) |
| 308 return false; | 315 return false; |
| 309 ownerNode.clearNodeLists(); | 316 ownerNode.clearNodeLists(); |
| 310 return true; | 317 return true; |
| 311 } | 318 } |
| 312 | 319 |
| 313 } // namespace WebCore | 320 } // namespace WebCore |
| 314 | 321 |
| 315 #endif // NodeRareData_h | 322 #endif // NodeRareData_h |
| OLD | NEW |