Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /* vim: set ts=8 sts=2 et sw=2 tw=99: */
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_VsyncBridgeParent_h
7 : #define include_gfx_ipc_VsyncBridgeParent_h
8 :
9 : #include "mozilla/RefPtr.h"
10 : #include "mozilla/gfx/PVsyncBridgeParent.h"
11 :
12 : namespace mozilla {
13 : namespace layers {
14 : class CompositorThreadHolder;
15 : } // namespace layers
16 :
17 : namespace gfx {
18 :
19 : class VsyncBridgeParent final : public PVsyncBridgeParent
20 : {
21 : public:
22 0 : NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VsyncBridgeParent)
23 :
24 : static RefPtr<VsyncBridgeParent> Start(Endpoint<PVsyncBridgeParent>&& aEndpoint);
25 :
26 : mozilla::ipc::IPCResult RecvNotifyVsync(const TimeStamp& vsyncTimeStamp, const uint64_t& aLayersId) override;
27 : void ActorDestroy(ActorDestroyReason aWhy) override;
28 : void DeallocPVsyncBridgeParent() override;
29 :
30 : void Shutdown();
31 :
32 : private:
33 : VsyncBridgeParent();
34 : ~VsyncBridgeParent();
35 :
36 : void Open(Endpoint<PVsyncBridgeParent>&& aEndpoint);
37 : void ShutdownImpl();
38 :
39 : private:
40 : bool mOpen;
41 : RefPtr<layers::CompositorThreadHolder> mCompositorThreadRef;
42 : };
43 :
44 : } // namespace gfx
45 : } // namespace mozilla
46 :
47 : #endif // include_gfx_ipc_VsyncBridgeParent_h
|