tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

VRParent.h (2235B)


      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 
      7 #ifndef GFX_VR_PARENT_H
      8 #define GFX_VR_PARENT_H
      9 
     10 #include "mozilla/gfx/PVRParent.h"
     11 #include "VRGPUParent.h"
     12 
     13 namespace mozilla {
     14 namespace gfx {
     15 
     16 class VRService;
     17 class VRSystemManagerExternal;
     18 
     19 class VRParent final : public PVRParent {
     20  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VRParent, final);
     21 
     22  friend class PVRParent;
     23 
     24 public:
     25  explicit VRParent();
     26 
     27  bool Init(mozilla::ipc::UntypedEndpoint&& aEndpoint,
     28            const char* aParentBuildID);
     29  virtual void ActorDestroy(ActorDestroyReason aWhy) override;
     30  bool GetOpenVRControllerActionPath(nsCString* aPath);
     31  bool GetOpenVRControllerManifestPath(VRControllerType aType,
     32                                       nsCString* aPath);
     33 
     34 protected:
     35  ~VRParent() = default;
     36 
     37  mozilla::ipc::IPCResult RecvNewGPUVRManager(
     38      Endpoint<PVRGPUParent>&& aEndpoint);
     39  mozilla::ipc::IPCResult RecvInit(nsTArray<GfxVarUpdate>&& vars,
     40                                   const DevicePrefs& devicePrefs);
     41  mozilla::ipc::IPCResult RecvNotifyVsync(const TimeStamp& vsyncTimestamp);
     42  mozilla::ipc::IPCResult RecvUpdateVar(const nsTArray<GfxVarUpdate>& var);
     43  mozilla::ipc::IPCResult RecvPreferenceUpdate(const Pref& pref);
     44  mozilla::ipc::IPCResult RecvOpenVRControllerActionPathToVR(
     45      const nsCString& aPath);
     46  mozilla::ipc::IPCResult RecvOpenVRControllerManifestPathToVR(
     47      const VRControllerType& aType, const nsCString& aPath);
     48  mozilla::ipc::IPCResult RecvRequestMemoryReport(
     49      const uint32_t& generation, const bool& anonymize,
     50      const bool& minimizeMemoryUsage,
     51      const Maybe<ipc::FileDescriptor>& DMDFile,
     52      const RequestMemoryReportResolver& aResolver);
     53 
     54 private:
     55  nsCString mOpenVRControllerAction;
     56  nsTHashMap<nsUint32HashKey, nsCString> mOpenVRControllerManifest;
     57  RefPtr<VRGPUParent> mVRGPUParent;
     58  DISALLOW_COPY_AND_ASSIGN(VRParent);
     59 };
     60 
     61 }  // namespace gfx
     62 }  // namespace mozilla
     63 
     64 #endif  // GFX_VR_PARENT_H