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"
|
2019-08-15 15:06:51 +03:00
|
|
|
#include "mozilla/ipc/CrashReporterHelper.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
|
|
|
|
2017-01-27 03:35:54 +03:00
|
|
|
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;
|
|
|
|
|
2019-08-15 15:06:51 +03:00
|
|
|
class GPUChild final : public ipc::CrashReporterHelper<GeckoProcessType_GPU>,
|
|
|
|
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);
|
2019-04-11 15:36:51 +03:00
|
|
|
virtual ~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
|
|
|
|
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.
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitComplete(const GPUDeviceData& aData);
|
2021-05-06 22:47:38 +03:00
|
|
|
mozilla::ipc::IPCResult RecvDeclareStable();
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvReportCheckerboard(const uint32_t& aSeverity,
|
|
|
|
const nsCString& aLog);
|
|
|
|
mozilla::ipc::IPCResult RecvCreateVRProcess();
|
|
|
|
mozilla::ipc::IPCResult RecvShutdownVRProcess();
|
2017-02-14 16:43:51 +03:00
|
|
|
|
2017-09-13 12:20:36 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAccumulateChildHistograms(
|
2019-07-10 06:29:05 +03:00
|
|
|
nsTArray<HistogramAccumulation>&& aAccumulations);
|
2017-09-13 12:20:36 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAccumulateChildKeyedHistograms(
|
2019-07-10 06:29:05 +03:00
|
|
|
nsTArray<KeyedHistogramAccumulation>&& aAccumulations);
|
2017-01-16 07:12:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUpdateChildScalars(
|
2019-07-10 06:29:05 +03:00
|
|
|
nsTArray<ScalarAction>&& aScalarActions);
|
2017-01-16 07:12:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUpdateChildKeyedScalars(
|
2019-07-10 06:29:05 +03:00
|
|
|
nsTArray<KeyedScalarAction>&& aScalarActions);
|
2017-02-14 16:43:51 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRecordChildEvents(
|
2019-02-06 18:58:43 +03:00
|
|
|
nsTArray<ChildEventData>&& events);
|
2017-06-09 16:53:42 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRecordDiscardedData(
|
2019-02-06 18:58:43 +03:00
|
|
|
const DiscardedData& aDiscardedData);
|
2017-02-14 16:43:51 +03:00
|
|
|
|
2016-06-11 05:37:03 +03:00
|
|
|
void ActorDestroy(ActorDestroyReason aWhy) override;
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvGraphicsError(const nsCString& aError);
|
|
|
|
mozilla::ipc::IPCResult RecvNotifyUiObservers(const nsCString& aTopic);
|
|
|
|
mozilla::ipc::IPCResult RecvNotifyDeviceReset(const GPUDeviceData& aData);
|
2021-02-25 18:38:45 +03:00
|
|
|
mozilla::ipc::IPCResult RecvFlushMemory(const nsString& aReason);
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAddMemoryReport(const MemoryReport& aReport);
|
|
|
|
mozilla::ipc::IPCResult RecvUpdateFeature(const Feature& aFeature,
|
|
|
|
const FeatureFailure& aChange);
|
2017-07-11 10:13:26 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUsedFallback(const Fallback& aFallback,
|
2019-02-06 18:58:43 +03:00
|
|
|
const nsCString& aMessage);
|
|
|
|
mozilla::ipc::IPCResult RecvBHRThreadHang(const HangDetails& aDetails);
|
2021-01-06 12:05:31 +03:00
|
|
|
mozilla::ipc::IPCResult RecvUpdateMediaCodecsSupported(
|
|
|
|
const PDMFactory::MediaCodecsSupported& aSupported);
|
2017-01-27 03:35:54 +03:00
|
|
|
|
|
|
|
bool SendRequestMemoryReport(const uint32_t& aGeneration,
|
|
|
|
const bool& aAnonymize,
|
|
|
|
const bool& aMinimizeMemoryUsage,
|
2019-03-01 00:20:40 +03:00
|
|
|
const Maybe<ipc::FileDescriptor>& 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;
|
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_
|