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;
9 include protocol PProfiler;
10 include protocol PUtilityAudioDecoder;
12 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
13 include protocol PSandboxTesting;
16 include "mozilla/ipc/ByteBufUtils.h";
18 using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
21 using mozilla::Telemetry::HistogramAccumulation from "mozilla/TelemetryComms.h";
22 using mozilla::Telemetry::KeyedHistogramAccumulation from "mozilla/TelemetryComms.h";
23 using mozilla::Telemetry::ScalarAction from "mozilla/TelemetryComms.h";
24 using mozilla::Telemetry::KeyedScalarAction from "mozilla/TelemetryComms.h";
25 using mozilla::Telemetry::ChildEventData from "mozilla/TelemetryComms.h";
26 using mozilla::Telemetry::DiscardedData from "mozilla/TelemetryComms.h";
32 // This protocol allows the UI process to talk to the Utility process. There is
33 // one instance of this protocol, with the UtilityProcessParent living on the main thread
34 // of the main process and the UtilityProcessChild living on the main thread of the Utility
36 [NeedsOtherPid] protocol PUtilityProcess
39 async InitCrashReporter(NativeThreadId threadId);
41 async AddMemoryReport(MemoryReport aReport);
43 // Sent from time-to-time to limit the amount of telemetry vulnerable to loss
44 // Buffer contains bincoded Rust structs.
45 // https://firefox-source-docs.mozilla.org/toolkit/components/glean/dev/ipc.html
46 async FOGData(ByteBuf buf);
48 // Messages for sending telemetry to parent process.
49 async AccumulateChildHistograms(HistogramAccumulation[] accumulations);
50 async AccumulateChildKeyedHistograms(KeyedHistogramAccumulation[] accumulations);
51 async UpdateChildScalars(ScalarAction[] actions);
52 async UpdateChildKeyedScalars(KeyedScalarAction[] actions);
53 async RecordChildEvents(ChildEventData[] events);
54 async RecordDiscardedData(DiscardedData data);
56 async InitCompleted();
59 async Init(FileDescriptor? sandboxBroker, bool canRecordReleaseTelemetry);
61 async InitProfiler(Endpoint<PProfilerChild> endpoint);
63 async RequestMemoryReport(uint32_t generation,
65 bool minimizeMemoryUsage,
66 FileDescriptor? DMDFile)
67 returns (uint32_t aGeneration);
69 async PreferenceUpdate(Pref pref);
71 // Tells the Utility process to flush any pending telemetry.
72 // Used in tests and ping assembly. Buffer contains bincoded Rust structs.
73 // https://firefox-source-docs.mozilla.org/toolkit/components/glean/dev/ipc.html
74 async FlushFOGData() returns (ByteBuf buf);
77 // Asks the Utility process to trigger test-only instrumentation.
78 // The unused returned value is to have a promise we can await.
79 async TestTriggerMetrics() returns (bool unused);
81 async TestTelemetryProbes();
83 async StartUtilityAudioDecoderService(Endpoint<PUtilityAudioDecoderParent> aEndpoint);
85 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
86 async InitSandboxTesting(Endpoint<PSandboxTestingChild> aEndpoint);
92 } // namespace mozilla