Bug 1891340 - Part 1: Add parameters to customize the before and after icon tints...
[gecko.git] / ipc / glue / PUtilityProcess.ipdl
blobbe8b4395146e326d13bde14d07e2c418b14df1bb
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 include MemoryReportTypes;
7 include PrefsTypes;
9 include protocol PProfiler;
10 include protocol PUtilityAudioDecoder;
11 include protocol PJSOracle;
13 #if defined(XP_WIN)
14 include protocol PWindowsUtils;
15 include protocol PWinFileDialog;
16 #endif
18 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
19 include protocol PSandboxTesting;
20 #endif
22 include "mozilla/ipc/ByteBufUtils.h";
24 include GraphicsMessages;
26 using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
28 // Telemetry
29 using mozilla::Telemetry::HistogramAccumulation from "mozilla/TelemetryComms.h";
30 using mozilla::Telemetry::KeyedHistogramAccumulation from "mozilla/TelemetryComms.h";
31 using mozilla::Telemetry::ScalarAction from "mozilla/TelemetryComms.h";
32 using mozilla::Telemetry::KeyedScalarAction from "mozilla/TelemetryComms.h";
33 using mozilla::Telemetry::ChildEventData from "mozilla/TelemetryComms.h";
34 using mozilla::Telemetry::DiscardedData from "mozilla/TelemetryComms.h";
36 #if defined(XP_WIN)
37 [MoveOnly] using mozilla::UntrustedModulesData from "mozilla/UntrustedModulesData.h";
38 [MoveOnly] using mozilla::ModulePaths from "mozilla/UntrustedModulesData.h";
39 [MoveOnly] using mozilla::ModulesMapResult from "mozilla/UntrustedModulesData.h";
40 #endif  // defined(XP_WIN)
42 namespace mozilla {
44 namespace ipc {
46 // This protocol allows the UI process to talk to the Utility process. There is
47 // one instance of this protocol, with the UtilityProcessParent living on the main thread
48 // of the main process and the UtilityProcessChild living on the main thread of the Utility
49 // process.
50 [NeedsOtherPid, ChildProc=Utility]
51 protocol PUtilityProcess
53 parent:
54   async InitCrashReporter(NativeThreadId threadId);
56   async AddMemoryReport(MemoryReport aReport);
58   // Sent from time-to-time to limit the amount of telemetry vulnerable to loss
59   // Buffer contains bincoded Rust structs.
60   // https://firefox-source-docs.mozilla.org/toolkit/components/glean/dev/ipc.html
61   async FOGData(ByteBuf buf);
63 #if defined(XP_WIN)
64   async GetModulesTrust(ModulePaths aModPaths, bool aRunAtNormalPriority)
65       returns (ModulesMapResult? modMapResult);
66 #endif  // defined(XP_WIN)
68   // Messages for sending telemetry to parent process.
69   async AccumulateChildHistograms(HistogramAccumulation[] accumulations);
70   async AccumulateChildKeyedHistograms(KeyedHistogramAccumulation[] accumulations);
71   async UpdateChildScalars(ScalarAction[] actions);
72   async UpdateChildKeyedScalars(KeyedScalarAction[] actions);
73   async RecordChildEvents(ChildEventData[] events);
74   async RecordDiscardedData(DiscardedData data);
76   async InitCompleted();
78 child:
79   async Init(FileDescriptor? sandboxBroker, bool canRecordReleaseTelemetry, bool aIsReadyForBackgroundProcessing);
81   async InitProfiler(Endpoint<PProfilerChild> endpoint);
83   async RequestMemoryReport(uint32_t generation,
84                             bool anonymize,
85                             bool minimizeMemoryUsage,
86                             FileDescriptor? DMDFile)
87       returns (uint32_t aGeneration);
89   async PreferenceUpdate(Pref pref);
91   // Tells the Utility process to flush any pending telemetry.
92   // Used in tests and ping assembly. Buffer contains bincoded Rust structs.
93   // https://firefox-source-docs.mozilla.org/toolkit/components/glean/dev/ipc.html
94   async FlushFOGData() returns (ByteBuf buf);
96   // Test-only method.
97   // Asks the Utility process to trigger test-only instrumentation.
98   // The unused returned value is to have a promise we can await.
99   async TestTriggerMetrics() returns (bool unused);
101   async TestTelemetryProbes();
103   async StartUtilityAudioDecoderService(Endpoint<PUtilityAudioDecoderParent> aEndpoint, GfxVarUpdate[] updates);
105   async StartJSOracleService(Endpoint<PJSOracleChild> aEndpoint);
107 #if defined(XP_WIN)
108   async StartWindowsUtilsService(Endpoint<PWindowsUtilsChild> aEndpoint);
109   async StartWinFileDialogService(Endpoint<PWinFileDialogChild> aEndpoint);
111   async GetUntrustedModulesData() returns (UntrustedModulesData? data);
113   /**
114   * This method is used to notify a child process to start
115   * processing module loading events in UntrustedModulesProcessor.
116   * This should be called when the parent process has gone idle.
117   */
118   async UnblockUntrustedModulesThread();
119 #endif  // defined(XP_WIN)
121 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
122   async InitSandboxTesting(Endpoint<PSandboxTestingChild> aEndpoint);
123 #endif
126 } // namespace ipc
128 } // namespace mozilla