Chromium Code Reviews| Index: Source/core/dom/MutationObserver.h |
| diff --git a/Source/core/dom/MutationObserver.h b/Source/core/dom/MutationObserver.h |
| index 086e600ea428368e05cd9bb3eb91009603317679..fad6e044da2994c440ddee1574861cd924adbd52 100644 |
| --- a/Source/core/dom/MutationObserver.h |
| +++ b/Source/core/dom/MutationObserver.h |
| @@ -32,6 +32,7 @@ |
| #define MutationObserver_h |
| #include "bindings/v8/ScriptWrappable.h" |
| +#include "platform/heap/Handle.h" |
| #include "wtf/HashSet.h" |
| #include "wtf/PassOwnPtr.h" |
| #include "wtf/PassRefPtr.h" |
| @@ -51,7 +52,7 @@ class Node; |
| typedef unsigned char MutationObserverOptions; |
| typedef unsigned char MutationRecordDeliveryOptions; |
| -class MutationObserver : public RefCounted<MutationObserver>, public ScriptWrappable { |
| +class MutationObserver FINAL : public RefCountedWillBeGarbageCollectedFinalized<MutationObserver>, public ScriptWrappable { |
| public: |
| enum MutationType { |
| ChildList = 1 << 0, |
| @@ -71,23 +72,25 @@ public: |
| CharacterDataOldValue = 1 << 6, |
| }; |
| - static PassRefPtr<MutationObserver> create(PassOwnPtr<MutationCallback>); |
| + static PassRefPtrWillBeRawPtr<MutationObserver> create(PassOwnPtr<MutationCallback>); |
| static void resumeSuspendedObservers(); |
| static void deliverMutations(); |
| ~MutationObserver(); |
| void observe(Node*, const Dictionary&, ExceptionState&); |
| - Vector<RefPtr<MutationRecord> > takeRecords(); |
| + WillBeHeapVector<RefPtrWillBeMember<MutationRecord> > takeRecords(); |
| void disconnect(); |
| void observationStarted(MutationObserverRegistration*); |
| void observationEnded(MutationObserverRegistration*); |
| - void enqueueMutationRecord(PassRefPtr<MutationRecord>); |
| + void enqueueMutationRecord(PassRefPtrWillBeRawPtr<MutationRecord>); |
| void setHasTransientRegistration(); |
| bool canDeliver(); |
| HashSet<Node*> getObservedNodes() const; |
| + void trace(Visitor*); |
| + |
| private: |
| struct ObserverLessThan; |
| @@ -95,8 +98,8 @@ private: |
| void deliver(); |
| OwnPtr<MutationCallback> m_callback; |
| - Vector<RefPtr<MutationRecord> > m_records; |
| - HashSet<MutationObserverRegistration*> m_registrations; |
| + WillBeHeapVector<RefPtrWillBeMember<MutationRecord> > m_records; |
| + WillBeHeapHashSet<RawPtrWillBeWeakMember<MutationObserverRegistration> > m_registrations; |
|
haraken
2014/04/21 06:00:34
Does this need to be a hash set of weak members? I
sof
2014/04/21 07:34:05
Doesn't have to be, but it was requested it be so
haraken
2014/04/21 07:41:31
Or can we keep it a weak member and comment out Mu
sof
2014/04/21 07:43:51
No, that won't work. Please see comments earlier,
haraken
2014/04/21 07:45:46
ah, remembered, sorry about the confusion. Then it
sof
2014/04/21 12:45:16
I've switched away from weak members on MutationOb
|
| unsigned m_priority; |
| }; |