Backed out changeset 62f7af8fe549 (bug 1843981) for causing valgrind bustage. CLOSED...
[gecko.git] / dom / ipc / PContent.ipdl
blob34dc52ae829c1bc6df5ee3f78c65c8ad011b37ea
1 /* -*- tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=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/. */
7 include protocol PBackgroundStarter;
8 include protocol PBrowser;
9 include protocol PClipboardWriteRequest;
10 include protocol PCompositorManager;
11 include protocol PContentPermissionRequest;
12 include protocol PCycleCollectWithLogs;
13 include protocol PDocumentChannel;
14 include protocol PExtensions;
15 include protocol PExternalHelperApp;
16 include protocol PHandlerService;
17 include protocol PHal;
18 include protocol PHeapSnapshotTempFileHelper;
19 include protocol PProcessHangMonitor;
20 include protocol PImageBridge;
21 include protocol PRemotePrintJob;
22 include protocol PLoginReputation;
23 include protocol PMedia;
24 include protocol PNecko;
25 include protocol PStreamFilter;
26 include protocol PGMPContent;
27 include protocol PGMPService;
28 include protocol PGMP;
29 #ifdef MOZ_WEBSPEECH
30 include protocol PSpeechSynthesis;
31 #endif
32 include protocol PTestShell;
33 include protocol PRemoteSpellcheckEngine;
34 include protocol PWebBrowserPersistDocument;
35 #ifdef MOZ_WEBRTC
36 include protocol PWebrtcGlobal;
37 #endif
38 include protocol PWindowGlobal;
39 include protocol PURLClassifier;
40 include protocol PURLClassifierLocal;
41 include protocol PVRManager;
42 include protocol PRemoteDecoderManager;
43 include protocol PProfiler;
44 include protocol PScriptCache;
45 include protocol PSessionStorageObserver;
46 include protocol PBenchmarkStorage;
47 include DOMTypes;
48 include WindowGlobalTypes;
49 include IPCBlob;
50 include IPCStream;
51 include IPCTransferable;
52 include PPrintingTypes;
53 include PTabContext;
54 include ProtocolTypes;
55 include PBackgroundSharedTypes;
56 include PContentPermission;
57 include GraphicsMessages;
58 include MemoryReportTypes;
59 include ClientIPCTypes;
60 include HangTypes;
61 include PrefsTypes;
62 include NeckoChannelParams;
63 include PSMIPCTypes;
64 include LookAndFeelTypes;
66 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
67 include protocol PSandboxTesting;
68 #endif
70 include "ipc/MediaControlIPC.h";
71 include "mozilla/AntiTrackingIPCUtils.h";
72 include "mozilla/GfxMessageUtils.h";
73 include "mozilla/dom/BindingIPCUtils.h";
74 include "mozilla/dom/CSPMessageUtils.h";
75 include "mozilla/dom/DocShellMessageUtils.h";
76 include "mozilla/dom/FeaturePolicyUtils.h";
77 include "mozilla/dom/MediaSessionIPCUtils.h";
78 include "mozilla/dom/PageLoadEventUtils.h";
79 include "mozilla/dom/ReferrerInfoUtils.h";
80 include "mozilla/glean/GleanMetrics.h";
81 include "mozilla/ipc/ByteBufUtils.h";
82 include "mozilla/ipc/TransportSecurityInfoUtils.h";
83 include "mozilla/ipc/URIUtils.h";
84 include "mozilla/net/NeckoMessageUtils.h";
85 include "mozilla/PermissionDelegateIPCUtils.h";
87 [RefCounted] using class nsIDOMGeoPosition from "nsGeoPositionIPCSerialiser.h";
88 [RefCounted] using class nsIAlertNotification from "mozilla/AlertNotificationIPCSerializer.h";
90 using struct ChromePackage from "mozilla/chrome/RegistryMessageUtils.h";
91 using struct SubstitutionMapping from "mozilla/chrome/RegistryMessageUtils.h";
92 using struct OverrideMapping from "mozilla/chrome/RegistryMessageUtils.h";
93 using base::ProcessId from "base/process.h";
94 using struct IPC::Permission from "mozilla/net/NeckoMessageUtils.h";
95 using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
96 using mozilla::hal::ProcessPriority from "mozilla/HalTypes.h";
97 using mozilla::gfx::IntSize from "mozilla/gfx/2D.h";
98 using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h";
99 using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
100 using mozilla::dom::ContentParentId from "mozilla/dom/ipc/IdType.h";
101 using mozilla::LayoutDeviceIntPoint from "Units.h";
102 using mozilla::ImagePoint from "Units.h";
103 using mozilla::ImageIntSize from "Units.h";
104 using mozilla::widget::ThemeChangeKind from "mozilla/widget/WidgetMessageUtils.h";
105 using class mozilla::dom::MessagePort from "mozilla/dom/MessagePort.h";
106 using class mozilla::dom::ipc::StructuredCloneData from "mozilla/dom/ipc/StructuredCloneData.h";
107 using mozilla::OriginAttributes from "mozilla/ipc/BackgroundUtils.h";
108 using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
109 using mozilla::layers::CompositorOptions from "mozilla/layers/CompositorOptions.h";
110 using mozilla::layers::LayersId from "mozilla/layers/LayersTypes.h";
111 using mozilla::Telemetry::HistogramAccumulation from "mozilla/TelemetryComms.h";
112 using mozilla::Telemetry::KeyedHistogramAccumulation from "mozilla/TelemetryComms.h";
113 using mozilla::Telemetry::ScalarAction from "mozilla/TelemetryComms.h";
114 using mozilla::Telemetry::KeyedScalarAction from "mozilla/TelemetryComms.h";
115 using mozilla::Telemetry::DynamicScalarDefinition from "mozilla/TelemetryComms.h";
116 using mozilla::Telemetry::ChildEventData from "mozilla/TelemetryComms.h";
118 #if defined(XP_WIN)
119 [MoveOnly] using mozilla::UntrustedModulesData from "mozilla/UntrustedModulesData.h";
120 [MoveOnly] using mozilla::ModulePaths from "mozilla/UntrustedModulesData.h";
121 [MoveOnly] using mozilla::ModulesMapResult from "mozilla/UntrustedModulesData.h";
122 #endif  // defined(XP_WIN)
124 using mozilla::Telemetry::DiscardedData from "mozilla/TelemetryComms.h";
125 using mozilla::glean::perf::PageLoadExtra from "mozilla/glean/GleanMetrics.h";
126 [MoveOnly] using mozilla::CrossProcessMutexHandle from "mozilla/ipc/CrossProcessMutex.h";
127 using mozilla::dom::MaybeDiscardedBrowsingContext from "mozilla/dom/BrowsingContext.h";
128 using mozilla::dom::BrowsingContextTransaction from "mozilla/dom/BrowsingContext.h";
129 using mozilla::dom::BrowsingContextInitializer from "mozilla/dom/BrowsingContext.h";
130 using mozilla::dom::PermitUnloadResult from "nsIContentViewer.h";
131 using mozilla::dom::MaybeDiscardedWindowContext from "mozilla/dom/WindowContext.h";
132 using mozilla::dom::WindowContextTransaction from "mozilla/dom/WindowContext.h";
133 [MoveOnly] using base::SharedMemoryHandle from "base/shared_memory.h";
134 using mozilla::fontlist::Pointer from "SharedFontList.h";
135 using gfxSparseBitSet from "gfxFontUtils.h";
136 using FontVisibility from "gfxFontEntry.h";
137 using mozilla::dom::MediaControlAction from "mozilla/dom/MediaControlKeySource.h";
138 using mozilla::dom::MediaPlaybackState from "mozilla/dom/MediaPlaybackStatus.h";
139 using mozilla::dom::MediaAudibleState from "mozilla/dom/MediaPlaybackStatus.h";
140 using mozilla::dom::MediaMetadataBase from "mozilla/dom/MediaMetadata.h";
141 using mozilla::dom::MediaSessionAction from "mozilla/dom/MediaSessionBinding.h";
142 using mozilla::dom::MediaSessionPlaybackState from "mozilla/dom/MediaSessionBinding.h";
143 using mozilla::dom::PositionState from "mozilla/dom/MediaSession.h";
144 using mozilla::dom::ServiceWorkerShutdownState::Progress from "mozilla/dom/ServiceWorkerShutdownState.h";
145 using mozilla::ContentBlockingNotifier::StorageAccessPermissionGrantedReason from "mozilla/ContentBlockingNotifier.h";
146 using mozilla::ContentBlockingNotifier::BlockingDecision from "mozilla/ContentBlockingNotifier.h";
147 using mozilla::StorageAccessAPIHelper::StorageAccessPromptChoices from "mozilla/StorageAccessAPIHelper.h";
148 using mozilla::dom::JSActorMessageKind from "mozilla/dom/JSActor.h";
149 using mozilla::dom::JSActorMessageMeta from "mozilla/dom/PWindowGlobal.h";
150 using mozilla::PermissionDelegateHandler::DelegatedPermissionList from "mozilla/PermissionDelegateHandler.h";
151 [RefCounted] using class nsILayoutHistoryState from "nsILayoutHistoryState.h";
152 using class mozilla::dom::SessionHistoryInfo from "mozilla/dom/SessionHistoryEntry.h";
153 using struct nsPoint from "nsPoint.h";
154 using struct mozilla::dom::LoadingSessionHistoryInfo from "mozilla/dom/SessionHistoryEntry.h";
155 using mozilla::media::MediaCodecsSupported from "MediaCodecsSupport.h";
156 using mozilla::RemoteDecodeIn from "mozilla/RemoteDecoderManagerChild.h";
157 using mozilla::dom::PerformanceTimingData from "mozilla/dom/PerformanceTiming.h";
158 [RefCounted] using mozilla::dom::FeaturePolicy from "mozilla/dom/FeaturePolicy.h";
159 using mozilla::dom::Wireframe from "mozilla/dom/DocumentBinding.h";
160 using mozilla::PerfStats::MetricMask from "mozilla/PerfStats.h";
161 [RefCounted] using class nsIX509Cert from "nsIX509Cert.h";
162 using nsIDNSService::ResolverMode from "nsIDNSService.h";
164 union ChromeRegistryItem
166     ChromePackage;
167     OverrideMapping;
168     SubstitutionMapping;
171 namespace mozilla {
172 namespace dom {
174 // SetXPCOMProcessAttributes passes an array of font data to the child,
175 // but each platform needs different details so we have platform-specific
176 // versions of the SystemFontListEntry type:
177 #if defined(ANDROID)
178 // Used on Android to pass the list of fonts on the device
179 // to the child process
180 struct SystemFontListEntry {
181     nsCString familyName;
182     nsCString faceName;
183     nsCString filepath;
184     uint32_t  weightRange;
185     uint32_t  stretchRange;
186     uint32_t  styleRange;
187     uint8_t   index;
188     FontVisibility visibility;
190 #elif defined(XP_MACOSX)
191 // Used on Mac OS X to pass the list of font families (not faces)
192 // from chrome to content processes.
193 // The entryType field distinguishes several types of font family
194 // record; see gfxMacPlatformFontList.h for values and meaning.
195 struct SystemFontListEntry {
196     nsCString familyName;
197     FontVisibility visibility;
198     uint8_t   entryType;
200 #else
201 // Used on Linux to pass list of font patterns from chrome to content.
202 // (Unused on Windows, but there needs to be a definition of the type.)
203 struct SystemFontListEntry {
204     nsCString pattern;
205     bool      appFontFamily;
207 #endif
209 #ifdef MOZ_WIDGET_GTK
210 struct SystemFontOptions {
211     int32_t antialias; // cairo_antialias_t
212     int32_t subpixelOrder; // cairo_subpixel_order_t
213     int32_t hintStyle; // cairo_hint_style_t
214     int32_t lcdFilter; // cairo_lcd_filter_t
216 #endif
218 struct SystemFontList {
219     SystemFontListEntry[] entries;
220 #ifdef MOZ_WIDGET_GTK
221     SystemFontOptions options;
222 #endif
225 union SystemParameterValue {
226   bool;
227   float;
230 struct ClipboardCapabilities {
231   bool supportsSelectionClipboard;
232   bool supportsFindClipboard;
233   bool supportsSelectionCache;
236 union FileDescOrError {
237     FileDescriptor;
238     nsresult;
241 struct DomainPolicyClone
243     bool        active;
244     nullable nsIURI[] blocklist;
245     nullable nsIURI[] allowlist;
246     nullable nsIURI[] superBlocklist;
247     nullable nsIURI[] superAllowlist;
250 struct AndroidSystemInfo
252     nsString device;
253     nsString manufacturer;
254     nsString release_version;
255     nsString hardware;
256     uint32_t sdk_version;
257     bool     isTablet;
260 struct GetFilesResponseSuccess
262   IPCBlob[] blobs;
265 struct GetFilesResponseFailure
267   nsresult errorCode;
270 union GetFilesResponseResult
272   GetFilesResponseSuccess;
273   GetFilesResponseFailure;
276 struct BlobURLRegistrationData
278   nsCString url;
279   IPCBlob blob;
280   nullable nsIPrincipal principal;
281   nsCString partitionKey;
282   bool revoked;
285 struct JSWindowActorEventDecl
287   nsString name;
288   bool capture;
289   bool systemGroup;
290   bool allowUntrusted;
291   bool? passive;
292   bool createActor;
295 struct JSWindowActorInfo
297   nsCString name;
298   bool allFrames;
300   // True if `url` is for ESM.
301   // False if `url` is for JSM or nothing.
302   bool isESModule;
304   // The module of the url.
305   nsCString? url;
307   JSWindowActorEventDecl[] events;
309   // Observer notifications this actor listens to.
310   nsCString[] observers;
311   nsString[] matches;
312   nsCString[] remoteTypes;
313   nsString[] messageManagerGroups;
316 struct JSProcessActorInfo
318     // The name of the actor.
319     nsCString name;
321     // True if `url` is for ESM.
322     // False if `url` is for JSM or nothing.
323     bool isESModule;
325     // The module of the url.
326     nsCString? url;
328     // Observer notifications this actor listens to.
329     nsCString[] observers;
330     nsCString[] remoteTypes;
333 struct GMPAPITags
335     nsCString api;
336     nsCString[] tags;
339 struct GMPCapabilityData
341     nsCString name;
342     nsCString version;
343     GMPAPITags[] capabilities;
346 struct L10nFileSourceDescriptor {
347   nsCString name;
348   nsCString metasource;
349   nsCString[] locales;
350   nsCString prePath;
351   nsCString[] index;
354 struct XPCOMInitData
356     bool isOffline;
357     bool isConnected;
358     int32_t captivePortalState;
359     bool isLangRTL;
360     bool haveBidiKeyboards;
361     nsCString[] dictionaries;
362     ClipboardCapabilities clipboardCaps;
363     DomainPolicyClone domainPolicy;
364     nullable nsIURI userContentSheetURL;
365     GfxVarUpdate[] gfxNonDefaultVarUpdates;
366     ContentDeviceData contentDeviceData;
367     GfxInfoFeatureStatus[] gfxFeatureStatus;
368     nsCString[] appLocales;
369     nsCString[] requestedLocales;
370     L10nFileSourceDescriptor[] l10nFileSources;
371     DynamicScalarDefinition[] dynamicScalarDefs;
372     MetricMask perfStatsMask;
373     nsCString trrDomain;
374     ResolverMode trrMode;
375     // This is the value of network.trr.mode and can be diffrent than trrMode.
376     ResolverMode trrModeFromPref;
379 struct VisitedQueryResult
381     nullable nsIURI uri;
382     bool visited;
385 struct StringBundleDescriptor
387     nsCString bundleURL;
388     FileDescriptor mapFile;
389     uint32_t mapSize;
392 struct IPCURLClassifierFeature
394     nsCString featureName;
395     nsCString[] tables;
396     nsCString exceptionHostList;
399 // Transport structure for Notifications API notifications
400 // (https://developer.mozilla.org/en-US/docs/Web/API/notification) instances
401 // used exclusively by the NotificationEvent PContent method.
402 struct NotificationEventData
404     nsCString originSuffix;
405     nsCString scope;
406     nsString ID;
407     nsString title;
408     nsString dir;
409     nsString lang;
410     nsString body;
411     nsString tag;
412     nsString icon;
413     nsString data;
414     nsString behavior;
417 struct PostMessageData
419     MaybeDiscardedBrowsingContext source;
420     nsString origin;
421     nsString targetOrigin;
422     nullable nsIURI targetOriginURI;
423     nullable nsIPrincipal callerPrincipal;
424     nullable nsIPrincipal subjectPrincipal;
425     nullable nsIURI callerURI;
426     bool isFromPrivateWindow;
427     nsCString scriptLocation;
428     uint64_t innerWindowId;
431 union SyncedContextInitializer
433     BrowsingContextInitializer;
434     WindowContextInitializer;
437 union BlobURLDataRequestResult
439   IPCBlob;
440   nsresult;
443 struct TextRecognitionQuad {
444     float confidence;
445     nsString string;
446     ImagePoint[] points;
449 struct TextRecognitionResult {
450     TextRecognitionQuad[] quads;
453 union TextRecognitionResultOrError {
454     TextRecognitionResult;
455     nsCString;
458 struct IPCImage {
459     BigBuffer data;
460     uint32_t stride;
461     SurfaceFormat format;
462     ImageIntSize size;
465 union IPCTransferableDataOrError {
466     IPCTransferableData;
467     nsresult;
471  * The PContent protocol is a top-level protocol between the UI process
472  * and a content process. There is exactly one PContentParent/PContentChild pair
473  * for each content process.
474  */
475 [NestedUpTo=inside_cpow, NeedsOtherPid]
476 sync protocol PContent
478     manages PBrowser;
479     manages PClipboardWriteRequest;
480     manages PContentPermissionRequest;
481     manages PCycleCollectWithLogs;
482     manages PExtensions;
483     manages PExternalHelperApp;
484     manages PHal;
485     manages PHandlerService;
486     manages PHeapSnapshotTempFileHelper;
487     manages PRemotePrintJob;
488     manages PMedia;
489     manages PNecko;
490 #ifdef MOZ_WEBSPEECH
491     manages PSpeechSynthesis;
492 #endif
493     manages PTestShell;
494     manages PRemoteSpellcheckEngine;
495     manages PWebBrowserPersistDocument;
496 #ifdef MOZ_WEBRTC
497     manages PWebrtcGlobal;
498 #endif
499     manages PURLClassifier;
500     manages PURLClassifierLocal;
501     manages PScriptCache;
502     manages PLoginReputation;
503     manages PSessionStorageObserver;
504     manages PBenchmarkStorage;
506     // Depending on exactly how the new browser is being created, it might be
507     // created from either the child or parent process!
508     //
509     // The child creates the PBrowser as part of
510     // BrowserChild::BrowserFrameProvideWindow (which happens when the child's
511     // content calls window.open()), and the parent creates the PBrowser as part
512     // of ContentParent::CreateBrowser.
513     //
514     // When the parent constructs a PBrowser, the child trusts the attributes it
515     // receives from the parent.  In that case, the context should be
516     // FrameIPCTabContext.
517     //
518     // When the child constructs a PBrowser, the parent doesn't trust the
519     // attributes it receives from the child.  In this case, context must have
520     // type PopupIPCTabContext.  The parent checks that if the opener is a
521     // browser element, the context is also for a browser element.
522     //
523     // If |sameTabGroupAs| is non-zero, the new tab should go in the same
524     // TabGroup as |sameTabGroupAs|. This parameter should always be zero
525     // for PBrowser messages sent from the child to the parent.
526     //
527     // Separate messages are used for the parent and child side constructors due
528     // to the differences in data and actor setup required.
529     //
530     // Keep the last 3 attributes in sync with GetProcessAttributes!
531 parent:
532     async ConstructPopupBrowser(ManagedEndpoint<PBrowserParent> browserEp,
533                                 ManagedEndpoint<PWindowGlobalParent> windowEp,
534                                 TabId tabId, IPCTabContext context,
535                                 WindowGlobalInit windowInit,
536                                 uint32_t chromeFlags);
538     // TODO: Do I need to make this return something to watch for completion?
539     // Guess we'll see how we end up triggering the actual print, for preview
540     // this should be enough...
541     async CloneDocumentTreeInto(MaybeDiscardedBrowsingContext aSourceBc,
542                                 MaybeDiscardedBrowsingContext aTargetBc,
543                                 PrintData aPrintData);
545     async UpdateRemotePrintSettings(MaybeDiscardedBrowsingContext aBc,
546                                     PrintData aPrintData);
548     async PExtensions();
550 child:
551     async ConstructBrowser(ManagedEndpoint<PBrowserChild> browserEp,
552                            ManagedEndpoint<PWindowGlobalChild> windowEp,
553                            TabId tabId,
554                            IPCTabContext context,
555                            WindowGlobalInit windowInit,
556                            uint32_t chromeFlags, ContentParentId cpId,
557                            bool isForBrowser, bool isTopLevel);
559 both:
560     // For parent->child, aBrowser must be non-null; aContext can
561     // be null to indicate the browser's current root document, or non-null
562     // to persist a subdocument.  For child->parent, arguments are
563     // ignored and should be null.
564     async PWebBrowserPersistDocument(nullable PBrowser aBrowser,
565                                      MaybeDiscardedBrowsingContext aContext);
567     async RawMessage(JSActorMessageMeta aMetadata, ClonedMessageData? aData,
568                      ClonedMessageData? aStack);
570 child:
571     async InitGMPService(Endpoint<PGMPServiceChild> service);
572     async InitProcessHangMonitor(Endpoint<PProcessHangMonitorChild> hangMonitor);
573     async InitProfiler(Endpoint<PProfilerChild> aEndpoint);
575     // Give the content process its endpoints to the compositor.
576     async InitRendering(
577       Endpoint<PCompositorManagerChild> compositor,
578       Endpoint<PImageBridgeChild> imageBridge,
579       Endpoint<PVRManagerChild> vr,
580       Endpoint<PRemoteDecoderManagerChild> video,
581       uint32_t[] namespaces);
583     // Re-create the rendering stack using the given endpoints. This is sent
584     // after the compositor process has crashed. The new endpoints may be to a
585     // newly launched GPU process, or the compositor thread of the UI process.
586     async ReinitRendering(
587       Endpoint<PCompositorManagerChild> compositor,
588       Endpoint<PImageBridgeChild> bridge,
589       Endpoint<PVRManagerChild> vr,
590       Endpoint<PRemoteDecoderManagerChild> video,
591       uint32_t[] namespaces);
593     async NetworkLinkTypeChange(uint32_t type);
594     async SocketProcessCrashed();
596     // Re-create the rendering stack for a device reset.
597     async ReinitRenderingForDeviceReset();
599     /**
600      * Enable system-level sandboxing features, if available.  Can
601      * usually only be performed zero or one times.  The child may
602      * abnormally exit if this fails; the details are OS-specific.
603      */
604     async SetProcessSandbox(FileDescriptor? aBroker);
606     async RequestMemoryReport(uint32_t generation,
607                               bool anonymize,
608                               bool minimizeMemoryUsage,
609                               FileDescriptor? DMDFile)
610         returns (uint32_t aGeneration);
612 #if defined(XP_WIN)
613     /**
614      * Used by third-party modules telemetry (aka "untrusted modules" telemetry)
615      * to pull data from content processes.
616      */
617     async GetUntrustedModulesData() returns (UntrustedModulesData? data);
619     /**
620     * This method is used to notifty a child process to start
621     * processing module loading events in UntrustedModulesProcessor.
622     * This should be called when the parent process has gone idle.
623     */
624     async UnblockUntrustedModulesThread();
625 #endif  // defined(XP_WIN)
627     /**
628      * Communication between the PuppetBidiKeyboard and the actual
629      * BidiKeyboard hosted by the parent
630      */
631     async BidiKeyboardNotify(bool isLangRTL, bool haveBidiKeyboards);
633     /**
634      * Dump this process's GC and CC logs to the provided files.
635      *
636      * For documentation on the other args, see dumpGCAndCCLogsToFile in
637      * nsIMemoryInfoDumper.idl
638      */
639     async PCycleCollectWithLogs(bool dumpAllTraces,
640                                 FileDescriptor gcLog,
641                                 FileDescriptor ccLog);
643     async PTestShell();
645     async PScriptCache(FileDescOrError cacheFile, bool wantCacheData);
647     async RegisterChrome(ChromePackage[] packages, SubstitutionMapping[] substitutions,
648                          OverrideMapping[] overrides, nsCString locale, bool reset);
649     async RegisterChromeItem(ChromeRegistryItem item);
651     async ClearImageCacheFromPrincipal(nullable nsIPrincipal aPrincipal);
653     async ClearImageCacheFromBaseDomain(nsCString aBaseDomain);
655     async ClearImageCache(bool privateLoader, bool chrome);
657     async ClearStyleSheetCache(nullable nsIPrincipal? aForPrincipal,
658                                nsCString? aBaseDomain);
660     async SetOffline(bool offline);
661     async SetConnectivity(bool connectivity);
662     async SetCaptivePortalState(int32_t aState);
663     async SetTRRMode(ResolverMode aMode, ResolverMode aModeFromPref);
665     async NotifyVisited(VisitedQueryResult[] uri);
667     /**
668      * Tell the child that the system theme has changed, and that a repaint is
669      * necessary.
670      */
671     async ThemeChanged(FullLookAndFeel lookAndFeelData, ThemeChangeKind aKind);
673     async PreferenceUpdate(Pref pref);
674     async VarUpdate(GfxVarUpdate var);
676     async UpdatePerfStatsCollectionMask(uint64_t aMask);
677     async CollectPerfStatsJSON() returns (nsCString aStats);
679     async CollectScrollingMetrics() returns (uint32_t pixelsScrolled, uint32_t scrollDurationMS);
681     async NotifyAlertsObserver(nsCString topic, nsString data);
683     async GeolocationUpdate(nullable nsIDOMGeoPosition aPosition);
685     async GeolocationError(uint16_t errorCode);
687     async UpdateDictionaryList(nsCString[] dictionaries);
689     async UpdateFontList(SystemFontList fontList);
691     /**
692      * The shared font list has been updated by the parent, so child processes
693      * should globally reflow everything to pick up new character coverage etc.
694      * If aFullRebuild is true, child processes must discard and recreate
695      * their mappings to the shmem blocks, as those are no longer valid.
696      * This message has raised priority so that it will take precedence over
697      * vsync messages to the child.
698      */
699     [Priority=mediumhigh] async RebuildFontList(bool aFullRebuild);
701     /**
702      * The shared font list has been modified, potentially adding matches
703      * for src:local() names that were previously not known, so content
704      * may need to be reflowed.
705      */
706     async FontListChanged();
708     /**
709      * The font list or prefs have been updated in such a way that we might need
710      * to do a reflow and maybe reframe.
711      */
712     async ForceGlobalReflow(bool aNeedsReframe);
714     /**
715      * A new shmem block has been added to the font list; the child process
716      * should map the new block and add to its index.
717      */
718     async FontListShmBlockAdded(uint32_t aGeneration, uint32_t aIndex,
719                                 SharedMemoryHandle aHandle);
721     async UpdateAppLocales(nsCString[] appLocales);
722     async UpdateRequestedLocales(nsCString[] requestedLocales);
724     /**
725      * The system timezone has changed; the child process should ensure that
726      * calls to get the default timezone return the new value.
727      */
728     async SystemTimezoneChanged();
730     async UpdateL10nFileSources(L10nFileSourceDescriptor[] sources);
732     async RegisterStringBundles(StringBundleDescriptor[] stringBundles);
734     async UpdateSharedData(FileDescriptor mapFile, uint32_t aSize,
735                            IPCBlob[] blobs,
736                            nsCString[] changedKeys);
738     // nsIPermissionManager messages
739     async AddPermission(Permission permission);
740     async RemoveAllPermissions();
742     async FlushMemory(nsString reason);
744     async ApplicationBackground();
745     async ApplicationForeground();
746     async GarbageCollect();
747     async CycleCollect();
748     async UnlinkGhosts();
750     /**
751      * Start accessibility engine in content process.
752      */
753     async ActivateA11y();
755     /**
756      * Shutdown accessibility engine in content process (if not in use).
757      */
758     async ShutdownA11y();
760     async AppInfo(nsCString version, nsCString buildID, nsCString name, nsCString UAName,
761                   nsCString ID, nsCString vendor, nsCString sourceURL, nsCString updateURL);
763     /**
764      * Send the remote type associated with the content process.
765      */
766     async RemoteType(nsCString aRemoteType, nsCString aProfile);
768     /**
769      * Send BlobURLRegistrationData to child process.
770      */
771     async InitBlobURLs(BlobURLRegistrationData[] registrations);
773     /**
774      * Send JS{Content, Window}ActorInfos to child process.
775      */
776     async InitJSActorInfos(JSProcessActorInfo[] aContentInfos, JSWindowActorInfo[] aWindowInfos);
778     /**
779      * Unregister a previously registered JSWindowActor in the child process.
780      */
781     async UnregisterJSWindowActor(nsCString name);
783     /**
784      * Unregister a previously registered JSProcessActor in the child process.
785      */
786     async UnregisterJSProcessActor(nsCString name);
788     async SetXPCOMProcessAttributes(XPCOMInitData xpcomInit,
789                                     StructuredCloneData initialData,
790                                     FullLookAndFeel lookAndFeeldata,
791                                     /* used on MacOSX/Linux/Android only: */
792                                     SystemFontList systemFontList,
793                                     SharedMemoryHandle? sharedUASheetHandle,
794                                     uintptr_t sharedUASheetAddress,
795                                     SharedMemoryHandle[] sharedFontListBlocks,
796                                     bool aIsStartingUp);
798     // Notify child that last-pb-context-exited notification was observed
799     async LastPrivateDocShellDestroyed();
801     async NotifyProcessPriorityChanged(ProcessPriority priority);
802     async MinimizeMemoryUsage();
804     /**
805      * Used to manage nsIStyleSheetService across processes.
806      */
807     async LoadAndRegisterSheet(nullable nsIURI uri, uint32_t type);
808     async UnregisterSheet(nullable nsIURI uri, uint32_t type);
810     /**
811      * Notify idle observers in the child
812      */
813     async NotifyIdleObserver(uint64_t observerId, nsCString topic, nsString str);
815     async InvokeDragSession(MaybeDiscardedWindowContext aSourceWindowContext,
816                             MaybeDiscardedWindowContext aSourceTopWindowContext,
817                             IPCTransferableData[] transfers, uint32_t action);
819     async EndDragSession(bool aDoneDrag, bool aUserCancelled,
820                          LayoutDeviceIntPoint aDragEndPoint,
821                          uint32_t aKeyModifiers,
822                          uint32_t aDropEffect);
824     async DomainSetChanged(uint32_t aSetType, uint32_t aChangeType, nullable nsIURI aDomain);
826     /**
827      * Notify the child that it will soon be asked to shutdown.
828      * This is sent with high priority right before the normal shutdown.
829      */
830     [Priority=control] async ShutdownConfirmedHP();
832     /**
833      * Notify the child to shutdown. The child will in turn call FinishShutdown
834      * and let the parent close the channel.
835      */
836     async Shutdown();
838     async LoadProcessScript(nsString url);
840     /**
841      * Requests a full native update of a native plugin child window. This is
842      * a Windows specific call.
843      */
844     async UpdateWindow(uintptr_t aChildId);
846     /**
847      * Notify the child that cache is emptied.
848      */
849     async NotifyEmptyHTTPCache();
851     /**
852      * Send a `push` event without data to a service worker in the child.
853      */
854     async Push(nsCString scope, nullable nsIPrincipal principal, nsString messageId);
856     /**
857      * Send a `push` event with data to a service worker in the child.
858      */
859     async PushWithData(nsCString scope, nullable nsIPrincipal principal,
860                        nsString messageId, uint8_t[] data);
862     /**
863      * Send a `pushsubscriptionchange` event to a service worker in the child.
864      */
865     async PushSubscriptionChange(nsCString scope, nullable nsIPrincipal principal);
867     async GetFilesResponse(nsID aID, GetFilesResponseResult aResult);
869     async BlobURLRegistration(nsCString aURI, IPCBlob aBlob,
870                               nullable nsIPrincipal aPrincipal, nsCString aPartitionKey);
872     async BlobURLUnregistration(nsCString aURI);
874     async GMPsChanged(GMPCapabilityData[] capabilities);
877     async ProvideAnonymousTemporaryFile(uint64_t aID, FileDescOrError aFD);
879     async SetPermissionsWithKey(nsCString aPermissionKey, Permission[] aPermissions);
881     async RefreshScreens(ScreenDetails[] aScreens);
883     async ShareCodeCoverageMutex(CrossProcessMutexHandle handle);
884     async FlushCodeCoverageCounters() returns (bool unused);
886     /*
887      * IPC message to enable the input event queue on the main thread of the
888      * content process.
889      */
890     async SetInputEventQueueEnabled();
892     /*
893      * IPC message to flush the input event queue on the main thread of the
894      * content process.
895      *
896      * When the ContentParent stops sending the input event with input priority,
897      * there may be some pending events in the input event queue and normal
898      * event queue. Here is a possible scenario.
899      * R: Runnables.
900      * D: Enable the input priority event.
901      * E: Disable the input priority evnet.
902      *
903      *                     D       E
904      * Normal Queue: R1      R2      R3
905      * Input Queue:     II      I2      I3
906      *
907      * To avoid the newly added normal events (e.g. R2, which may be an input
908      * event) preempt the pending input events (e.g. I1), or the newly added
909      * input events (e.g. I3) preempt the pending normal events (e.g. R2), we
910      * have to flush all pending events before enabling and disabling the input
911      * priority event.
912      *
913      * To flush the normal event queue and the input event queue, we use three
914      * IPC messages as the followings.
915      * FI: Flush the input queue.
916      * SI: Suspend the input queue.
917      * RI: Resume the input queue.
918      *
919      * Normal Queue: R1    FI    RI R2   FI    RI R3
920      * Input Queue:     II    SI      I2    SI       I3
921      *
922      * When the flush input request is processed before the other two requests,
923      * we consume all input events until the suspend request. After handling the
924      * suspend request, we stop consuming the input events until the resume
925      * request to make sure we consume all pending normal events.
926      *
927      * If we process the suspend request before the other two requests, we
928      * ignore the flush request and consume all pending normal events until the
929      * resume request.
930      */
931     async FlushInputEventQueue();
933     /*
934      * IPC message to resume consuming the pending events in the input event
935      * queue.
936      */
937     async ResumeInputEventQueue();
939     /*
940      * IPC message to suspend consuming the pending events in the input event
941      * queue.
942      */
943     [Priority=input] async SuspendInputEventQueue();
945     /*
946      * IPC message to propagate dynamic scalar definitions, added after the
947      * content process is spawned, from the parent to the child.
948      * Dynamic scalar definitions added at the process startup are handled
949      * using the |TelemetryIPC::AddDynamicScalarDefinitions| functions.
950      */
951     async AddDynamicScalars(DynamicScalarDefinition[] definitions);
953     // This message is sent to content processes, and triggers the creation of a
954     // new HttpChannelChild that will be connected to the parent channel
955     // represented by registrarId.
956     // This is on PContent not PNecko, as PNecko may not be initialized yet.
957     // The returned loadInfo needs to be set on the channel - since the channel
958     // moved to a new process it now has different properties.
960     async CrossProcessRedirect(RedirectToRealChannelArgs args,
961                                Endpoint<PStreamFilterParent>[] aEndpoint)
962         returns (nsresult rv);
964     /**
965     * This method is used to notifty content process to start delayed autoplay
966     * media via browsing context.
967     */
968     async StartDelayedAutoplayMediaComponents(MaybeDiscardedBrowsingContext aContext);
970     /**
971      * This method is used to dispatch MediaControlAction to content process in
972      * order to control media within a specific browsing context tree.
973      */
974     async UpdateMediaControlAction(MaybeDiscardedBrowsingContext aContext,
975                                    MediaControlAction aAction);
977     // Begin subscribing to a new BrowsingContextGroup, sending down the current
978     // value for every individual BrowsingContext.
979     async RegisterBrowsingContextGroup(uint64_t aGroupId, SyncedContextInitializer[] aInits);
981     // The BrowsingContextGroup has been destroyed in the parent process. The
982     // content process won't destroy the group until it receives this message or
983     // during shutdown.
984     //
985     // When the content process receives this message, all contexts in the group
986     // should have already been destroyed.
987     async DestroyBrowsingContextGroup(uint64_t aGroupId);
989 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
990     // Initialize top-level actor for testing content process sandbox.
991     async InitSandboxTesting(Endpoint<PSandboxTestingChild> aEndpoint);
992 #endif
994     async LoadURI(MaybeDiscardedBrowsingContext aContext, nsDocShellLoadState aLoadState, bool aSetNavigating)
995         returns (bool aSuccess);
997     async InternalLoad(nsDocShellLoadState aLoadState);
999     async DisplayLoadError(MaybeDiscardedBrowsingContext aContext, nsString aURI);
1001     async GoBack(MaybeDiscardedBrowsingContext aContext, int32_t? aCancelContentJSEpoch, bool aRequireUserInteraction, bool aUserActivation);
1002     async GoForward(MaybeDiscardedBrowsingContext aContext, int32_t? aCancelContentJSEpoch, bool aRequireUserInteraction, bool aUserActivation);
1003     async GoToIndex(MaybeDiscardedBrowsingContext aContext, int32_t aIndex, int32_t? aCancelContentJSEpoch, bool aUserActivation);
1004     async Reload(MaybeDiscardedBrowsingContext aContext, uint32_t aReloadFlags);
1005     async StopLoad(MaybeDiscardedBrowsingContext aContext, uint32_t aStopFlags);
1007     async OnAllowAccessFor(MaybeDiscardedBrowsingContext aParentContext,
1008                            nsCString aTrackingOrigin,
1009                            uint32_t aCookieBehavior,
1010                            StorageAccessPermissionGrantedReason aReason);
1012     async OnContentBlockingDecision(MaybeDiscardedBrowsingContext aContext,
1013                                     BlockingDecision aReason,
1014                                     uint32_t aRejectedReason);
1016     /**
1017      * Abort orientationPendingPromises for documents in the child which
1018      * are part of a BrowsingContextGroup.
1019      */
1020     async AbortOrientationPendingPromises(MaybeDiscardedBrowsingContext aContext);
1022     async HistoryCommitIndexAndLength(MaybeDiscardedBrowsingContext aContext,
1023                                       uint32_t aIndex, uint32_t aLength,
1024                                       nsID aChangeID);
1026     async GetLayoutHistoryState(MaybeDiscardedBrowsingContext aContext)
1027         returns (nullable nsILayoutHistoryState aState, Wireframe? aWireframe);
1029     async DispatchLocationChangeEvent(MaybeDiscardedBrowsingContext aContext);
1031     // Dispatches a "beforeunload" event to each in-process content window in the
1032     // subtree beginning at `aStartingAt`, and returns the result as documented in
1033     // the `PermitUnloadResult` enum.
1034     async DispatchBeforeUnloadToSubtree(MaybeDiscardedBrowsingContext aStartingAt)
1035         returns (PermitUnloadResult result);
1037     // Update the cached list of codec supported in the given process.
1038     async UpdateMediaCodecsSupported(RemoteDecodeIn aLocation, MediaCodecsSupported aSupported);
1040     // Send the list of the supported mimetypes in the given process. GeckoView-specific
1041     async DecoderSupportedMimeTypes(nsCString[] supportedTypes);
1043     // Used to initialize the global variable in content processes with the
1044     // latched value in the parent process. See dom/LocalStorageCommon.h for more
1045     // details.
1046     async InitNextGenLocalStorageEnabled(bool enabled);
1048   async PRemotePrintJob();
1050 parent:
1052     async SynchronizeLayoutHistoryState(MaybeDiscardedBrowsingContext aContext,
1053                                         nullable nsILayoutHistoryState aState);
1055     async SessionHistoryEntryTitle(MaybeDiscardedBrowsingContext aContext,
1056                                    nsString aTitle);
1058     async SessionHistoryEntryScrollRestorationIsManual(MaybeDiscardedBrowsingContext aContext,
1059                                                        bool aIsManual);
1060     async SessionHistoryEntryScrollPosition(MaybeDiscardedBrowsingContext aContext,
1061                                             int32_t aX, int32_t aY);
1063     async SessionHistoryEntryCacheKey(MaybeDiscardedBrowsingContext aContext,
1064                                       uint32_t aCacheKey);
1066     async SessionHistoryEntryStoreWindowNameInContiguousEntries(MaybeDiscardedBrowsingContext aContext,
1067                                                                 nsString aName);
1069     async SessionHistoryEntryWireframe(MaybeDiscardedBrowsingContext aContext,
1070                                        Wireframe aWireframe);
1072     async GetLoadingSessionHistoryInfoFromParent(MaybeDiscardedBrowsingContext aContext)
1073         returns (LoadingSessionHistoryInfo? aLoadingInfo);
1075     async RemoveFromBFCache(MaybeDiscardedBrowsingContext aContext);
1077     async InitBackground(Endpoint<PBackgroundStarterParent> aEndpoint);
1079     async CreateGMPService();
1081     async InitStreamFilter(uint64_t channelId, nsString addonId)
1082         returns (Endpoint<PStreamFilterChild> aEndpoint);
1084     async PRemoteSpellcheckEngine();
1086     async InitCrashReporter(NativeThreadId tid);
1088     sync IsSecureURI(nullable nsIURI aURI, OriginAttributes aOriginAttributes)
1089         returns (bool isSecureURI);
1091     async AccumulateMixedContentHSTS(nullable nsIURI aURI, bool aActive,
1092                                      OriginAttributes aOriginAttributes);
1094     [Nested=inside_cpow] async PHal();
1096     async PHeapSnapshotTempFileHelper();
1098     async PNecko();
1100 #ifdef MOZ_WEBSPEECH
1101     async PSpeechSynthesis();
1102 #endif
1104     async PMedia();
1106 #ifdef MOZ_WEBRTC
1107     async PWebrtcGlobal();
1108 #endif
1110     async CreateAudioIPCConnection() returns (FileDescOrError fd);
1112     sync PURLClassifier(nullable nsIPrincipal principal)
1113         returns (bool success);
1115     async PURLClassifierLocal(nullable nsIURI uri, IPCURLClassifierFeature[] features);
1117     async PLoginReputation(nullable nsIURI formURI);
1119     async PSessionStorageObserver();
1121     async PBenchmarkStorage();
1123     // Services remoting
1125     async StartVisitedQueries(nullable nsIURI[] uri);
1126     async SetURITitle(nullable nsIURI uri, nsString title);
1128     async LoadURIExternal(nullable nsIURI uri,
1129                           nullable nsIPrincipal triggeringPrincipal,
1130                           nullable nsIPrincipal redirectPrincipal,
1131                           MaybeDiscardedBrowsingContext browsingContext,
1132                           bool wasExternallyTriggered,
1133                           bool hasValidUserGestureActivation);
1134     async ExtProtocolChannelConnectParent(uint64_t registrarId);
1136     // PrefService message
1137     sync GetGfxVars() returns (GfxVarUpdate[] vars);
1139     sync SyncMessage(nsString aMessage, ClonedMessageData aData)
1140       returns (StructuredCloneData[] retval);
1142     async ShowAlert(nullable nsIAlertNotification alert);
1144     async CloseAlert(nsString name, bool contextClosed);
1146     async DisableNotifications(nullable nsIPrincipal principal);
1148     async OpenNotificationSettings(nullable nsIPrincipal principal);
1150     async AddSecurityState(MaybeDiscardedWindowContext aContext, uint32_t aStateFlags);
1152     // Request that the ServiceWorkerManager in the parent process create a
1153     // notification "click" or "close" event and dispatch it on the relevant
1154     // ServiceWorker. This needs to happen because when a notification is
1155     // created it is tied to a specific content process and when the user clicks
1156     // on the notification, it will be that content process that is notified.
1157     // However, even if the ServiceWorker lives in that process (it may no
1158     // longer be in that process, or may have never lived there), the right/only
1159     // way to talk through the ServiceWorker is through the parent.
1160     //
1161     // This happens on PContent because the ServiceWorkerManager lives on the
1162     // main thread and bouncing this off of PBackground would be silly and
1163     // complex. In the long run, the notification implementation will be
1164     // overhauled to directly process the notification click/close and directly
1165     // translate that to a ServiceWorker event.
1166     async NotificationEvent(nsString type, NotificationEventData data);
1168     // Creates a helper for forwarding data from an nsExternalAppHandler
1169     // running in the content process, to one running in the parent
1170     // process.
1171     // Bug 1574372 aims to run nsExternalAppHandler entirely in the
1172     // parent so that we can remove this.
1173     //
1174     // Serializes the uri, loadInfo, contentType, referrer, contentDisposition
1175     // headers and contentLength of the channel so that we can make them
1176     // available to the parent instance via a nsIChannel helper. Also
1177     // passes whether the original channel was an instance of nsIFileChannel.
1178     //
1179     // aContext is the BrowsingContext that initiated the load, and created the
1180     // channel.
1181     //
1182     // Pass true for aForceSave to always save this content to disk, regardless of
1183     // nsIMIMEInfo and other such influences.
1184     // Pass true for aShouldCloseWindow to specify that aContext was opened specifically
1185     // for this load, and should be closed once we've handled it.
1186     async PExternalHelperApp(nullable nsIURI uri,
1187                              LoadInfoArgs loadInfoArgs,
1188                              nsCString aMimeContentType,
1189                              nsCString aContentDisposition,
1190                              uint32_t aContentDispositionHint,
1191                              nsString aContentDispositionFilename,
1192                              bool aForceSave,
1193                              int64_t aContentLength,
1194                              bool aWasFileChannel,
1195                              nullable nsIURI aReferrer,
1196                              MaybeDiscardedBrowsingContext aContext,
1197                              bool aShouldCloseWindow);
1199     async PHandlerService();
1201     async AddGeolocationListener(bool highAccuracy);
1202     async RemoveGeolocationListener();
1203     async SetGeolocationHigherAccuracy(bool enable);
1205     async ConsoleMessage(nsString message);
1206     async ScriptErrorWithStack(nsString message, nsString sourceName, nsString sourceLine,
1207                                uint32_t lineNumber, uint32_t colNumber, uint32_t flags,
1208                                nsCString category, bool privateWindow,
1209                                bool fromChromeContext, ClonedMessageData stack);
1211     // Places the items within dataTransfer on the clipboard.
1212     async SetClipboard(IPCTransferable aTransferable,
1213                        int32_t aWhichClipboard);
1215     // Given a list of supported types, returns the clipboard data for the
1216     // first type that matches.
1217     sync GetClipboard(nsCString[] aTypes, int32_t aWhichClipboard)
1218         returns (IPCTransferableData transferableData);
1220     // Returns a list of formats supported by the clipboard
1221     sync GetExternalClipboardFormats(int32_t aWhichClipboard, bool aPlainTextOnly) returns (nsCString[] aTypes);
1223     // Given a list of supported types, returns the clipboard data for the
1224     // first type that matches.
1225     async GetClipboardAsync(nsCString[] aTypes, int32_t aWhichClipboard) returns (IPCTransferableDataOrError transferableData);
1227     // Clears the clipboard.
1228     async EmptyClipboard(int32_t aWhichClipboard);
1230     // Returns true if data of one of the specified types is on the clipboard.
1231     sync ClipboardHasType(nsCString[] aTypes, int32_t aWhichClipboard)
1232         returns (bool hasType);
1234     // Given a list of supported types, returns a list of types that clipboard
1235     // constains the data for the specified type.
1236     async ClipboardHasTypesAsync(nsCString [] aTypes, int32_t aWhichClipboard)
1237         returns (nsCString [] types);
1239     /**
1240      * Notify the parent that the child has started a clipboard write request,
1241      * and that the data will be sent over another IPC message once it is ready.
1242      * @param  aClipboardType
1243      *         The clipboard type defined in nsIClipboard.
1244      */
1245     async PClipboardWriteRequest(int32_t aClipboardType);
1247     // 'Play', 'Beep' and 'PlayEventSound' are the only nsISound methods used in
1248     // the content process.
1249     [Compress] async PlaySound(nullable nsIURI aURL);
1250     [Compress] async Beep();
1251     [Compress] async PlayEventSound(uint32_t aEventId);
1253     sync GetIconForExtension(nsCString aFileExt, uint32_t aIconSize)
1254         returns (uint8_t[] bits);
1256     // Tell the parent that the child has gone idle for the first time.
1257     async FirstIdle();
1259     async CopyFavicon(nullable nsIURI oldURI, nullable nsIURI newURI, bool isPrivate);
1261     async FindImageText(IPCImage image, nsCString[] languages)
1262         returns (TextRecognitionResultOrError result);
1264     /**
1265      * Notifies the parent about a recording device is starting or shutdown.
1266      * @param recordingStatus starting or shutdown
1267      * @param pageURL URL that request that changing the recording status
1268      * @param isAudio recording start with microphone
1269      * @param isVideo recording start with camera
1270      */
1271     async RecordingDeviceEvents(nsString recordingStatus,
1272                                 nsString pageURL,
1273                                 bool isAudio,
1274                                 bool isVideo);
1276     // Graphics errors
1277     async GraphicsError(nsCString aError);
1279     // Driver crash guards. aGuardType must be a member of CrashGuardType.
1280     sync BeginDriverCrashGuard(uint32_t aGuardType) returns (bool crashDetected);
1281     sync EndDriverCrashGuard(uint32_t aGuardType);
1283     async AddIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
1284     async RemoveIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
1286     /**
1287      * This message is only used on X11 platforms.
1288      *
1289      * Send a dup of the plugin process's X socket to the parent
1290      * process.  In theory, this scheme keeps the plugin's X resources
1291      * around until after both the plugin process shuts down *and* the
1292      * parent process closes the dup fd.  This is used to prevent the
1293      * parent process from crashing on X errors if, e.g., the plugin
1294      * crashes *just before* a repaint and the parent process tries to
1295      * use the newly-invalid surface.
1296      */
1297     async BackUpXResources(FileDescriptor aXSocketFd);
1299     async RequestAnonymousTemporaryFile(uint64_t aID);
1301     /**
1302      * Notifies the parent that the child needs no more ForceKill dump.
1303      */
1304     [Priority=control] async NotifyShutdownSuccess();
1306     /**
1307      * Notifies the parent to continue shutting down after the child performs
1308      * its shutdown tasks.
1309      */
1310     async FinishShutdown();
1312     async UpdateDropEffect(uint32_t aDragAction, uint32_t aDropEffect);
1314     /**
1315      * Initiates an asynchronous request for permission for the
1316      * provided principal.
1317      *
1318      * @param aRequests
1319      *   The array of permissions to request.
1320      * @param aPrincipal
1321      *   The principal of the request.
1322      * @param aTopLevelPrincipal
1323      *   The principal of the top level page the request comes from.
1324      * @param tabId
1325      *   To identify which tab issues this request.
1326      *
1327      * NOTE: The principal is untrusted in the parent process. Only
1328      *       principals that can live in the content process should
1329      *       provided.
1330      */
1331     async PContentPermissionRequest(PermissionRequest[] aRequests,
1332                                     nullable nsIPrincipal aPrincipal,
1333                                     nullable nsIPrincipal aTopLevelPrincipal,
1334                                     bool aIsHandlingUserInput,
1335                                     bool aMaybeUnsafePermissionDelegate,
1336                                     TabId tabId);
1338     /**
1339      * If the profiler is running when the process shuts down, this sends the
1340      * profile data collected so far.
1341      *
1342      * @param aProfile
1343      *   This may contain an empty string (unknown issue), an error message
1344      *   starting with '*', or a profile as a stringified JSON object.
1345      */
1346     async ShutdownProfile(nsCString aProfile);
1348     /**
1349      * This sends any collected perf stats data on shutdown.
1350      */
1351     async ShutdownPerfStats(nsCString aPerfStats);
1353     /**
1354      * Request graphics initialization information from the parent.
1355      */
1356     sync GetGraphicsDeviceInitData()
1357         returns (ContentDeviceData aData);
1359     /**
1360      * Request a buffer containing the contents of the output color profile.
1361      * If set, this is the file pointed to by
1362      * gfx.color_management.display_profile, otherwise it contains a
1363      * platform-specific default
1364      */
1365     sync GetOutputColorProfileData()
1366         returns (uint8_t[] aOutputColorProfileData);
1368     /**
1369      * A shared font list (see gfx/thebes/SharedFontList.*) contains a list
1370      * of shared-memory blocks that are used to store all the font list data.
1371      * The font list created in the parent process is the only one that can
1372      * create or store objects into the shared memory; content processes font
1373      * lists have read-only access to it.
1374      *
1375      * To minimize the cost of record allocations, the shared font list
1376      * bump-allocates new objects that it adds to the shared memory blocks
1377      * (i.e. the records stored in the shared memory blocks are only ever
1378      * appended, and never freed except when the entire font list is
1379      * reconstructed).
1380      *
1381      * When initially created by the parent process, the font list may contain
1382      * nothing except a header, and the list of the system's installed font
1383      * family names. Additional data about the families (styled faces available
1384      * and character coverage) is appended to the font list during the session
1385      * as a given font is considered for use, because loading all data for all
1386      * installed fonts during startup is too expensive/slow.
1387      *
1388      * During content process launch, a content process's first step in
1389      * gaining access to the font list is to call GetFontListShmBlock,
1390      * passing index zero in order to get access to the first block, which
1391      * contains the font list header and the list of font-family records
1392      * (which may be virtually all uninitialized at this time, containing
1393      * nothing but the family names). Once a content process determines a
1394      * font-family name it wants to use (e.g. from a CSS font-family list, or
1395      * from preferences), if that Family record has not yet been initialized,
1396      * it will call InitializeFamily (below) to have the parent process
1397      * populate Face records in the shared memory with the family's styles.
1398      * The content process can then pick the face with best style match from
1399      * the available faces according to the CSS font matching algorithm, load
1400      * its character map, then send the map to the parent process using
1401      * SetCharacterMap (so that the parent process can share the map with all
1402      * processes to avoid duplication of work).
1403      *
1404      * At some point, as the parent process adds data to the font list, a new
1405      * shared-memory block will probably be needed. At that point the parent
1406      * will create a new block and append it to its share memory block list.
1407      * The new Block index will start to appear in Pointer records in the
1408      * shared memory, and the content process's can then fetch those other
1409      * blocks using this function as needed.
1410      *
1411      * @param aGeneration
1412      *   The font list has a Generation ID stored in its Header, and any time
1413      *   the parent process needs to reinitialize the list (because of a change
1414      *   in the available font repertoire) a new Generation ID is assigned.
1415      *   Content processes pass the Generation of the list they're using in
1416      *   all messages, so that the parent can recognize if they're out of date
1417      *   and safely ignore such messages. (When the parent rebuilds the list,
1418      *   it will notify all content processes, but they may still send a few
1419      *   messages that relate to the obsolete list before they have processed
1420      *   this notification.)
1421      * @param aIndex
1422      *   (Zero-based) index of the shared-memory block to be mapped.
1423      *   In a typical case, there will be a handful of blocks altogether, so
1424      *   each content process only needs to make this request a few times.
1425      * @returns aHandle
1426      *   Handle that can be used to construct a SharedMemory that maps the
1427      *   requested block of memory.
1428      *   If aGeneration does not match the parent's font list generation ID, or
1429      *   if requesting a block that does not exist (i.e. with aIndex greater
1430      *   than or equal to the number of blocks actually in existence), returns
1431      *   a null handle.
1432      *
1433      * This is a sync message because the content process needs font data in
1434      * order to perform font-matching (e.g. during reflow), and cannot continue
1435      * until it has mapped the font-list memory.
1436      */
1437     sync GetFontListShmBlock(uint32_t aGeneration, uint32_t aIndex)
1438         returns (SharedMemoryHandle aHandle);
1440     /**
1441      * Ask the parent to initialize a given font family, so that face metadata
1442      * will be available. Content processes will only call this for families
1443      * where the Face data has not yet been populated, so it will generally be
1444      * called no more than once per family. (It may not be needed at all, if
1445      * the parent process has already initialized the families that content
1446      * wants to use.)
1447      *
1448      * @param aGeneration
1449      *   Font-list generation, so requests relating to an obsolete list can be
1450      *   ignored (see comments for GetFontListShmBlock).
1451      * @param aFamilyIndex
1452      *   The 0-based index of the Family within the font-list that a content
1453      *   process needs to use.
1454      * @param aLoadCmaps
1455      *   If true, the parent should eagerly load character maps for the faces
1456      *   in the family.
1457      *
1458      * This is a sync message because the content process cannot complete its
1459      * font-matching until the family is fully populated with Face records.
1460      * If we make it async, content processes will reflow using fallbacks,
1461      * and then have to reflow again once all the font information needed
1462      * becomes available.
1463      */
1464     sync InitializeFamily(uint32_t aGeneration, uint32_t aFamilyIndex,
1465                           bool aLoadCmaps);
1467     /**
1468      * Record the character map of a given Face in the font list.
1469      *
1470      * @param aGeneration
1471      *   Font-list generation, so requests relating to an obsolete list can be
1472      *   ignored (see comments for GetFontListShmBlock).
1473      * @param aFacePtr
1474      *   Font-list shared-memory "pointer" to the Face record to be updated.
1475      *   A Pointer is a record of a shared-memory block index and an offset
1476      *   within that block, which each process that maps the block can convert
1477      *   into a real pointer in its address space.
1478      * @param aMap
1479      *   The character coverage map of the face. (This will be stored as a
1480      *   SharedBitSet record within the shared font list, and the Face record
1481      *   will be updated to reference it.)
1482      */
1483     async SetCharacterMap(uint32_t aGeneration, Pointer aFacePtr, gfxSparseBitSet aMap);
1485     /**
1486      * Ask the parent to set up the merged charmap for a family, to accelerate
1487      * future fallback searches.
1488      * aFamilyPtr may refer to an element of either the Families() or AliasFamilies().
1489      */
1490     async SetupFamilyCharMap(uint32_t aGeneration, Pointer aFamilyPtr);
1492     /**
1493      * Ask the parent to try and complete the InitOtherFamilyNames task, because
1494      * we're trying to look up a localized font name. This is a sync method so that
1495      * the update will be available before the child continues reflow; however, it
1496      * is possible the task will have timed-out in the parent and not actually
1497      * completed during this call.
1498      *
1499      * @param aGeneration
1500      *   Font-list generation, so requests relating to an obsolete list can be
1501      *   ignored (see comments for GetFontListShmBlock).
1502      * @param aDefer
1503      *   Parameter aDeferOtherFamilyNamesLoading to be passed to
1504      *   gfxPlatformFontList::InitOtherFamilyNames, to determine whether name
1505      *   loading should be deferred to a background task or run immediately.
1506      * @param aLoaded
1507      *   Returns whether the font name loading process has completed.
1508      *
1509      * TODO: This is currently a sync message but can probably be made async,
1510      * at the cost of an increased chance of some testcases failing because
1511      * they depend on lazily-loaded font names.
1512      */
1513     sync InitOtherFamilyNames(uint32_t aGeneration, bool aDefer) returns (bool aLoaded);
1515     /**
1516      * Ask the parent to load all font character maps, as we need to do an
1517      * exhaustive font-fallback search. This is done asynchronously; when it
1518      * finishes, the parent will trigger global reflow so that font selection
1519      * is re-done in all content, making use of the newly-loaded cmaps.
1520      * Normally this will only happen once per browser session (unless the
1521      * font list is rebuilt due to installation/removal of system fonts).
1522      *
1523      * @param aGeneration
1524      *   Font-list generation, so requests relating to an obsolete list can be
1525      *   ignored (see comments for GetFontListShmBlock).
1526      * @param aStartIndex
1527      *   The family index to start from; the sender has determined that cmaps
1528      *   up to this point are already loaded.
1529      */
1530     async StartCmapLoading(uint32_t aGeneration, uint32_t aStartIndex);
1532     /**
1533      * Ask the parent for a specific hyphenation resource (identified by URI)
1534      * as a shared memory block.
1535      *
1536      * This is a sync method because at the point where a content process finds
1537      * that it requires a particular hyphenation dictionary, this is blocking
1538      * reflow; making it async would require scheduling another reflow after
1539      * the resource is available, and a possible layout "jump" as line-breaks
1540      * change. Note that the content process retains a reference to each such
1541      * resource it requests, so it will only make this call once per locale for
1542      * which hyphenation data exists.
1543      *
1544      * @param aURI
1545      *   The URI (which currently must always point to an omnijar resource)
1546      *   for the required hyphenation dictionary.
1547      * @param aHandle
1548      *   Returns the shmem handle to the resource (or an invalid shmem handle
1549      *   in case of failure).
1550      * @param aLoaded
1551      *   Returns the size in bytes of the resource.
1552      */
1553     sync GetHyphDict(nullable nsIURI aURI) returns (SharedMemoryHandle aHandle, uint32_t aSize);
1555     async CreateWindow(PBrowser aThisTab,
1556                        MaybeDiscardedBrowsingContext aParent,
1557                        PBrowser aNewTab,
1558                        uint32_t aChromeFlags,
1559                        bool aCalledFromJS,
1560                        bool aForPrinting,
1561                        bool aForWindowDotPrint,
1562                        nullable nsIURI aURIToLoad,
1563                        nsCString aFeatures,
1564                        nullable nsIPrincipal aTriggeringPrincipal,
1565                        nullable nsIContentSecurityPolicy aCsp,
1566                        nullable nsIReferrerInfo aReferrerInfo,
1567                        OriginAttributes aOriginAttributes)
1568         returns (CreatedWindowInfo window);
1570     async CreateWindowInDifferentProcess(
1571       PBrowser aThisTab,
1572       MaybeDiscardedBrowsingContext aParent,
1573       uint32_t aChromeFlags,
1574       bool aCalledFromJS,
1575       nullable nsIURI aURIToLoad,
1576       nsCString aFeatures,
1577       nsString aName,
1578       nullable nsIPrincipal aTriggeringPrincipal,
1579       nullable nsIContentSecurityPolicy aCsp,
1580       nullable nsIReferrerInfo aReferrerInfo,
1581       OriginAttributes aOriginAttributes);
1583     /**
1584      * Tell the parent that a decoder's' benchmark has been completed.
1585      * The result can then be stored in permanent storage.
1586      */
1587     async NotifyBenchmarkResult(nsString aCodecName, uint32_t aDecodeFPS);
1589     /**
1590      * Notify `push-message` observers without data in the parent.
1591      */
1592     async NotifyPushObservers(nsCString scope, nullable nsIPrincipal principal,
1593                               nsString messageId);
1595     /**
1596      * Notify `push-message` observers with data in the parent.
1597      */
1598     async NotifyPushObserversWithData(nsCString scope, nullable nsIPrincipal principal,
1599                                       nsString messageId, uint8_t[] data);
1601     /**
1602      * Notify `push-subscription-change` observers in the parent.
1603      */
1604     async NotifyPushSubscriptionChangeObservers(nsCString scope,
1605                                                 nullable nsIPrincipal principal);
1607      async GetFilesRequest(nsID aID, nsString aDirectory, bool aRecursiveFlag);
1608      async DeleteGetFilesRequest(nsID aID);
1610      async StoreAndBroadcastBlobURLRegistration(nsCString url, IPCBlob blob,
1611                                                 nullable nsIPrincipal principal, nsCString aPartitionKey);
1613      async UnstoreAndBroadcastBlobURLUnregistration(nsCString url, nullable nsIPrincipal principal);
1615     /**
1616      * Messages for communicating child Glean data to the parent process
1617      */
1618     async RecordPageLoadEvent(PageLoadExtra event);
1620     /**
1621      * Messages for communicating child Telemetry to the parent process
1622      */
1623     async AccumulateChildHistograms(HistogramAccumulation[] accumulations);
1624     async AccumulateChildKeyedHistograms(KeyedHistogramAccumulation[] accumulations);
1625     async UpdateChildScalars(ScalarAction[] updates);
1626     async UpdateChildKeyedScalars(KeyedScalarAction[] updates);
1627     async RecordChildEvents(ChildEventData[] events);
1628     async RecordDiscardedData(DiscardedData data);
1630     async AddMemoryReport(MemoryReport aReport);
1632     async BHRThreadHang(HangDetails aHangDetails);
1634     /*
1635      * Adds a certificate exception for the given hostname and port.
1636      */
1637     async AddCertException(nullable nsIX509Cert aCert, nsCString aHostName,
1638                            int32_t aPort, OriginAttributes aOriginAttributes,
1639                            bool aIsTemporary)
1640           returns (nsresult success);
1642     /*
1643      * Determines whether storage access can be granted automatically by the
1644      * storage access API without showing a user prompt.
1645      */
1646     async AutomaticStorageAccessPermissionCanBeGranted(nullable nsIPrincipal aPrincipal)
1647           returns (bool success);
1649     /*
1650      * A 3rd party tracking origin (aTrackingOrigin) has received the permission
1651      * granted to have access to aGrantedOrigin when loaded by aParentWindowId.
1652      */
1653     async StorageAccessPermissionGrantedForOrigin(uint64_t aTopLevelWindowId,
1654                                                   MaybeDiscardedBrowsingContext aParentContext,
1655                                                   nullable nsIPrincipal aTrackingPrincipal,
1656                                                   nsCString aTrackingOrigin,
1657                                                   int aAllowMode,
1658                                                   StorageAccessPermissionGrantedReason? aReason,
1659                                                   bool aFrameOnly)
1660           returns (bool unused);
1662     async CompleteAllowAccessFor(MaybeDiscardedBrowsingContext aParentContext,
1663                                  uint64_t aTopLevelWindowId,
1664                                  nullable nsIPrincipal aTrackingPrincipal,
1665                                  nsCString aTrackingOrigin,
1666                                  uint32_t aCookieBehavior,
1667                                  StorageAccessPermissionGrantedReason aReason)
1668           returns (StorageAccessPromptChoices? choice);
1670     async SetAllowStorageAccessRequestFlag(
1671                                  nullable nsIPrincipal aEmbeddingPrincipal,
1672                                  nullable nsIURI aEmbeddedOrigin)
1673           returns (bool success);
1675     async TestAllowStorageAccessRequestFlag(
1676                                  nullable nsIPrincipal aEmbeddedPrincipal,
1677                                  nullable nsIURI aEmbeddingOrigin)
1678           returns (bool success);
1680     async StoreUserInteractionAsPermission(nullable nsIPrincipal aPrincipal);
1682     async TestCookiePermissionDecided(MaybeDiscardedBrowsingContext aContext,
1683                          nullable nsIPrincipal aPrincipal)
1684           returns (bool? allowed);
1686     async TestStorageAccessPermission(nullable nsIPrincipal aEmbeddingPrincipal,
1687                          nsCString aEmbeddedOrigin)
1688           returns (bool? allowed);
1690    /**
1691     * When media element's controlled state changed in the content process, we
1692     * have to notify the chrome process in order to update the status of the
1693     * corresponding media controller, which is used to control all media in the
1694     * certain tab. We would use the browsing context to find the corresponding
1695     * controller.
1696     */
1697     async NotifyMediaPlaybackChanged(MaybeDiscardedBrowsingContext aContext,
1698                                      MediaPlaybackState aState);
1700    /**
1701     * When media became audible or inaudible in content process, we have to
1702     * notify chrome process in order to which tab is audible.
1703     */
1704     async NotifyMediaAudibleChanged(MaybeDiscardedBrowsingContext aContext,
1705                                     MediaAudibleState aState);
1707    /**
1708     * When media enabled or disabled the Picture-in-Picture mode, we have to
1709     * update that to the media controller in the chrome process.
1710     */
1711     async NotifyPictureInPictureModeChanged(
1712         MaybeDiscardedBrowsingContext aContext, bool aEnabled);
1714    /**
1715     * This method is used to update media session's status when it's being
1716     * created or destroyed.
1717     */
1718     async NotifyMediaSessionUpdated(MaybeDiscardedBrowsingContext aContext, bool aIsCreated);
1720     /**
1721      * This method is used to update media session's media metadata whenever its
1722      * metadata is being updated.
1723      */
1724     async NotifyUpdateMediaMetadata(MaybeDiscardedBrowsingContext aContext,
1725                                     MediaMetadataBase? aMetadata);
1727     /**
1728      * This method is used to update media session's playback state whenever its
1729      * playback state is changed.
1730      */
1731     async NotifyMediaSessionPlaybackStateChanged(
1732         MaybeDiscardedBrowsingContext aContext,
1733         MediaSessionPlaybackState aMetadata);
1735     /**
1736      * This method is used to update media session's supported media session
1737      * action when the action becomes supported or unsupported.
1738      */
1739     async NotifyMediaSessionSupportedActionChanged(
1740         MaybeDiscardedBrowsingContext aContext,
1741         MediaSessionAction aAction,
1742         bool aEnabled);
1744     /**
1745      * This method is used to notify the media controller in chrome process that
1746      * the media element in the browsing context entered fullscreen.
1747      */
1748     async NotifyMediaFullScreenState(
1749         MaybeDiscardedBrowsingContext aContext,
1750         bool aIsInFullScreen);
1752     /**
1753      * This method is used to update media session's position state whenever its
1754      * position state is being updated.
1755      */
1756     async NotifyPositionStateChanged(
1757         MaybeDiscardedBrowsingContext aContext,
1758         PositionState aState);
1760     /**
1761      * This method will make canonical browsing context to update the count of
1762      * callers which want to keep the page from being suspended even if the page
1763      * is inactive.
1764      */
1765     async AddOrRemovePageAwakeRequest(MaybeDiscardedBrowsingContext aContext,
1766                                       bool aShouldAddCount);
1768 #if defined(XP_WIN)
1769     /**
1770      * Due to sandboxing, a child process's UntrustedModulesProcessor cannot
1771      * obtain enough information about a DLL file to determine its
1772      * trustworthiness. This API asks the chrome process to perform that
1773      * evaluation.
1774      */
1775     async GetModulesTrust(ModulePaths aModPaths, bool aRunAtNormalPriority)
1776         returns (ModulesMapResult? modMapResult);
1777 #endif  // defined(XP_WIN)
1779     /**
1780      * Used to route shutdown diagnostic info from the content process
1781      * ServiceWorkers to the parent process' ServiceWorkerManager's
1782      * ServiceWorkerShutdownBlocker. (The only other actor chain available
1783      * for this would be very convoluted and create ordering problems).
1784      */
1785     async ReportServiceWorkerShutdownProgress(uint32_t aShutdownStateId,
1786                                               Progress aProgress);
1788     /**
1789      * Whenever a document is updating the OrientationLock, we need to
1790      * reject the orientationPendingPromises in other processes.
1791      */
1792     async AbortOtherOrientationPendingPromises(MaybeDiscardedBrowsingContext aContext);
1794     async HistoryReload(MaybeDiscardedBrowsingContext aContext, uint32_t aReloadFlags);
1796     async NotifyOnHistoryReload(MaybeDiscardedBrowsingContext aContext,
1797                                 bool aForceReload)
1798             returns (bool canReload, nsDocShellLoadState? loadState,
1799                      bool? reloadActiveEntry);
1801     async HistoryCommit(MaybeDiscardedBrowsingContext aContext,
1802                         uint64_t aLoadID, nsID aChangeID, uint32_t aLoadType,
1803                         bool aPersist, bool aCloneEntryChildren,
1804                         bool aChannelExpired, uint32_t aCacheKey);
1806     async HistoryGo(MaybeDiscardedBrowsingContext aContext, int32_t aOffset,
1807                     uint64_t aHistoryEpoch, bool aRequireUserInteraction,
1808                     bool aUserActivation) returns(int32_t? requestedIndex);
1810     async BlobURLDataRequest(nsCString aBlobURL,
1811                              nullable nsIPrincipal aTriggeringPrincipal,
1812                              nullable nsIPrincipal aLoadingPrincipal,
1813                              OriginAttributes aOriginAttributes,
1814                              uint64_t aInnerWindowId,
1815                              nsCString aPartitionKey)
1816       returns (BlobURLDataRequestResult aResult);
1818     async SetActiveSessionHistoryEntry(MaybeDiscardedBrowsingContext context,
1819                                        nsPoint? previousScrollPosition,
1820                                        SessionHistoryInfo info, uint32_t loadType,
1821                                        uint32_t updatedCacheKey, nsID changeID);
1822     async ReplaceActiveSessionHistoryEntry(
1823         MaybeDiscardedBrowsingContext context, SessionHistoryInfo info);
1825     async RemoveDynEntriesFromActiveSessionHistoryEntry(
1826         MaybeDiscardedBrowsingContext aContext);
1828     async RemoveFromSessionHistory(
1829         MaybeDiscardedBrowsingContext aContext, nsID changeID);
1831     // Called when a nsDocShellLoadState which was received over IPC is
1832     // destroyed in the content process to clean up pending state left behind
1833     // tracking the load state in the parent process.
1834     [LazySend] async CleanupPendingLoadState(uint64_t aLoadIdentifier);
1836 both:
1837     async ScriptError(nsString message, nsString sourceName, nsString sourceLine,
1838                       uint32_t lineNumber, uint32_t colNumber, uint32_t flags,
1839                       nsCString category, bool privateWindow, uint64_t innerWindowId,
1840                       bool fromChromeContext);
1842     /**
1843      * Used in fission to report timing data when the parent window is in
1844      * another process. Child frame will send data to its ContentParent which
1845      * will then identify the ContentParent for the innerWindowId and pass
1846      * the data to the correct process.
1847      * loadInfo is passed in order to enforce same-origin security checks
1848      * aData must be non-null.
1849      */
1850     async ReportFrameTimingData(LoadInfoArgs loadInfo, nsString entryName,
1851                                 nsString initiatorType,
1852                                 UniquePtr<PerformanceTimingData> aData);
1854     async CommitBrowsingContextTransaction(MaybeDiscardedBrowsingContext aContext,
1855                                            BrowsingContextTransaction aTransaction,
1856                                            uint64_t aEpoch);
1858     async AsyncMessage(nsString aMessage, ClonedMessageData aData);
1860     /**
1861      * Notify `push-subscription-modified` observers in the parent and child.
1862      */
1863     async NotifyPushSubscriptionModifiedObservers(nsCString scope,
1864                                                   nullable nsIPrincipal principal);
1866     /**
1867      * Send a Push error message to all service worker clients in the parent or
1868      * child.
1869      */
1870     async PushError(nsCString scope, nullable nsIPrincipal principal, nsString message,
1871                     uint32_t flags);
1873     /**
1874      * Creates a new BrowsingContext, initialized with the values provided in
1875      * `BrowsingContextInitializer`.
1876      *
1877      * This message may only be sent to the parent in limited situations. If the
1878      * new BrowsingContext has a parent window, it must be owned by the
1879      * embedding process, otherwise it must be owned by the opener, if set.
1880      */
1881     [LazySend] async CreateBrowsingContext(uint64_t aGroupId, BrowsingContextInitializer aInit);
1883     /**
1884      * If aDoDiscard is true, discards the passed-in BrowsingContext. If the
1885      * BrowsingContext has already been discarded, this message does nothing.
1886      * If the receiver is the parent process, resolves when all content
1887      * processes have flagged the BrowsingContext as discarded, and if the
1888      * receiver is a child process, resolves when that child process has flagged
1889      * the BrowsingContext as discarded.
1890      */
1891     async DiscardBrowsingContext(MaybeDiscardedBrowsingContext aContext, bool aDoDiscard)
1892             returns (uint64_t unused);
1894     async AdjustWindowFocus(MaybeDiscardedBrowsingContext aContext,
1895                             bool aIsVisible, uint64_t aActionId);
1896     async WindowClose(MaybeDiscardedBrowsingContext aContext,
1897                       bool aTrustedCaller);
1898     async WindowFocus(MaybeDiscardedBrowsingContext aContext,
1899                       CallerType aCallerType, uint64_t aActionId);
1900     async WindowBlur(MaybeDiscardedBrowsingContext aContext,
1901                      CallerType aCallerType);
1902     async RaiseWindow(MaybeDiscardedBrowsingContext aContext, CallerType aCallerType, uint64_t aActionId);
1903     async ClearFocus(MaybeDiscardedBrowsingContext aContext);
1904     async SetFocusedBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1905     async SetActiveBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1906     async UnsetActiveBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1907     async SetFocusedElement(MaybeDiscardedBrowsingContext aContext, bool aNeedsFocus);
1908     async FinalizeFocusOuter(MaybeDiscardedBrowsingContext aContext, bool aCanFocus,
1909                              CallerType aCallerType);
1910 parent:
1911     [LazySend] async InsertNewFocusActionId(uint64_t aActionId);
1912     async BlurToParent(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1913                       MaybeDiscardedBrowsingContext aBrowsingContextToClear,
1914                       MaybeDiscardedBrowsingContext aAncestorBrowsingContextToFocus,
1915                       bool aIsLeavingDocument, bool aAdjustWidget,
1916                       bool aBrowsingContextToClearHandled,
1917                       bool aAncestorBrowsingContextToFocusHandled, uint64_t aActionId);
1918 child:
1919     async BlurToChild(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1920                       MaybeDiscardedBrowsingContext aBrowsingContextToClear,
1921                       MaybeDiscardedBrowsingContext aAncestorBrowsingContextToFocus,
1922                       bool aIsLeavingDocument, bool aAdjustWidget, uint64_t aActionId);
1923     async SetupFocusedAndActive(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1924                                 uint64_t aActionIdForFocused,
1925                                 MaybeDiscardedBrowsingContext aActiveBrowsingContext,
1926                                 uint64_t aActionId);
1927     async ReviseActiveBrowsingContext(uint64_t aOldActionId,
1928                                       MaybeDiscardedBrowsingContext aActiveBrowsingContext,
1929                                       uint64_t aNewActionId);
1930     async ReviseFocusedBrowsingContext(uint64_t aOldActionId,
1931                                        MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1932                                        uint64_t aNewActionId);
1933 both:
1934     async MaybeExitFullscreen(MaybeDiscardedBrowsingContext aContext);
1935     async WindowPostMessage(MaybeDiscardedBrowsingContext aContext,
1936                             ClonedOrErrorMessageData aMessage,
1937                             PostMessageData aData);
1939     async CommitWindowContextTransaction(MaybeDiscardedWindowContext aContext,
1940                                          WindowContextTransaction aTransaction,
1941                                          uint64_t aEpoch);
1943 child:
1944     // NOTE: These methods are only needed on the child, as the parent
1945     // WindowContext is managed using the PWindowGlobal actor's lifecycle.
1946     [LazySend] async CreateWindowContext(WindowContextInitializer aInit);
1947     async DiscardWindowContext(uint64_t aContextId) returns (bool unused);
1949 parent:
1950     // Temporary (bug 1641989) conduit for Glean data in content processes.
1951     // Sent from time-to-time to limit the amount of data vulnerable to loss.
1952     // Buffer contains bincoded Rust structs.
1953     async FOGData(ByteBuf buf);
1955 child:
1956     // Temporary (bug 1641989) conduit for Glean data in content processes.
1957     // Tells the child to flush any pending data. Used in tests and ping
1958     // assembly. Buffer contains bincoded Rust structs.
1959     async FlushFOGData() returns (ByteBuf buf);
1961 parent:
1962     async SetContainerFeaturePolicy(MaybeDiscardedBrowsingContext aContainerContext,
1963                                     nullable FeaturePolicy aContainerFeaturePolicy);
1965     // Obtain an icon from the system widget toolkit, in nsIconDecoder
1966     // format.  Not supported (or needed) on all platforms; see the
1967     // implementation in ContentParent::RecvGetSystemIcon for details.
1968     async GetSystemIcon(nullable nsIURI aURI) returns (nsresult aResult, ByteBuf? aData);
1970 #ifdef FUZZING_SNAPSHOT
1971     // Used by the child process to signal that it is ready to start fuzzing.
1972     // This can in particular be used to wait for a particular event in a
1973     // test document before taking the snapshot and starting e.g. IPC fuzzing.
1974     async SignalFuzzingReady();
1975 #endif