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