Bug 1701221 [wpt PR 28260] - [cleanup] Remove myself from various READMEs and META...
[gecko.git] / gfx / ipc / GPUParent.h
blobb2051a4cc481d6d0d96f20a355b83793602be61a
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef _include_gfx_ipc_GPUParent_h__
7 #define _include_gfx_ipc_GPUParent_h__
9 #include "mozilla/RefPtr.h"
10 #include "mozilla/gfx/PGPUParent.h"
11 #include "mozilla/media/MediaUtils.h"
13 namespace mozilla {
15 class TimeStamp;
16 class ChildProfilerController;
18 namespace gfx {
20 class VsyncBridgeParent;
22 class GPUParent final : public PGPUParent {
23 public:
24 GPUParent();
25 ~GPUParent();
27 static GPUParent* GetSingleton();
29 AsyncBlockers& AsyncShutdownService() { return mShutdownBlockers; }
31 // Gets the name of the GPU process, in the format expected by about:memory.
32 // There must be a GPU process active, and the caller must be either in that
33 // process or the parent process.
34 static void GetGPUProcessName(nsACString& aStr);
36 // Check for memory pressure and notify the parent process if necessary.
37 static void MaybeFlushMemory();
39 bool Init(base::ProcessId aParentPid, const char* aParentBuildID,
40 MessageLoop* aIOLoop, UniquePtr<IPC::Channel> aChannel);
41 void NotifyDeviceReset();
43 already_AddRefed<PAPZInputBridgeParent> AllocPAPZInputBridgeParent(
44 const LayersId& aLayersId);
46 mozilla::ipc::IPCResult RecvInit(nsTArray<GfxVarUpdate>&& vars,
47 const DevicePrefs& devicePrefs,
48 nsTArray<LayerTreeIdMapping>&& mappings,
49 nsTArray<GfxInfoFeatureStatus>&& features);
50 mozilla::ipc::IPCResult RecvInitCompositorManager(
51 Endpoint<PCompositorManagerParent>&& aEndpoint);
52 mozilla::ipc::IPCResult RecvInitVsyncBridge(
53 Endpoint<PVsyncBridgeParent>&& aVsyncEndpoint);
54 mozilla::ipc::IPCResult RecvInitImageBridge(
55 Endpoint<PImageBridgeParent>&& aEndpoint);
56 mozilla::ipc::IPCResult RecvInitVideoBridge(
57 Endpoint<PVideoBridgeParent>&& aEndpoint);
58 mozilla::ipc::IPCResult RecvInitVRManager(
59 Endpoint<PVRManagerParent>&& aEndpoint);
60 mozilla::ipc::IPCResult RecvInitVR(Endpoint<PVRGPUChild>&& aVRGPUChild);
61 mozilla::ipc::IPCResult RecvInitUiCompositorController(
62 const LayersId& aRootLayerTreeId,
63 Endpoint<PUiCompositorControllerParent>&& aEndpoint);
64 mozilla::ipc::IPCResult RecvInitProfiler(
65 Endpoint<PProfilerChild>&& aEndpoint);
66 mozilla::ipc::IPCResult RecvUpdateVar(const GfxVarUpdate& pref);
67 mozilla::ipc::IPCResult RecvPreferenceUpdate(const Pref& pref);
68 mozilla::ipc::IPCResult RecvNewContentCompositorManager(
69 Endpoint<PCompositorManagerParent>&& aEndpoint);
70 mozilla::ipc::IPCResult RecvNewContentImageBridge(
71 Endpoint<PImageBridgeParent>&& aEndpoint);
72 mozilla::ipc::IPCResult RecvNewContentVRManager(
73 Endpoint<PVRManagerParent>&& aEndpoint);
74 mozilla::ipc::IPCResult RecvNewContentRemoteDecoderManager(
75 Endpoint<PRemoteDecoderManagerParent>&& aEndpoint);
76 mozilla::ipc::IPCResult RecvGetDeviceStatus(GPUDeviceData* aOutStatus);
77 mozilla::ipc::IPCResult RecvSimulateDeviceReset(GPUDeviceData* aOutStatus);
78 mozilla::ipc::IPCResult RecvAddLayerTreeIdMapping(
79 const LayerTreeIdMapping& aMapping);
80 mozilla::ipc::IPCResult RecvRemoveLayerTreeIdMapping(
81 const LayerTreeIdMapping& aMapping);
82 mozilla::ipc::IPCResult RecvNotifyGpuObservers(const nsCString& aTopic);
83 mozilla::ipc::IPCResult RecvRequestMemoryReport(
84 const uint32_t& generation, const bool& anonymize,
85 const bool& minimizeMemoryUsage,
86 const Maybe<ipc::FileDescriptor>& DMDFile,
87 const RequestMemoryReportResolver& aResolver);
88 mozilla::ipc::IPCResult RecvShutdownVR();
90 mozilla::ipc::IPCResult RecvUpdatePerfStatsCollectionMask(
91 const uint64_t& aMask);
92 mozilla::ipc::IPCResult RecvCollectPerfStatsJSON(
93 CollectPerfStatsJSONResolver&& aResolver);
95 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
96 mozilla::ipc::IPCResult RecvInitSandboxTesting(
97 Endpoint<PSandboxTestingChild>&& aEndpoint);
98 #endif
100 void ActorDestroy(ActorDestroyReason aWhy) override;
102 private:
103 const TimeStamp mLaunchTime;
104 RefPtr<VsyncBridgeParent> mVsyncBridge;
105 #ifdef MOZ_GECKO_PROFILER
106 RefPtr<ChildProfilerController> mProfilerController;
107 #endif
108 AsyncBlockers mShutdownBlockers;
111 } // namespace gfx
112 } // namespace mozilla
114 #endif // _include_gfx_ipc_GPUParent_h__