mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-21 17:59:34 +00:00

MozReview-Commit-ID: DE5HkIhsZ6D --HG-- extra : rebase_source : 94831c1e13a840dd2ea0600f64bcf70c2bf938d9 extra : source : cf9283bf1b0bca3a6311c98e227329d451f80ecb
50 lines
1.7 KiB
C++
50 lines
1.7 KiB
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef mozilla_EventQueue_h
|
|
#define mozilla_EventQueue_h
|
|
|
|
#include "mozilla/AbstractEventQueue.h"
|
|
#include "mozilla/Queue.h"
|
|
#include "nsCOMPtr.h"
|
|
|
|
class nsIRunnable;
|
|
|
|
namespace mozilla {
|
|
|
|
class EventQueue final : public AbstractEventQueue
|
|
{
|
|
public:
|
|
static const bool SupportsPrioritization = false;
|
|
|
|
EventQueue() {}
|
|
explicit EventQueue(EventPriority aPriority);
|
|
|
|
void PutEvent(already_AddRefed<nsIRunnable>&& aEvent,
|
|
EventPriority aPriority,
|
|
const MutexAutoLock& aProofOfLock) final;
|
|
already_AddRefed<nsIRunnable> GetEvent(EventPriority* aPriority,
|
|
const MutexAutoLock& aProofOfLock) final;
|
|
|
|
bool IsEmpty(const MutexAutoLock& aProofOfLock) final;
|
|
bool HasReadyEvent(const MutexAutoLock& aProofOfLock) final;
|
|
|
|
size_t Count(const MutexAutoLock& aProofOfLock) const final;
|
|
already_AddRefed<nsIRunnable> PeekEvent(const MutexAutoLock& aProofOfLock);
|
|
|
|
void EnableInputEventPrioritization(const MutexAutoLock& aProofOfLock) final {}
|
|
void FlushInputEventPrioritization(const MutexAutoLock& aProofOfLock) final {}
|
|
void SuspendInputEventPrioritization(const MutexAutoLock& aProofOfLock) final {}
|
|
void ResumeInputEventPrioritization(const MutexAutoLock& aProofOfLock) final {}
|
|
|
|
private:
|
|
mozilla::Queue<nsCOMPtr<nsIRunnable>> mQueue;
|
|
};
|
|
|
|
} // namespace mozilla
|
|
|
|
#endif // mozilla_EventQueue_h
|