summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/GenericEventQueue.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/dom/GenericEventQueue.h')
-rw-r--r--Source/WebCore/dom/GenericEventQueue.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/Source/WebCore/dom/GenericEventQueue.h b/Source/WebCore/dom/GenericEventQueue.h
index ea68a5a32..45b9e8203 100644
--- a/Source/WebCore/dom/GenericEventQueue.h
+++ b/Source/WebCore/dom/GenericEventQueue.h
@@ -10,10 +10,10 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
@@ -23,39 +23,42 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef GenericEventQueue_h
-#define GenericEventQueue_h
+#pragma once
-#include "Timer.h"
+#include "GenericTaskQueue.h"
+#include <wtf/Deque.h>
#include <wtf/Forward.h>
#include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
+#include <wtf/WeakPtr.h>
namespace WebCore {
class Event;
class EventTarget;
+class Timer;
class GenericEventQueue {
public:
explicit GenericEventQueue(EventTarget&);
~GenericEventQueue();
- bool enqueueEvent(PassRefPtr<Event>);
+ void enqueueEvent(RefPtr<Event>&&);
void close();
void cancelAllEvents();
bool hasPendingEvents() const;
+ void suspend();
+ void resume();
+
private:
- void timerFired(Timer<GenericEventQueue>&);
+ void dispatchOneEvent();
EventTarget& m_owner;
- Vector<RefPtr<Event>> m_pendingEvents;
- Timer<GenericEventQueue> m_timer;
+ GenericTaskQueue<Timer> m_taskQueue;
+ Deque<RefPtr<Event>> m_pendingEvents;
bool m_isClosed;
+ bool m_isSuspended { false };
};
-}
-
-#endif
+} // namespace WebCore