2017-10-28 02:10:06 +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: */
|
2016-06-11 05:27:24 +03:00
|
|
|
/* 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 _include_mozilla_gfx_ipc_GPUChild_h_
|
|
|
|
#define _include_mozilla_gfx_ipc_GPUChild_h_
|
|
|
|
|
2016-07-19 21:56:06 +03:00
|
|
|
#include "mozilla/RefPtr.h"
|
2016-06-11 05:37:03 +03:00
|
|
|
#include "mozilla/UniquePtr.h"
|
2016-07-19 21:56:06 +03:00
|
|
|
#include "mozilla/gfx/PGPUChild.h"
|
2016-08-04 21:33:42 +03:00
|
|
|
#include "mozilla/gfx/gfxVarReceiver.h"
|
2016-06-11 05:27:24 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
2017-03-22 02:39:13 +03:00
|
|
|
|
2016-10-12 00:25:41 +03:00
|
|
|
namespace ipc {
|
|
|
|
class CrashReporterHost;
|
2017-01-27 03:35:54 +03:00
|
|
|
} // namespace ipc
|
|
|
|
namespace dom {
|
|
|
|
class MemoryReportRequestHost;
|
|
|
|
} // namespace dom
|
2016-06-11 05:27:24 +03:00
|
|
|
namespace gfx {
|
|
|
|
|
2016-06-11 05:37:03 +03:00
|
|
|
class GPUProcessHost;
|
|
|
|
|
2017-03-22 02:39:13 +03:00
|
|
|
class GPUChild final : public PGPUChild, public gfxVarReceiver {
|
2017-01-27 03:35:54 +03:00
|
|
|
typedef mozilla::dom::MemoryReportRequestHost MemoryReportRequestHost;
|
|
|
|
|
2016-06-11 05:27:24 +03:00
|
|
|
public:
|
2016-06-11 05:37:03 +03:00
|
|
|
explicit GPUChild(GPUProcessHost* aHost);
|
2016-06-11 05:27:24 +03:00
|
|
|
~GPUChild();
|
2016-06-11 05:37:03 +03:00
|
|
|
|
2016-06-27 09:33:20 +03:00
|
|
|
void Init();
|
|
|
|
|
2017-03-30 04:23:24 +03:00
|
|
|
bool EnsureGPUReady();
|
2018-08-07 08:47:18 +03:00
|
|
|
base::ProcessHandle GetChildProcessHandle();
|
2016-08-21 06:59:11 +03:00
|
|
|
|
2019-02-06 18:58:07 +03:00
|
|
|
PAPZInputBridgeChild* AllocPAPZInputBridgeChild(const LayersId& aLayersId);
|
|
|
|
bool DeallocPAPZInputBridgeChild(PAPZInputBridgeChild* aActor);
|
2018-03-16 23:28:19 +03:00
|
|
|
|
2016-08-04 21:33:42 +03:00
|
|
|
// gfxVarReceiver overrides.
|
|
|
|
void OnVarChanged(const GfxVarUpdate& aVar) override;
|
2016-06-11 05:37:03 +03:00
|
|
|
|
2016-08-04 21:33:42 +03:00
|
|
|
// PGPUChild overrides.
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitComplete(const GPUDeviceData& aData) override;
|
|
|
|
mozilla::ipc::IPCResult RecvReportCheckerboard(
|
|
|
|
const uint32_t& aSeverity, const nsCString& aLog) override;
|
2017-02-16 01:44:29 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitCrashReporter(
|
|
|
|
Shmem&& shmem, const NativeThreadId& aThreadId) override;
|
2018-08-07 08:47:18 +03:00
|
|
|
mozilla::ipc::IPCResult RecvCreateVRProcess() override;
|
2019-01-03 23:28:52 +03:00
|
|
|
mozilla::ipc::IPCResult RecvShutdownVRProcess() override;
|
2017-02-14 16:43:51 +03:00
|
|
|
|
2017-09-13 12:20:36 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAccumulateChildHistograms(
|
|
|
|
InfallibleTArray<HistogramAccumulation>&& aAccumulations) override;
|
|
|
|
mozilla::ipc::IPCResult RecvAccumulateChildKeyedHistograms(
|
|
|
|
InfallibleTArray<KeyedHistogramAccumulation>&& aAccumulations) override;
|
2017-01-16 07:12:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUpdateChildScalars(
|
|
|
|
InfallibleTArray<ScalarAction>&& aScalarActions) override;
|
|
|
|
mozilla::ipc::IPCResult RecvUpdateChildKeyedScalars(
|
|
|
|
InfallibleTArray<KeyedScalarAction>&& aScalarActions) override;
|
2017-02-14 16:43:51 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRecordChildEvents(
|
|
|
|
nsTArray<ChildEventData>&& events) override;
|
2017-06-09 16:53:42 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRecordDiscardedData(
|
|
|
|
const DiscardedData& aDiscardedData) override;
|
2017-02-14 16:43:51 +03:00
|
|
|
|
2016-06-11 05:37:03 +03:00
|
|
|
void ActorDestroy(ActorDestroyReason aWhy) override;
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvGraphicsError(const nsCString& aError) override;
|
|
|
|
mozilla::ipc::IPCResult RecvNotifyUiObservers(
|
|
|
|
const nsCString& aTopic) override;
|
2017-04-05 10:17:36 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNotifyDeviceReset(
|
|
|
|
const GPUDeviceData& aData) override;
|
2017-01-27 03:35:54 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAddMemoryReport(
|
|
|
|
const MemoryReport& aReport) override;
|
|
|
|
mozilla::ipc::IPCResult RecvFinishMemoryReport(
|
|
|
|
const uint32_t& aGeneration) override;
|
2017-06-24 00:23:12 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUpdateFeature(
|
|
|
|
const Feature& aFeature, const FeatureFailure& aChange) override;
|
2017-07-11 10:13:26 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUsedFallback(const Fallback& aFallback,
|
|
|
|
const nsCString& aMessage) override;
|
2017-07-20 19:49:28 +03:00
|
|
|
mozilla::ipc::IPCResult RecvBHRThreadHang(
|
|
|
|
const HangDetails& aDetails) override;
|
2017-01-27 03:35:54 +03:00
|
|
|
|
|
|
|
bool SendRequestMemoryReport(const uint32_t& aGeneration,
|
|
|
|
const bool& aAnonymize,
|
|
|
|
const bool& aMinimizeMemoryUsage,
|
|
|
|
const MaybeFileDesc& aDMDFile);
|
2016-06-11 05:37:03 +03:00
|
|
|
|
2016-08-04 21:33:42 +03:00
|
|
|
static void Destroy(UniquePtr<GPUChild>&& aChild);
|
|
|
|
|
2016-06-11 05:37:03 +03:00
|
|
|
private:
|
|
|
|
GPUProcessHost* mHost;
|
2016-10-12 00:25:41 +03:00
|
|
|
UniquePtr<ipc::CrashReporterHost> mCrashReporter;
|
2017-01-27 03:35:54 +03:00
|
|
|
UniquePtr<MemoryReportRequestHost> mMemoryReportRequest;
|
2016-08-21 06:59:11 +03:00
|
|
|
bool mGPUReady;
|
2016-06-11 05:27:24 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace gfx
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // _include_mozilla_gfx_ipc_GPUChild_h_
|