| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Victor Carbune (victor@rosedu.org) | 2 * Copyright (C) 2012 Victor Carbune (victor@rosedu.org) |
| 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 19 matching lines...) Expand all Loading... |
| 30 #include "core/events/EventQueue.h" | 30 #include "core/events/EventQueue.h" |
| 31 #include "core/events/EventTarget.h" | 31 #include "core/events/EventTarget.h" |
| 32 #include "platform/Timer.h" | 32 #include "platform/Timer.h" |
| 33 #include "wtf/PassOwnPtr.h" | 33 #include "wtf/PassOwnPtr.h" |
| 34 #include "wtf/RefPtr.h" | 34 #include "wtf/RefPtr.h" |
| 35 #include "wtf/Vector.h" | 35 #include "wtf/Vector.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class CORE_EXPORT GenericEventQueue final : public EventQueue { | 39 class CORE_EXPORT GenericEventQueue final : public EventQueue { |
| 40 USING_FAST_MALLOC_WILL_BE_REMOVED(GenericEventQueue); | |
| 41 public: | 40 public: |
| 42 static PassOwnPtrWillBeRawPtr<GenericEventQueue> create(EventTarget*); | 41 static RawPtr<GenericEventQueue> create(EventTarget*); |
| 43 ~GenericEventQueue() override; | 42 ~GenericEventQueue() override; |
| 44 | 43 |
| 45 // EventQueue | 44 // EventQueue |
| 46 DECLARE_VIRTUAL_TRACE(); | 45 DECLARE_VIRTUAL_TRACE(); |
| 47 bool enqueueEvent(PassRefPtrWillBeRawPtr<Event>) override; | 46 bool enqueueEvent(RawPtr<Event>) override; |
| 48 bool cancelEvent(Event*) override; | 47 bool cancelEvent(Event*) override; |
| 49 void close() override; | 48 void close() override; |
| 50 | 49 |
| 51 void cancelAllEvents(); | 50 void cancelAllEvents(); |
| 52 bool hasPendingEvents() const; | 51 bool hasPendingEvents() const; |
| 53 | 52 |
| 54 private: | 53 private: |
| 55 explicit GenericEventQueue(EventTarget*); | 54 explicit GenericEventQueue(EventTarget*); |
| 56 void timerFired(Timer<GenericEventQueue>*); | 55 void timerFired(Timer<GenericEventQueue>*); |
| 57 | 56 |
| 58 RawPtrWillBeMember<EventTarget> m_owner; | 57 Member<EventTarget> m_owner; |
| 59 WillBeHeapVector<RefPtrWillBeMember<Event>> m_pendingEvents; | 58 HeapVector<Member<Event>> m_pendingEvents; |
| 60 Timer<GenericEventQueue> m_timer; | 59 Timer<GenericEventQueue> m_timer; |
| 61 | 60 |
| 62 bool m_isClosed; | 61 bool m_isClosed; |
| 63 }; | 62 }; |
| 64 | 63 |
| 65 } // namespace blink | 64 } // namespace blink |
| 66 | 65 |
| 67 #endif | 66 #endif |
| OLD | NEW |