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

Unified Diff: Source/core/inspector/EventListenerInfo.h

Issue 1238083002: Oilpan: Move the EventListener hierarchy to Oilpan's heap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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/inspector/EventListenerInfo.h
diff --git a/Source/core/inspector/EventListenerInfo.h b/Source/core/inspector/EventListenerInfo.h
index 1079971120b7167ef98da28261a7dfe80f0fdfda..15c3d75a14c0c28cbb9095ab4a8a4ad770ad6432 100644
--- a/Source/core/inspector/EventListenerInfo.h
+++ b/Source/core/inspector/EventListenerInfo.h
@@ -7,17 +7,19 @@
#include "core/InspectorTypeBuilder.h"
#include "core/events/EventListenerMap.h"
+#include "core/events/EventTarget.h"
#include "core/events/RegisteredEventListener.h"
#include "wtf/Vector.h"
#include "wtf/text/AtomicString.h"
namespace blink {
-class EventTarget;
class ExecutionContext;
class InjectedScriptManager;
-struct EventListenerInfo {
+class EventListenerInfo {
+ ALLOW_ONLY_INLINE_ALLOCATION();
+public:
EventListenerInfo(EventTarget* eventTarget, const AtomicString& eventType, const EventListenerVector& eventListenerVector)
: eventTarget(eventTarget)
, eventType(eventType)
@@ -25,17 +27,24 @@ struct EventListenerInfo {
{
}
- EventTarget* eventTarget;
+ RawPtrWillBeMember<EventTarget> eventTarget;
const AtomicString eventType;
const EventListenerVector eventListenerVector;
- static void getEventListeners(EventTarget*, Vector<EventListenerInfo>& listenersArray, bool includeAncestors);
+ DEFINE_INLINE_VIRTUAL_TRACE()
+ {
+ visitor->trace(eventTarget);
+ visitor->trace(eventListenerVector);
+ }
+
+ static void getEventListeners(EventTarget*, WillBeHeapVector<EventListenerInfo>& listenersArray, bool includeAncestors);
};
class RegisteredEventListenerIterator {
WTF_MAKE_NONCOPYABLE(RegisteredEventListenerIterator);
+ STACK_ALLOCATED();
public:
- RegisteredEventListenerIterator(Vector<EventListenerInfo>& listenersArray)
+ RegisteredEventListenerIterator(WillBeHeapVector<EventListenerInfo>& listenersArray)
: m_listenersArray(listenersArray)
, m_infoIndex(0)
, m_listenerIndex(0)
@@ -47,7 +56,7 @@ public:
const EventListenerInfo& currentEventListenerInfo();
private:
- Vector<EventListenerInfo>& m_listenersArray;
+ WillBeHeapVector<EventListenerInfo>& m_listenersArray;
unsigned m_infoIndex;
unsigned m_listenerIndex;
bool m_isUseCapturePass;
@@ -57,4 +66,6 @@ PassRefPtr<TypeBuilder::Runtime::RemoteObject> eventHandlerObject(ExecutionConte
} // namespace blink
+WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::EventListenerInfo);
+
#endif // EventListenerInfo_h

Powered by Google App Engine
This is Rietveld 408576698