From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- ipc/glue/UtilityProcessChild.h | 104 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 ipc/glue/UtilityProcessChild.h (limited to 'ipc/glue/UtilityProcessChild.h') diff --git a/ipc/glue/UtilityProcessChild.h b/ipc/glue/UtilityProcessChild.h new file mode 100644 index 0000000000..423922cafc --- /dev/null +++ b/ipc/glue/UtilityProcessChild.h @@ -0,0 +1,104 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* 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_ipc_glue_UtilityProcessChild_h_ +#define _include_ipc_glue_UtilityProcessChild_h_ +#include "mozilla/ipc/PUtilityProcessChild.h" +#include "mozilla/ipc/UtilityProcessSandboxing.h" +#include "mozilla/ipc/UtilityAudioDecoderParent.h" +#include "mozilla/UniquePtr.h" +#include "ChildProfilerController.h" + +#include "mozilla/PRemoteDecoderManagerParent.h" +#include "mozilla/ipc/AsyncBlockers.h" +#include "mozilla/dom/JSOracleChild.h" +#include "mozilla/ProfilerMarkers.h" + +namespace mozilla::dom { +class PJSOracleChild; +} // namespace mozilla::dom + +namespace mozilla::ipc { + +class UtilityProcessHost; + +class UtilityProcessChild final : public PUtilityProcessChild { + public: + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(UtilityProcessChild, override); + + UtilityProcessChild(); + + static RefPtr GetSingleton(); + static RefPtr Get(); + + SandboxingKind mSandbox{}; + + bool Init(mozilla::ipc::UntypedEndpoint&& aEndpoint, + const nsCString& aParentBuildID, uint64_t aSandboxingKind); + + mozilla::ipc::IPCResult RecvInit(const Maybe& aBrokerFd, + const bool& aCanRecordReleaseTelemetry, + const bool& aIsReadyForBackgroundProcessing); + mozilla::ipc::IPCResult RecvInitProfiler( + Endpoint&& aEndpoint); + + mozilla::ipc::IPCResult RecvPreferenceUpdate(const Pref& pref); + + mozilla::ipc::IPCResult RecvRequestMemoryReport( + const uint32_t& generation, const bool& anonymize, + const bool& minimizeMemoryUsage, + const Maybe& DMDFile, + const RequestMemoryReportResolver& aResolver); + + mozilla::ipc::IPCResult RecvFlushFOGData(FlushFOGDataResolver&& aResolver); + + mozilla::ipc::IPCResult RecvTestTriggerMetrics( + TestTriggerMetricsResolver&& aResolve); + + mozilla::ipc::IPCResult RecvTestTelemetryProbes(); + + mozilla::ipc::IPCResult RecvStartUtilityAudioDecoderService( + Endpoint&& aEndpoint); + + mozilla::ipc::IPCResult RecvStartJSOracleService( + Endpoint&& aEndpoint); + +#if defined(XP_WIN) + mozilla::ipc::IPCResult RecvStartWindowsUtilsService( + Endpoint&& aEndpoint); + + mozilla::ipc::IPCResult RecvGetUntrustedModulesData( + GetUntrustedModulesDataResolver&& aResolver); + mozilla::ipc::IPCResult RecvUnblockUntrustedModulesThread(); +#endif // defined(XP_WIN) + + AsyncBlockers& AsyncShutdownService() { return mShutdownBlockers; } + + void ActorDestroy(ActorDestroyReason aWhy) override; + +#if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS) + mozilla::ipc::IPCResult RecvInitSandboxTesting( + Endpoint&& aEndpoint); +#endif + + protected: + friend class UtilityProcessImpl; + ~UtilityProcessChild(); + + private: + TimeStamp mChildStartTime; + RefPtr mProfilerController; + RefPtr mUtilityAudioDecoderInstance{}; + RefPtr mJSOracleInstance{}; +#ifdef XP_WIN + RefPtr mWindowsUtilsInstance; +#endif + + AsyncBlockers mShutdownBlockers; +}; + +} // namespace mozilla::ipc + +#endif // _include_ipc_glue_UtilityProcessChild_h_ -- cgit v1.2.3