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

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

Issue 280123002: Oilpan: move LiveNodeList collections to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have NodeRareData clear out NodeListsNodeData instead. 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
« no previous file with comments | « Source/core/dom/LiveNodeList.cpp ('k') | Source/core/dom/MutationRecord.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/LiveNodeListBase.h
diff --git a/Source/core/dom/LiveNodeListBase.h b/Source/core/dom/LiveNodeListBase.h
index 1724e97f3f5bb0089acee0cf695a7e1e38c1195e..7eb105bf33b61ccb24b619c178d86e87b621eac4 100644
--- a/Source/core/dom/LiveNodeListBase.h
+++ b/Source/core/dom/LiveNodeListBase.h
@@ -31,6 +31,7 @@
#include "core/dom/ElementTraversal.h"
#include "core/dom/NodeTraversal.h"
#include "core/html/CollectionType.h"
+#include "platform/heap/Handle.h"
namespace WebCore {
@@ -39,7 +40,7 @@ enum NodeListRootType {
NodeListIsRootedAtDocument
};
-class LiveNodeListBase {
+class LiveNodeListBase : public WillBeGarbageCollectedMixin {
public:
LiveNodeListBase(ContainerNode& ownerNode, NodeListRootType rootType, NodeListInvalidationType invalidationType,
CollectionType collectionType)
@@ -57,7 +58,9 @@ public:
virtual ~LiveNodeListBase()
{
+#if !ENABLE(OILPAN)
document().unregisterNodeList(this);
+#endif
}
ContainerNode& rootNode() const;
@@ -91,8 +94,10 @@ protected:
template <class NodeListType>
static Element* traverseMatchingElementsBackwardToOffset(const NodeListType&, unsigned offset, Element& currentElement, unsigned& currentOffset);
+ void trace(Visitor* visitor) { visitor->trace(m_ownerNode); }
+
private:
- RefPtr<ContainerNode> m_ownerNode; // Cannot be null.
+ RefPtrWillBeMember<ContainerNode> m_ownerNode; // Cannot be null.
const unsigned m_rootType : 1;
const unsigned m_invalidationType : 4;
const unsigned m_collectionType : 5;
« no previous file with comments | « Source/core/dom/LiveNodeList.cpp ('k') | Source/core/dom/MutationRecord.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698