Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / netwerk / ipc / PSocketProcess.ipdl
blob27fd26bf6cde6b80db3801a147181e76d8b34af3
1 /* -*- Mode: C++; tab-width: 2; 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 protocol PDNSRequest;
7 include protocol PSocketProcessBridge;
8 include protocol PProfiler;
9 include protocol PWebrtcTCPSocket;
10 include protocol PHttpTransaction;
11 include protocol PHttpConnectionMgr;
12 include protocol PInputChannelThrottleQueue;
13 include protocol PAltService;
14 include protocol PAltSvcTransaction;
15 include protocol PTRRService;
16 include protocol PProxyConfigLookup;
17 include protocol PNativeDNSResolverOverride;
18 include protocol PProxyAutoConfig;
19 include protocol PSocketProcessBackground;
21 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
22 include protocol PSandboxTesting;
23 #endif
25 include MemoryReportTypes;
26 include NeckoChannelParams;
27 include PrefsTypes;
29 include "mozilla/ipc/ByteBufUtils.h";
31 using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
32 using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
33 using mozilla::Telemetry::HistogramAccumulation from "mozilla/TelemetryComms.h";
34 using mozilla::Telemetry::KeyedHistogramAccumulation from "mozilla/TelemetryComms.h";
35 using mozilla::Telemetry::ScalarAction from "mozilla/TelemetryComms.h";
36 using mozilla::Telemetry::KeyedScalarAction from "mozilla/TelemetryComms.h";
37 using mozilla::Telemetry::ChildEventData from "mozilla/TelemetryComms.h";
38 using mozilla::Telemetry::DiscardedData from "mozilla/TelemetryComms.h";
39 using base::ProcessId from "base/process.h";
40 using mozilla::OriginAttributes from "mozilla/ipc/BackgroundUtils.h";
41 using PRTime from "prtime.h";
42 [RefCounted] using class nsIURI from "mozilla/ipc/URIUtils.h";
43 using struct nsID from "nsID.h";
44 using mozilla::net::SocketInfo from "mozilla/net/DashboardTypes.h";
45 using mozilla::net::DNSCacheEntries from "mozilla/net/DashboardTypes.h";
46 using mozilla::net::HttpRetParams from "mozilla/net/DashboardTypes.h";
47 using mozilla::net::NetAddr from "mozilla/net/DNS.h";
48 using nsIDNSService::DNSFlags from "nsIDNSService.h";
50 #if defined(XP_WIN)
51 [MoveOnly] using mozilla::UntrustedModulesData from "mozilla/UntrustedModulesData.h";
52 [MoveOnly] using mozilla::ModulePaths from "mozilla/UntrustedModulesData.h";
53 [MoveOnly] using mozilla::ModulesMapResult from "mozilla/UntrustedModulesData.h";
54 #endif  // defined(XP_WIN)
56 namespace mozilla {
57 namespace net {
59 struct HttpHandlerInitArgs {
60   nsCString mLegacyAppName;
61   nsCString mLegacyAppVersion;
62   nsCString mPlatform;
63   nsCString mOscpu;
64   nsCString mMisc;
65   nsCString mProduct;
66   nsCString mProductSub;
67   nsCString mAppName;
68   nsCString mAppVersion;
69   nsCString mCompatFirefox;
70   nsCString mCompatDevice;
71   nsCString mDeviceModelId;
74 struct SocketDataArgs
76   uint64_t totalSent;
77   uint64_t totalRecv;
78   SocketInfo[] info;
81 struct SocketPorcessInitAttributes {
82   bool mOffline;
83   bool mConnectivity;
84   bool mInitSandbox;
85 #if defined(XP_WIN)
86   bool mIsReadyForBackgroundProcessing;
87 #endif
88   FileDescriptor? mSandboxBroker;
91 [NeedsOtherPid, ChildProc=Socket]
92 sync protocol PSocketProcess
94   manages PDNSRequest;
95   manages PWebrtcTCPSocket;
96   manages PHttpTransaction;
97   manages PHttpConnectionMgr;
98   manages PInputChannelThrottleQueue;
99   manages PAltService;
100   manages PAltSvcTransaction;
101   manages PTRRService;
102   manages PProxyConfigLookup;
103   manages PNativeDNSResolverOverride;
105 parent:
106   async InitCrashReporter(NativeThreadId threadId);
107   async AddMemoryReport(MemoryReport aReport);
108   // Messages for sending telemetry to parent process.
109   async AccumulateChildHistograms(HistogramAccumulation[] accumulations);
110   async AccumulateChildKeyedHistograms(KeyedHistogramAccumulation[] accumulations);
111   async UpdateChildScalars(ScalarAction[] actions);
112   async UpdateChildKeyedScalars(KeyedScalarAction[] actions);
113   async RecordChildEvents(ChildEventData[] events);
114   async RecordDiscardedData(DiscardedData data);
116   /* tabId is only required for web-proxy support, which isn't always needed */
117   async PWebrtcTCPSocket(TabId? tabId);
118   async ObserveHttpActivity(HttpActivityArgs aActivityArgs,
119                             uint32_t aActivityType,
120                             uint32_t aActivitySubtype,
121                             PRTime   aTimestamp,
122                             uint64_t aExtraSizeData,
123                             nsCString aExtraStringData);
124   async InitSocketBackground(Endpoint<PSocketProcessBackgroundParent> aEndpoint);
125   async PAltService();
126   async PProxyConfigLookup(nullable nsIURI aUri, uint32_t aFlags);
127   async CachePushCheck(nullable nsIURI aPushedURL,
128                        OriginAttributes aOriginAttributes,
129                        nsCString aRequestString)
130     returns (bool aAccepted);
132   async ExcludeHttp2OrHttp3(HttpConnectionInfoCloneArgs aArgs);
134   async OnConsoleMessage(nsString aMessage);
136   // Sent from time-to-time to limit the amount of telemetry vulnerable to loss
137   // Buffer contains bincoded Rust structs.
138   // https://firefox-source-docs.mozilla.org/toolkit/components/glean/dev/ipc.html
139   async FOGData(ByteBuf buf);
141 #if defined(XP_WIN)
142   async GetModulesTrust(ModulePaths aModPaths, bool aRunAtNormalPriority)
143       returns (ModulesMapResult? modMapResult);
144 #endif  // defined(XP_WIN)
146 child:
147   async Init(SocketPorcessInitAttributes aAttributes);
148   async PreferenceUpdate(Pref pref);
149   async RequestMemoryReport(uint32_t generation,
150                             bool anonymize,
151                             bool minimizeMemoryUsage,
152                             FileDescriptor? DMDFile)
153       returns (uint32_t aGeneration);
154   async SetOffline(bool offline);
155   async SetConnectivity(bool connectivity);
156   async InitLinuxSandbox(FileDescriptor? sandboxBroker);
157   async InitSocketProcessBridgeParent(ProcessId processId, Endpoint<PSocketProcessBridgeParent> endpoint);
158   async InitProfiler(Endpoint<PProfilerChild> aEndpoint);
159 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
160   async InitSandboxTesting(Endpoint<PSandboxTestingChild> aEndpoint);
161 #endif
162   // test-only
163   async SocketProcessTelemetryPing();
165   async PHttpTransaction();
166   async PHttpConnectionMgr(HttpHandlerInitArgs aArgs);
167   async UpdateDeviceModelId(nsCString aModelId);
169   async OnHttpActivityDistributorActivated(bool aIsActivated);
170   async OnHttpActivityDistributorObserveProxyResponse(bool aIsEnabled);
171   async OnHttpActivityDistributorObserveConnection(bool aIsEnabled);
172   async PInputChannelThrottleQueue(uint32_t meanBytesPerSecond,
173                                    uint32_t maxBytesPerSecond);
174   async PAltSvcTransaction(HttpConnectionInfoCloneArgs aConnInfo,
175                            uint32_t aCaps);
176   async ClearSessionCache() returns (void_t ok);
177   async PTRRService(bool aCaptiveIsPassed,
178                     bool aParentalControlEnabled,
179                     nsCString[] aDNSSuffixList);
180   async PNativeDNSResolverOverride();
181   async NotifyObserver(nsCString aTopic, nsString aData);
183   async GetSocketData()
184     returns (SocketDataArgs data);
185   async GetDNSCacheEntries()
186     returns (DNSCacheEntries[] entries);
187    async GetHttpConnectionData()
188     returns (HttpRetParams[] params);
190   async InitProxyAutoConfigChild(Endpoint<PProxyAutoConfigChild> endpoint);
192   async RecheckIPConnectivity();
193   async RecheckDNS();
195   // Tells the Socket process to flush any pending telemetry.
196   // Used in tests and ping assembly. Buffer contains bincoded Rust structs.
197   // https://firefox-source-docs.mozilla.org/toolkit/components/glean/dev/ipc.html
198   async FlushFOGData() returns (ByteBuf buf);
200   // Test-only method.
201   // Asks the Socket process to trigger test-only instrumentation.
202   // The unused returned value is to have a promise we can await.
203   async TestTriggerMetrics() returns (bool unused);
205 #if defined(XP_WIN)
206   async GetUntrustedModulesData() returns (UntrustedModulesData? data);
208   /**
209   * This method is used to notifty a child process to start
210   * processing module loading events in UntrustedModulesProcessor.
211   * This should be called when the parent process has gone idle.
212   */
213   async UnblockUntrustedModulesThread();
214 #endif  // defined(XP_WIN)
216   async AddNetAddrOverride(NetAddr aFrom, NetAddr aTo);
217   async ClearNetAddrOverrides();
219 both:
220   async PDNSRequest(nsCString hostName, nsCString trrServer, int32_t port,
221                     uint16_t type, OriginAttributes originAttributes,
222                     DNSFlags flags);
225 } // namespace net
226 } // namespace mozilla