Bug 1886946: Remove incorrect assertion that buffer is not-pinned. r=sfink
[gecko.git] / dom / ipc / VsyncMainChild.h
blobf5678ab0e9c874fd85ba6eac49ddb1d2e4f71042
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/. */
7 #ifndef mozilla_dom_ipc_VsyncMainChild_h
8 #define mozilla_dom_ipc_VsyncMainChild_h
10 #include "mozilla/dom/VsyncChild.h"
11 #include "nsTObserverArray.h"
13 namespace mozilla {
15 class VsyncObserver;
17 namespace dom {
19 // The PVsyncChild actor receives a vsync event from the main process and
20 // delivers it to the child process. Currently this is restricted to the main
21 // thread only. The actor will stay alive until the process dies or its
22 // PVsyncParent actor dies.
23 class VsyncMainChild final : public VsyncChild {
24 NS_INLINE_DECL_REFCOUNTING(VsyncMainChild, override)
26 friend class PVsyncChild;
28 public:
29 VsyncMainChild();
31 void AddChildRefreshTimer(VsyncObserver* aVsyncObserver);
32 void RemoveChildRefreshTimer(VsyncObserver* aVsyncObserver);
34 TimeDuration GetVsyncRate();
36 private:
37 ~VsyncMainChild() override;
39 mozilla::ipc::IPCResult RecvNotify(const VsyncEvent& aVsync,
40 const float& aVsyncRate) override;
41 void ActorDestroy(ActorDestroyReason aActorDestroyReason) override;
43 bool mIsShutdown;
44 TimeDuration mVsyncRate;
45 nsTObserverArray<VsyncObserver*> mObservers;
48 } // namespace dom
49 } // namespace mozilla
51 #endif // mozilla_dom_ipc_VsyncChild_h