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