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 #ifndef include_gfx_ipc_VsyncBridgeChild_h
7 #define include_gfx_ipc_VsyncBridgeChild_h
9 #include "mozilla/RefPtr.h"
10 #include "mozilla/gfx/PVsyncBridgeChild.h"
15 class VsyncIOThreadHolder
;
17 class VsyncBridgeChild final
: public PVsyncBridgeChild
{
18 friend class NotifyVsyncTask
;
21 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VsyncBridgeChild
)
23 static RefPtr
<VsyncBridgeChild
> Create(
24 RefPtr
<VsyncIOThreadHolder
> aThread
, const uint64_t& aProcessToken
,
25 Endpoint
<PVsyncBridgeChild
>&& aEndpoint
);
29 void ActorDestroy(ActorDestroyReason aWhy
) override
;
30 void ActorDealloc() override
;
31 void ProcessingError(Result aCode
, const char* aReason
) override
;
33 void NotifyVsync(const VsyncEvent
& aVsync
, const layers::LayersId
& aLayersId
);
35 void HandleFatalError(const char* aMsg
) const override
;
38 VsyncBridgeChild(RefPtr
<VsyncIOThreadHolder
>, const uint64_t& aProcessToken
);
39 virtual ~VsyncBridgeChild();
41 void Open(Endpoint
<PVsyncBridgeChild
>&& aEndpoint
);
43 void NotifyVsyncImpl(const VsyncEvent
& aVsync
,
44 const layers::LayersId
& aLayersId
);
46 bool IsOnVsyncIOThread() const;
49 RefPtr
<VsyncIOThreadHolder
> mThread
;
50 uint64_t mProcessToken
;
54 } // namespace mozilla
56 #endif // include_gfx_ipc_VsyncBridgeChild_h