/work/obj-fuzz/dist/include/mozilla/EventQueue.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef mozilla_EventQueue_h |
8 | | #define mozilla_EventQueue_h |
9 | | |
10 | | #include "mozilla/AbstractEventQueue.h" |
11 | | #include "mozilla/Queue.h" |
12 | | #include "nsCOMPtr.h" |
13 | | |
14 | | class nsIRunnable; |
15 | | |
16 | | namespace mozilla { |
17 | | |
18 | | class EventQueue final : public AbstractEventQueue |
19 | | { |
20 | | public: |
21 | | static const bool SupportsPrioritization = false; |
22 | | |
23 | 50 | EventQueue() {} |
24 | | explicit EventQueue(EventPriority aPriority); |
25 | | |
26 | | void PutEvent(already_AddRefed<nsIRunnable>&& aEvent, |
27 | | EventPriority aPriority, |
28 | | const MutexAutoLock& aProofOfLock) final; |
29 | | already_AddRefed<nsIRunnable> GetEvent(EventPriority* aPriority, |
30 | | const MutexAutoLock& aProofOfLock) final; |
31 | | |
32 | | bool IsEmpty(const MutexAutoLock& aProofOfLock) final; |
33 | | bool HasReadyEvent(const MutexAutoLock& aProofOfLock) final; |
34 | | |
35 | | size_t Count(const MutexAutoLock& aProofOfLock) const final; |
36 | | already_AddRefed<nsIRunnable> PeekEvent(const MutexAutoLock& aProofOfLock); |
37 | | |
38 | 0 | void EnableInputEventPrioritization(const MutexAutoLock& aProofOfLock) final {} |
39 | 0 | void FlushInputEventPrioritization(const MutexAutoLock& aProofOfLock) final {} |
40 | 0 | void SuspendInputEventPrioritization(const MutexAutoLock& aProofOfLock) final {} |
41 | 0 | void ResumeInputEventPrioritization(const MutexAutoLock& aProofOfLock) final {} |
42 | | |
43 | | size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override |
44 | 0 | { |
45 | 0 | return mQueue.ShallowSizeOfExcludingThis(aMallocSizeOf); |
46 | 0 | } |
47 | | |
48 | | private: |
49 | | mozilla::Queue<nsCOMPtr<nsIRunnable>> mQueue; |
50 | | }; |
51 | | |
52 | | } // namespace mozilla |
53 | | |
54 | | #endif // mozilla_EventQueue_h |