2016-06-11 05:27:24 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=99: */
|
|
|
|
/* 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;
|
|
|
|
|
2016-08-04 21:33:42 +03:00
|
|
|
class GPUChild final
|
2017-03-22 02:39:13 +03:00
|
|
|
: public PGPUChild
|
|
|
|
, public gfxVarReceiver
|
2016-06-11 05:27:24 +03:00
|
|
|
{
|
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();
|
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.
|
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;
|
2017-02-14 16:43:51 +03:00
|
|
|
|
2017-02-15 18:25:40 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAccumulateChildHistograms(InfallibleTArray<Accumulation>&& aAccumulations) override;
|
|
|
|
mozilla::ipc::IPCResult RecvAccumulateChildKeyedHistograms(InfallibleTArray<KeyedAccumulation>&& 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;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
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_
|