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"
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
;
31 void AddChildRefreshTimer(VsyncObserver
* aVsyncObserver
);
32 void RemoveChildRefreshTimer(VsyncObserver
* aVsyncObserver
);
34 TimeDuration
GetVsyncRate();
37 ~VsyncMainChild() override
;
39 mozilla::ipc::IPCResult
RecvNotify(const VsyncEvent
& aVsync
,
40 const float& aVsyncRate
) override
;
41 void ActorDestroy(ActorDestroyReason aActorDestroyReason
) override
;
44 TimeDuration mVsyncRate
;
45 nsTObserverArray
<VsyncObserver
*> mObservers
;
49 } // namespace mozilla
51 #endif // mozilla_dom_ipc_VsyncChild_h