| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 template<typename T> class EventSender { | 35 template<typename T> class EventSender { |
| 36 WTF_MAKE_NONCOPYABLE(EventSender); WTF_MAKE_FAST_ALLOCATED; | 36 WTF_MAKE_NONCOPYABLE(EventSender); WTF_MAKE_FAST_ALLOCATED; |
| 37 public: | 37 public: |
| 38 explicit EventSender(const AtomicString& eventType); | 38 explicit EventSender(const AtomicString& eventType); |
| 39 | 39 |
| 40 const AtomicString& eventType() const { return m_eventType; } | 40 const AtomicString& eventType() const { return m_eventType; } |
| 41 void dispatchEventSoon(T*); | 41 void dispatchEventSoon(T*); |
| 42 void cancelEvent(T*); | 42 void cancelEvent(T*); |
| 43 void dispatchPendingEvents(); | 43 void dispatchPendingEvents(); |
| 44 | 44 |
| 45 #ifndef NDEBUG | 45 #if ENABLE(ASSERT) |
| 46 bool hasPendingEvents(T* sender) const | 46 bool hasPendingEvents(T* sender) const |
| 47 { | 47 { |
| 48 return m_dispatchSoonList.find(sender) != kNotFound || m_dispatchingList
.find(sender) != kNotFound; | 48 return m_dispatchSoonList.find(sender) != kNotFound || m_dispatchingList
.find(sender) != kNotFound; |
| 49 } | 49 } |
| 50 #endif | 50 #endif |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 void timerFired(Timer<EventSender<T> >*) { dispatchPendingEvents(); } | 53 void timerFired(Timer<EventSender<T> >*) { dispatchPendingEvents(); } |
| 54 | 54 |
| 55 AtomicString m_eventType; | 55 AtomicString m_eventType; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 m_dispatchingList[i] = nullptr; | 104 m_dispatchingList[i] = nullptr; |
| 105 sender->dispatchPendingEvent(this); | 105 sender->dispatchPendingEvent(this); |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 m_dispatchingList.clear(); | 108 m_dispatchingList.clear(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace WebCore | 111 } // namespace WebCore |
| 112 | 112 |
| 113 #endif // EventSender_h | 113 #endif // EventSender_h |
| OLD | NEW |