OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2012 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2012 Apple Inc. All rights reserved. |
6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
8 * Copyright (C) 2011 Andreas Kling (kling@webkit.org) | 8 * Copyright (C) 2011 Andreas Kling (kling@webkit.org) |
9 * | 9 * |
10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 bool isEmpty() const { return m_entries.isEmpty(); } | 50 bool isEmpty() const { return m_entries.isEmpty(); } |
51 bool contains(const AtomicString& eventType) const; | 51 bool contains(const AtomicString& eventType) const; |
52 bool containsCapturing(const AtomicString& eventType) const; | 52 bool containsCapturing(const AtomicString& eventType) const; |
53 | 53 |
54 void clear(); | 54 void clear(); |
55 bool add(const AtomicString& eventType, PassRefPtr<EventListener>, bool useC
apture); | 55 bool add(const AtomicString& eventType, PassRefPtr<EventListener>, bool useC
apture); |
56 bool remove(const AtomicString& eventType, EventListener*, bool useCapture,
size_t& indexOfRemovedListener); | 56 bool remove(const AtomicString& eventType, EventListener*, bool useCapture,
size_t& indexOfRemovedListener); |
57 EventListenerVector* find(const AtomicString& eventType); | 57 EventListenerVector* find(const AtomicString& eventType); |
58 Vector<AtomicString> eventTypes() const; | 58 Vector<AtomicString> eventTypes() const; |
59 | 59 |
60 void removeFirstEventListenerCreatedFromMarkup(const AtomicString& eventType
); | |
61 void copyEventListenersNotCreatedFromMarkupToTarget(EventTarget*); | 60 void copyEventListenersNotCreatedFromMarkupToTarget(EventTarget*); |
62 | 61 |
63 private: | 62 private: |
64 friend class EventListenerIterator; | 63 friend class EventListenerIterator; |
65 | 64 |
66 void assertNoActiveIterators(); | 65 void assertNoActiveIterators(); |
67 | 66 |
68 Vector<std::pair<AtomicString, OwnPtr<EventListenerVector>>, 2> m_entries; | 67 Vector<std::pair<AtomicString, OwnPtr<EventListenerVector>>, 2> m_entries; |
69 | 68 |
70 #if ENABLE(ASSERT) | 69 #if ENABLE(ASSERT) |
71 int m_activeIteratorCount; | 70 int m_activeIteratorCount; |
72 #endif | 71 #endif |
73 }; | 72 }; |
74 | 73 |
75 class EventListenerIterator { | 74 class EventListenerIterator { |
76 WTF_MAKE_NONCOPYABLE(EventListenerIterator); | 75 WTF_MAKE_NONCOPYABLE(EventListenerIterator); |
77 public: | 76 public: |
78 EventListenerIterator(); | |
79 EventListenerIterator(EventTarget*); | 77 EventListenerIterator(EventTarget*); |
80 #if ENABLE(ASSERT) | 78 #if ENABLE(ASSERT) |
81 ~EventListenerIterator(); | 79 ~EventListenerIterator(); |
82 #endif | 80 #endif |
83 | 81 |
84 EventListener* nextListener(); | 82 EventListener* nextListener(); |
85 | 83 |
86 private: | 84 private: |
87 EventListenerMap* m_map; | 85 EventListenerMap* m_map; |
88 unsigned m_entryIndex; | 86 unsigned m_entryIndex; |
89 unsigned m_index; | 87 unsigned m_index; |
90 }; | 88 }; |
91 | 89 |
92 #if !ENABLE(ASSERT) | 90 #if !ENABLE(ASSERT) |
93 inline void EventListenerMap::assertNoActiveIterators() { } | 91 inline void EventListenerMap::assertNoActiveIterators() { } |
94 #endif | 92 #endif |
95 | 93 |
96 } // namespace blink | 94 } // namespace blink |
97 | 95 |
98 #endif // EventListenerMap_h | 96 #endif // EventListenerMap_h |
OLD | NEW |