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

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

Issue 236653002: Oilpan: move mutation observers to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + explicitly dispose() mutation observer registrations always (non-Oilpan also.) Created 6 years, 8 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/Node.cpp ('k') | Source/core/dom/NodeRareData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/NodeRareData.h
diff --git a/Source/core/dom/NodeRareData.h b/Source/core/dom/NodeRareData.h
index 1de8431b2ca1938f08551e6374836a2b86ded554..9e8d139fc429999ded697e7fe333a6627fee6d2f 100644
--- a/Source/core/dom/NodeRareData.h
+++ b/Source/core/dom/NodeRareData.h
@@ -29,6 +29,7 @@
#include "core/dom/QualifiedName.h"
#include "core/dom/TagCollection.h"
#include "core/page/Page.h"
+#include "platform/heap/Handle.h"
#include "wtf/HashSet.h"
#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
@@ -209,13 +210,23 @@ private:
TagCollectionCacheNS m_tagCollectionCacheNS;
};
-class NodeMutationObserverData {
- WTF_MAKE_NONCOPYABLE(NodeMutationObserverData); WTF_MAKE_FAST_ALLOCATED;
+class NodeMutationObserverData FINAL : public NoBaseWillBeGarbageCollected<NodeMutationObserverData> {
+ WTF_MAKE_NONCOPYABLE(NodeMutationObserverData);
+ WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
public:
- Vector<OwnPtr<MutationObserverRegistration> > registry;
- HashSet<MutationObserverRegistration*> transientRegistry;
+ WillBeHeapVector<OwnPtrWillBeMember<MutationObserverRegistration> > registry;
+ WillBeHeapHashSet<RawPtrWillBeMember<MutationObserverRegistration> > transientRegistry;
Erik Corry 2014/04/22 12:46:55 I suppose these raw pointers were only cycle-break
haraken 2014/04/22 13:03:07 It would depend on how you see these pointers. In
sof 2014/04/22 13:05:29 Ownership with these transients raw pointers lie w
- static PassOwnPtr<NodeMutationObserverData> create() { return adoptPtr(new NodeMutationObserverData); }
+ static PassOwnPtrWillBeRawPtr<NodeMutationObserverData> create()
+ {
+ return adoptPtrWillBeNoop(new NodeMutationObserverData);
+ }
+
+ void trace(Visitor* visitor)
+ {
+ visitor->trace(registry);
+ visitor->trace(transientRegistry);
+ }
private:
NodeMutationObserverData() { }
@@ -224,7 +235,12 @@ private:
class NodeRareData : public NodeRareDataBase {
WTF_MAKE_NONCOPYABLE(NodeRareData); WTF_MAKE_FAST_ALLOCATED;
public:
- static PassOwnPtr<NodeRareData> create(RenderObject* renderer) { return adoptPtr(new NodeRareData(renderer)); }
+ static PassOwnPtr<NodeRareData> create(RenderObject* renderer)
+ {
+ return adoptPtr(new NodeRareData(renderer));
+ }
+
+ void dispose();
void clearNodeLists() { m_nodeLists.clear(); }
NodeListsNodeData* nodeLists() const { return m_nodeLists.get(); }
@@ -278,7 +294,7 @@ protected:
private:
OwnPtr<NodeListsNodeData> m_nodeLists;
- OwnPtr<NodeMutationObserverData> m_mutationObserverData;
+ OwnPtrWillBePersistent<NodeMutationObserverData> m_mutationObserverData;
unsigned m_connectedFrameCount : ConnectedFrameCountBits;
unsigned m_elementFlags : NumberOfElementFlags;
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/dom/NodeRareData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698