2018-08-07 21:20:34 +03:00
|
|
|
/* -*- 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"
|
2019-08-15 15:06:51 +03:00
|
|
|
#include "mozilla/ipc/CrashReporterHelper.h"
|
2018-08-07 21:20:34 +03:00
|
|
|
#include "mozilla/VsyncDispatcher.h"
|
2018-12-29 01:09:44 +03:00
|
|
|
#include "gfxVR.h"
|
2018-08-07 21:20:34 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
2019-04-02 08:13:17 +03:00
|
|
|
namespace dom {
|
|
|
|
class MemoryReportRequestHost;
|
|
|
|
} // namespace dom
|
2018-08-07 21:20:34 +03:00
|
|
|
namespace gfx {
|
|
|
|
|
|
|
|
class VRProcessParent;
|
|
|
|
class VRChild;
|
|
|
|
|
2019-08-15 15:06:51 +03:00
|
|
|
class VRChild final : public PVRChild,
|
|
|
|
public ipc::CrashReporterHelper<GeckoProcessType_VR>,
|
|
|
|
public gfxVarReceiver {
|
2019-04-02 08:13:17 +03:00
|
|
|
typedef mozilla::dom::MemoryReportRequestHost MemoryReportRequestHost;
|
2019-02-06 18:57:37 +03:00
|
|
|
friend class PVRChild;
|
|
|
|
|
2018-08-07 21:20:34 +03:00
|
|
|
public:
|
|
|
|
explicit VRChild(VRProcessParent* aHost);
|
|
|
|
~VRChild() = default;
|
|
|
|
|
|
|
|
static void Destroy(UniquePtr<VRChild>&& aChild);
|
|
|
|
void Init();
|
2019-04-02 08:13:15 +03:00
|
|
|
bool EnsureVRReady();
|
2018-08-07 21:20:34 +03:00
|
|
|
virtual void OnVarChanged(const GfxVarUpdate& aVar) override;
|
2019-04-02 08:13:17 +03:00
|
|
|
bool SendRequestMemoryReport(const uint32_t& aGeneration,
|
|
|
|
const bool& aAnonymize,
|
|
|
|
const bool& aMinimizeMemoryUsage,
|
|
|
|
const Maybe<ipc::FileDescriptor>& aDMDFile);
|
2018-08-07 21:20:34 +03:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvOpenVRControllerActionPathToParent(
|
|
|
|
const nsCString& aPath);
|
|
|
|
mozilla::ipc::IPCResult RecvOpenVRControllerManifestPathToParent(
|
|
|
|
const OpenVRControllerType& aType, const nsCString& aPath);
|
2019-04-02 08:13:15 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitComplete();
|
2018-08-07 21:20:34 +03:00
|
|
|
|
2019-04-02 08:13:17 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAddMemoryReport(const MemoryReport& aReport);
|
|
|
|
mozilla::ipc::IPCResult RecvFinishMemoryReport(const uint32_t& aGeneration);
|
|
|
|
|
2018-08-07 21:20:34 +03:00
|
|
|
private:
|
|
|
|
VRProcessParent* mHost;
|
2019-04-02 08:13:17 +03:00
|
|
|
UniquePtr<MemoryReportRequestHost> mMemoryReportRequest;
|
2019-04-02 08:13:15 +03:00
|
|
|
bool mVRReady;
|
2018-08-07 21:20:34 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace gfx
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2019-02-06 18:57:37 +03:00
|
|
|
#endif // GFX_VR_CHILD_H
|