VsyncBridgeParent.h (1360B)
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_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 public: 21 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VsyncBridgeParent, final) 22 23 static RefPtr<VsyncBridgeParent> Start( 24 Endpoint<PVsyncBridgeParent>&& aEndpoint); 25 26 mozilla::ipc::IPCResult RecvNotifyVsync(const VsyncEvent& aVsync, 27 const LayersId& aLayersId); 28 void ActorDestroy(ActorDestroyReason aWhy) 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