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

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

Issue 265793017: Oilpan: move node/element rare data objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + have MutationObserver keep a weak ref to registrations Created 6 years, 7 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/NodeRareData.h
diff --git a/Source/core/dom/NodeRareData.h b/Source/core/dom/NodeRareData.h
index 9e8d139fc429999ded697e7fe333a6627fee6d2f..55d7869e3225ca4a6c53bf4c055dfd707cefa5a7 100644
--- a/Source/core/dom/NodeRareData.h
+++ b/Source/core/dom/NodeRareData.h
@@ -232,16 +232,15 @@ private:
NodeMutationObserverData() { }
};
-class NodeRareData : public NodeRareDataBase {
- WTF_MAKE_NONCOPYABLE(NodeRareData); WTF_MAKE_FAST_ALLOCATED;
+class NodeRareData : public NoBaseWillBeGarbageCollectedFinalized<NodeRareData>, public NodeRareDataBase {
+ WTF_MAKE_NONCOPYABLE(NodeRareData);
+ WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
public:
- static PassOwnPtr<NodeRareData> create(RenderObject* renderer)
+ static RawPtr<NodeRareData> create(RenderObject* renderer)
haraken 2014/05/08 04:14:00 RawPtr => * ?
sof 2014/05/08 06:43:15 Done.
{
- return adoptPtr(new NodeRareData(renderer));
+ return new NodeRareData(renderer);
}
- void dispose();
-
void clearNodeLists() { m_nodeLists.clear(); }
NodeListsNodeData* nodeLists() const { return m_nodeLists.get(); }
NodeListsNodeData& ensureNodeLists()
@@ -284,21 +283,29 @@ public:
ConnectedFrameCountBits = 10, // Must fit Page::maxNumberOfFrames.
};
+ void trace(Visitor*);
+
+ void traceAfterDispatch(Visitor*);
+ void finalizeGarbageCollectedObject();
+
protected:
NodeRareData(RenderObject* renderer)
: NodeRareDataBase(renderer)
, m_connectedFrameCount(0)
, m_elementFlags(0)
, m_restyleFlags(0)
+ , m_isElementRareData(false)
{ }
private:
OwnPtr<NodeListsNodeData> m_nodeLists;
- OwnPtrWillBePersistent<NodeMutationObserverData> m_mutationObserverData;
+ OwnPtrWillBeMember<NodeMutationObserverData> m_mutationObserverData;
unsigned m_connectedFrameCount : ConnectedFrameCountBits;
unsigned m_elementFlags : NumberOfElementFlags;
unsigned m_restyleFlags : NumberOfDynamicRestyleFlags;
+protected:
+ unsigned m_isElementRareData : 1;
};
inline bool NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(Node& ownerNode)

Powered by Google App Engine
This is Rietveld 408576698