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

Unified Diff: Source/core/dom/MutationObserverInterestGroup.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
Index: Source/core/dom/MutationObserverInterestGroup.h
diff --git a/Source/core/dom/MutationObserverInterestGroup.h b/Source/core/dom/MutationObserverInterestGroup.h
index b149afcf935a364018f0dabf6caa95bce2b119d3..9df7498930bb8cca9cf191bb83decab9d0e7fd90 100644
--- a/Source/core/dom/MutationObserverInterestGroup.h
+++ b/Source/core/dom/MutationObserverInterestGroup.h
@@ -35,14 +35,15 @@
#include "core/dom/MutationObserver.h"
#include "core/dom/Node.h"
#include "core/dom/QualifiedName.h"
+#include "platform/heap/Handle.h"
#include "wtf/HashMap.h"
#include "wtf/PassOwnPtr.h"
namespace WebCore {
-class MutationObserverInterestGroup {
+class MutationObserverInterestGroup FINAL : public NoBaseWillBeGarbageCollectedFinalized<MutationObserverInterestGroup> {
public:
- static PassOwnPtr<MutationObserverInterestGroup> createForChildListMutation(Node& target)
+ static PassOwnPtrWillBeRawPtr<MutationObserverInterestGroup> createForChildListMutation(Node& target)
{
if (!target.document().hasMutationObserversOfType(MutationObserver::ChildList))
return nullptr;
@@ -51,7 +52,7 @@ public:
return createIfNeeded(target, MutationObserver::ChildList, oldValueFlag);
}
- static PassOwnPtr<MutationObserverInterestGroup> createForCharacterDataMutation(Node& target)
+ static PassOwnPtrWillBeRawPtr<MutationObserverInterestGroup> createForCharacterDataMutation(Node& target)
{
if (!target.document().hasMutationObserversOfType(MutationObserver::CharacterData))
return nullptr;
@@ -59,7 +60,7 @@ public:
return createIfNeeded(target, MutationObserver::CharacterData, MutationObserver::CharacterDataOldValue);
}
- static PassOwnPtr<MutationObserverInterestGroup> createForAttributesMutation(Node& target, const QualifiedName& attributeName)
+ static PassOwnPtrWillBeRawPtr<MutationObserverInterestGroup> createForAttributesMutation(Node& target, const QualifiedName& attributeName)
{
if (!target.document().hasMutationObserversOfType(MutationObserver::Attributes))
return nullptr;
@@ -68,15 +69,17 @@ public:
}
bool isOldValueRequested();
- void enqueueMutationRecord(PassRefPtr<MutationRecord>);
+ void enqueueMutationRecord(PassRefPtrWillBeRawPtr<MutationRecord>);
+
+ void trace(Visitor*);
private:
- static PassOwnPtr<MutationObserverInterestGroup> createIfNeeded(Node& target, MutationObserver::MutationType, MutationRecordDeliveryOptions oldValueFlag, const QualifiedName* attributeName = 0);
- MutationObserverInterestGroup(HashMap<MutationObserver*, MutationRecordDeliveryOptions>& observers, MutationRecordDeliveryOptions oldValueFlag);
+ static PassOwnPtrWillBeRawPtr<MutationObserverInterestGroup> createIfNeeded(Node& target, MutationObserver::MutationType, MutationRecordDeliveryOptions oldValueFlag, const QualifiedName* attributeName = 0);
+ MutationObserverInterestGroup(WillBeHeapHashMap<RawPtrWillBeMember<MutationObserver>, MutationRecordDeliveryOptions>& observers, MutationRecordDeliveryOptions oldValueFlag);
bool hasOldValue(MutationRecordDeliveryOptions options) { return options & m_oldValueFlag; }
- HashMap<MutationObserver*, MutationRecordDeliveryOptions> m_observers;
+ WillBeHeapHashMap<RawPtrWillBeMember<MutationObserver>, MutationRecordDeliveryOptions> m_observers;
MutationRecordDeliveryOptions m_oldValueFlag;
};

Powered by Google App Engine
This is Rietveld 408576698