gfx/vr/ipc/VRChild.h
author Daosheng Mu <daoshengmu@gmail.com>
Fri, 28 Dec 2018 22:09:44 +0000
changeset 509582 ec8667678f3a7fa4d6259b070a35a4c4a5c14209
parent 505383 6f3709b3878117466168c40affa7bca0b60cf75b
child 512074 d3fc75eaf96015d7b5ec0ac88331d588ee0e6575
permissions -rw-r--r--
Bug 1430040 - Part 4: Make the parent process keep the OpenVR controller manifest info when VR process is enabled. r=kip Differential Revision: https://phabricator.services.mozilla.com/D15419

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_VR_CHILD_H
#define GFX_VR_CHILD_H

#include "mozilla/gfx/PVRChild.h"
#include "mozilla/gfx/gfxVarReceiver.h"
#include "mozilla/VsyncDispatcher.h"
#include "gfxVR.h"

namespace mozilla {
namespace gfx {

class VRProcessParent;
class VRChild;

class VRChild final : public PVRChild, public gfxVarReceiver {
 public:
  explicit VRChild(VRProcessParent* aHost);
  ~VRChild() = default;

  static void Destroy(UniquePtr<VRChild>&& aChild);
  void Init();
  virtual void OnVarChanged(const GfxVarUpdate& aVar) override;

 protected:
  virtual void ActorDestroy(ActorDestroyReason aWhy) override;
  virtual mozilla::ipc::IPCResult RecvOpenVRControllerActionPathToParent(
      const nsCString& aPath) override;
  virtual mozilla::ipc::IPCResult RecvOpenVRControllerManifestPathToParent(
      const OpenVRControllerType& aType, const nsCString& aPath) override;

 private:
  VRProcessParent* mHost;
};

}  // namespace gfx
}  // namespace mozilla

#endif  // GFX_VR_CHILD_H