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

Unified Diff: third_party/WebKit/Source/core/events/EventSender.h

Issue 1554903002: EventSender<T> singletons are better off on the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove no-op cancelEvent()s Created 4 years, 12 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 | « no previous file | third_party/WebKit/Source/core/html/HTMLDetailsElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/events/EventSender.h
diff --git a/third_party/WebKit/Source/core/events/EventSender.h b/third_party/WebKit/Source/core/events/EventSender.h
index ab7f59ac66d51e9971b8c49f1fcf41bc8b1cca53..03f75c70babe0fcb3ac9b1f2453e30119b3b2d2b 100644
--- a/third_party/WebKit/Source/core/events/EventSender.h
+++ b/third_party/WebKit/Source/core/events/EventSender.h
@@ -27,15 +27,21 @@
#define EventSender_h
#include "platform/Timer.h"
+#include "platform/heap/Handle.h"
#include "wtf/Vector.h"
#include "wtf/text/AtomicString.h"
namespace blink {
-template<typename T> class EventSender {
- WTF_MAKE_NONCOPYABLE(EventSender); USING_FAST_MALLOC(EventSender);
+template<typename T>
+class EventSender final : public NoBaseWillBeGarbageCollectedFinalized<EventSender<T>> {
+ WTF_MAKE_NONCOPYABLE(EventSender);
+ USING_FAST_MALLOC_WILL_BE_REMOVED(EventSender);
public:
- explicit EventSender(const AtomicString& eventType);
+ static PassOwnPtrWillBeRawPtr<EventSender> create(const AtomicString& eventType)
+ {
+ return adoptPtrWillBeNoop(new EventSender(eventType));
+ }
const AtomicString& eventType() const { return m_eventType; }
void dispatchEventSoon(T*);
@@ -49,13 +55,21 @@ public:
}
#endif
+ DEFINE_INLINE_TRACE()
+ {
+ visitor->trace(m_dispatchSoonList);
+ visitor->trace(m_dispatchingList);
+ }
+
private:
+ explicit EventSender(const AtomicString& eventType);
+
void timerFired(Timer<EventSender<T>>*) { dispatchPendingEvents(); }
AtomicString m_eventType;
Timer<EventSender<T>> m_timer;
- WillBePersistentHeapVector<RawPtrWillBeMember<T>> m_dispatchSoonList;
- WillBePersistentHeapVector<RawPtrWillBeMember<T>> m_dispatchingList;
+ WillBeHeapVector<RawPtrWillBeMember<T>> m_dispatchSoonList;
+ WillBeHeapVector<RawPtrWillBeMember<T>> m_dispatchingList;
};
template<typename T> EventSender<T>::EventSender(const AtomicString& eventType)
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLDetailsElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698