Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Unified Diff: Source/core/dom/NodeListsNodeData.h

Issue 390043003: Move NodeListsNodeData class out of NodeRareData.h (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/NodeListsNodeData.h
diff --git a/Source/core/dom/NodeRareData.h b/Source/core/dom/NodeListsNodeData.h
similarity index 71%
copy from Source/core/dom/NodeRareData.h
copy to Source/core/dom/NodeListsNodeData.h
index ef4cddd91b7c010748b5e05393f45683cbf3696a..d8bcf0e6367f4ced3487dd286ac1efc00f438960 100644
--- a/Source/core/dom/NodeRareData.h
+++ b/Source/core/dom/NodeListsNodeData.h
@@ -19,19 +19,15 @@
*
*/
-#ifndef NodeRareData_h
-#define NodeRareData_h
+#ifndef NodeListsNodeData_h
+#define NodeListsNodeData_h
#include "core/dom/ChildNodeList.h"
#include "core/dom/EmptyNodeList.h"
-#include "core/dom/LiveNodeList.h"
-#include "core/dom/MutationObserverRegistration.h"
#include "core/dom/QualifiedName.h"
#include "core/dom/TagCollection.h"
+#include "core/html/CollectionType.h"
#include "platform/heap/Handle.h"
-#include "wtf/HashSet.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
#include "wtf/text/AtomicString.h"
#include "wtf/text/StringHash.h"
@@ -229,104 +225,6 @@ private:
TagCollectionCacheNS m_tagCollectionCacheNS;
};
-class NodeMutationObserverData FINAL : public NoBaseWillBeGarbageCollected<NodeMutationObserverData> {
- WTF_MAKE_NONCOPYABLE(NodeMutationObserverData);
- WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
-public:
- WillBeHeapVector<OwnPtrWillBeMember<MutationObserverRegistration> > registry;
- WillBeHeapHashSet<RawPtrWillBeMember<MutationObserverRegistration> > transientRegistry;
-
- static PassOwnPtrWillBeRawPtr<NodeMutationObserverData> create()
- {
- return adoptPtrWillBeNoop(new NodeMutationObserverData);
- }
-
- void trace(Visitor* visitor)
- {
- visitor->trace(registry);
- visitor->trace(transientRegistry);
- }
-
-private:
- NodeMutationObserverData() { }
-};
-
-class NodeRareData : public NoBaseWillBeGarbageCollectedFinalized<NodeRareData>, public NodeRareDataBase {
- WTF_MAKE_NONCOPYABLE(NodeRareData);
- WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
-public:
- static NodeRareData* create(RenderObject* renderer)
- {
- return new NodeRareData(renderer);
- }
-
- void clearNodeLists() { m_nodeLists.clear(); }
- NodeListsNodeData* nodeLists() const { return m_nodeLists.get(); }
- NodeListsNodeData& ensureNodeLists()
- {
- if (!m_nodeLists)
- m_nodeLists = NodeListsNodeData::create();
- return *m_nodeLists;
- }
-
- NodeMutationObserverData* mutationObserverData() { return m_mutationObserverData.get(); }
- NodeMutationObserverData& ensureMutationObserverData()
- {
- if (!m_mutationObserverData)
- m_mutationObserverData = NodeMutationObserverData::create();
- return *m_mutationObserverData;
- }
-
- unsigned connectedSubframeCount() const { return m_connectedFrameCount; }
- void incrementConnectedSubframeCount(unsigned amount)
- {
- m_connectedFrameCount += amount;
- }
- void decrementConnectedSubframeCount(unsigned amount)
- {
- ASSERT(m_connectedFrameCount);
- ASSERT(amount <= m_connectedFrameCount);
- m_connectedFrameCount -= amount;
- }
-
- bool hasElementFlag(ElementFlags mask) const { return m_elementFlags & mask; }
- void setElementFlag(ElementFlags mask, bool value) { m_elementFlags = (m_elementFlags & ~mask) | (-(int32_t)value & mask); }
- void clearElementFlag(ElementFlags mask) { m_elementFlags &= ~mask; }
-
- bool hasRestyleFlag(DynamicRestyleFlags mask) const { return m_restyleFlags & mask; }
- void setRestyleFlag(DynamicRestyleFlags mask) { m_restyleFlags |= mask; RELEASE_ASSERT(m_restyleFlags); }
- bool hasRestyleFlags() const { return m_restyleFlags; }
- void clearRestyleFlags() { m_restyleFlags = 0; }
-
- enum {
- ConnectedFrameCountBits = 10, // Must fit Page::maxNumberOfFrames.
- };
-
- void trace(Visitor*);
-
- void traceAfterDispatch(Visitor*);
- void finalizeGarbageCollectedObject();
-
-protected:
- explicit NodeRareData(RenderObject* renderer)
- : NodeRareDataBase(renderer)
- , m_connectedFrameCount(0)
- , m_elementFlags(0)
- , m_restyleFlags(0)
- , m_isElementRareData(false)
- { }
-
-private:
- OwnPtrWillBeMember<NodeListsNodeData> m_nodeLists;
- OwnPtrWillBeMember<NodeMutationObserverData> m_mutationObserverData;
-
- unsigned m_connectedFrameCount : ConnectedFrameCountBits;
- unsigned m_elementFlags : NumberOfElementFlags;
- unsigned m_restyleFlags : NumberOfDynamicRestyleFlags;
-protected:
- unsigned m_isElementRareData : 1;
-};
-
#if !ENABLE(OILPAN)
inline bool NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(Node& ownerNode)
{
@@ -340,4 +238,4 @@ inline bool NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLas
} // namespace WebCore
-#endif // NodeRareData_h
+#endif // NodeListsNodeData_h

Powered by Google App Engine
This is Rietveld 408576698