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

Unified Diff: Source/core/dom/MutationObserver.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/MutationObserver.h
diff --git a/Source/core/dom/MutationObserver.h b/Source/core/dom/MutationObserver.h
index 086e600ea428368e05cd9bb3eb91009603317679..3d92d18bffd293a1c8c500d7a9f287c51fb31275 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<RawPtrWillBeMember<MutationObserverRegistration> > m_registrations;
unsigned m_priority;
};

Powered by Google App Engine
This is Rietveld 408576698