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 PClipboardReadRequest;
10 include protocol PClipboardWriteRequest;
11 include protocol PCompositorManager;
12 include protocol PContentPermissionRequest;
13 include protocol PCycleCollectWithLogs;
14 include protocol PDocumentChannel;
15 include protocol PExtensions;
16 include protocol PExternalHelperApp;
17 include protocol PHandlerService;
18 include protocol PHal;
19 include protocol PHeapSnapshotTempFileHelper;
20 include protocol PProcessHangMonitor;
21 include protocol PImageBridge;
22 include protocol PRemotePrintJob;
23 include protocol PMedia;
24 include protocol PNecko;
25 include protocol PStreamFilter;
26 include protocol PGMPContent;
27 include protocol PGMPService;
28 include protocol PGMP;
30 include protocol PSpeechSynthesis;
32 include protocol PTestShell;
33 include protocol PRemoteSpellcheckEngine;
34 include protocol PWebBrowserPersistDocument;
36 include protocol PWebrtcGlobal;
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;
48 include WindowGlobalTypes;
51 include IPCTransferable;
52 include PPrintingTypes;
54 include ProtocolTypes;
55 include PBackgroundSharedTypes;
56 include PContentPermission;
57 include GraphicsMessages;
58 include MemoryReportTypes;
59 include ClientIPCTypes;
62 include NeckoChannelParams;
64 include LookAndFeelTypes;
66 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
67 include protocol PSandboxTesting;
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";
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 "nsIDocumentViewer.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
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:
178 // Used on Android to pass the list of fonts on the device
179 // to the child process
180 struct SystemFontListEntry {
181 nsCString familyName;
184 uint32_t weightRange;
185 uint32_t stretchRange;
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;
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 {
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
218 struct SystemFontList {
219 SystemFontListEntry[] entries;
220 #ifdef MOZ_WIDGET_GTK
221 SystemFontOptions options;
225 union SystemParameterValue {
230 struct ClipboardCapabilities {
231 bool supportsSelectionClipboard;
232 bool supportsFindClipboard;
233 bool supportsSelectionCache;
236 union FileDescOrError {
241 struct DomainPolicyClone
244 nullable nsIURI[] blocklist;
245 nullable nsIURI[] allowlist;
246 nullable nsIURI[] superBlocklist;
247 nullable nsIURI[] superAllowlist;
250 struct AndroidSystemInfo
253 nsString manufacturer;
254 nsString release_version;
256 uint32_t sdk_version;
260 struct GetFilesResponseSuccess
265 struct GetFilesResponseFailure
270 union GetFilesResponseResult
272 GetFilesResponseSuccess;
273 GetFilesResponseFailure;
276 struct BlobURLRegistrationData
280 nullable nsIPrincipal principal;
281 nsCString partitionKey;
285 struct JSWindowActorEventDecl
295 struct JSWindowActorInfo
300 // True if `url` is for ESM.
301 // False if `url` is for JSM or nothing.
304 // This is to align with JSProcessActorInfo.
305 // This attribute isn't used for JSWindow Actors.
306 bool loadInDevToolsLoader;
308 // The module of the url.
311 JSWindowActorEventDecl[] events;
313 // Observer notifications this actor listens to.
314 nsCString[] observers;
316 nsCString[] remoteTypes;
317 nsString[] messageManagerGroups;
320 struct JSProcessActorInfo
322 // The name of the actor.
325 // True if `url` is for ESM.
326 // False if `url` is for JSM or nothing.
329 // True if the actor should be loaded in the distinct loader dedicated to DevTools.
330 bool loadInDevToolsLoader;
332 // The module of the url.
335 // Observer notifications this actor listens to.
336 nsCString[] observers;
337 nsCString[] remoteTypes;
346 struct GMPCapabilityData
350 GMPAPITags[] capabilities;
353 struct L10nFileSourceDescriptor {
355 nsCString metasource;
365 int32_t captivePortalState;
367 bool haveBidiKeyboards;
368 nsCString[] dictionaries;
369 ClipboardCapabilities clipboardCaps;
370 DomainPolicyClone domainPolicy;
371 nullable nsIURI userContentSheetURL;
372 GfxVarUpdate[] gfxNonDefaultVarUpdates;
373 ContentDeviceData contentDeviceData;
374 GfxInfoFeatureStatus[] gfxFeatureStatus;
375 nsCString[] appLocales;
376 nsCString[] requestedLocales;
377 L10nFileSourceDescriptor[] l10nFileSources;
378 DynamicScalarDefinition[] dynamicScalarDefs;
379 MetricMask perfStatsMask;
381 ResolverMode trrMode;
382 // This is the value of network.trr.mode and can be diffrent than trrMode.
383 ResolverMode trrModeFromPref;
386 struct VisitedQueryResult
392 struct StringBundleDescriptor
395 FileDescriptor mapFile;
399 struct IPCURLClassifierFeature
401 nsCString featureName;
403 nsCString exceptionHostList;
406 // Transport structure for Notifications API notifications
407 // (https://developer.mozilla.org/en-US/docs/Web/API/notification) instances
408 // used exclusively by the NotificationEvent PContent method.
409 struct NotificationEventData
411 nsCString originSuffix;
424 struct PostMessageData
426 MaybeDiscardedBrowsingContext source;
428 nsString targetOrigin;
429 nullable nsIURI targetOriginURI;
430 nullable nsIPrincipal callerPrincipal;
431 nullable nsIPrincipal subjectPrincipal;
432 nullable nsIURI callerURI;
433 bool isFromPrivateWindow;
434 nsCString scriptLocation;
435 uint64_t innerWindowId;
438 union SyncedContextInitializer
440 BrowsingContextInitializer;
441 WindowContextInitializer;
444 union BlobURLDataRequestResult
450 struct TextRecognitionQuad {
456 struct TextRecognitionResult {
457 TextRecognitionQuad[] quads;
460 union TextRecognitionResultOrError {
461 TextRecognitionResult;
468 SurfaceFormat format;
472 union PClipboardReadRequestOrError {
473 PClipboardReadRequest;
478 * The PContent protocol is a top-level protocol between the UI process
479 * and a content process. There is exactly one PContentParent/PContentChild pair
480 * for each content process.
482 [NestedUpTo=inside_cpow, NeedsOtherPid]
483 sync protocol PContent
486 manages PClipboardReadRequest;
487 manages PClipboardWriteRequest;
488 manages PContentPermissionRequest;
489 manages PCycleCollectWithLogs;
491 manages PExternalHelperApp;
493 manages PHandlerService;
494 manages PHeapSnapshotTempFileHelper;
495 manages PRemotePrintJob;
499 manages PSpeechSynthesis;
502 manages PRemoteSpellcheckEngine;
503 manages PWebBrowserPersistDocument;
505 manages PWebrtcGlobal;
507 manages PURLClassifier;
508 manages PURLClassifierLocal;
509 manages PScriptCache;
510 manages PSessionStorageObserver;
511 manages PBenchmarkStorage;
513 // Depending on exactly how the new browser is being created, it might be
514 // created from either the child or parent process!
516 // The child creates the PBrowser as part of
517 // BrowserChild::BrowserFrameProvideWindow (which happens when the child's
518 // content calls window.open()), and the parent creates the PBrowser as part
519 // of ContentParent::CreateBrowser.
521 // When the parent constructs a PBrowser, the child trusts the attributes it
522 // receives from the parent. In that case, the context should be
523 // FrameIPCTabContext.
525 // When the child constructs a PBrowser, the parent doesn't trust the
526 // attributes it receives from the child. In this case, context must have
527 // type PopupIPCTabContext. The parent checks that if the opener is a
528 // browser element, the context is also for a browser element.
530 // If |sameTabGroupAs| is non-zero, the new tab should go in the same
531 // TabGroup as |sameTabGroupAs|. This parameter should always be zero
532 // for PBrowser messages sent from the child to the parent.
534 // Separate messages are used for the parent and child side constructors due
535 // to the differences in data and actor setup required.
537 // Keep the last 3 attributes in sync with GetProcessAttributes!
539 async ConstructPopupBrowser(ManagedEndpoint<PBrowserParent> browserEp,
540 ManagedEndpoint<PWindowGlobalParent> windowEp,
541 TabId tabId, IPCTabContext context,
542 WindowGlobalInit windowInit,
543 uint32_t chromeFlags);
545 // TODO: Do I need to make this return something to watch for completion?
546 // Guess we'll see how we end up triggering the actual print, for preview
547 // this should be enough...
548 async CloneDocumentTreeInto(MaybeDiscardedBrowsingContext aSourceBc,
549 MaybeDiscardedBrowsingContext aTargetBc,
550 PrintData aPrintData);
552 async UpdateRemotePrintSettings(MaybeDiscardedBrowsingContext aBc,
553 PrintData aPrintData);
558 async ConstructBrowser(ManagedEndpoint<PBrowserChild> browserEp,
559 ManagedEndpoint<PWindowGlobalChild> windowEp,
561 IPCTabContext context,
562 WindowGlobalInit windowInit,
563 uint32_t chromeFlags, ContentParentId cpId,
564 bool isForBrowser, bool isTopLevel);
567 // For parent->child, aBrowser must be non-null; aContext can
568 // be null to indicate the browser's current root document, or non-null
569 // to persist a subdocument. For child->parent, arguments are
570 // ignored and should be null.
571 async PWebBrowserPersistDocument(nullable PBrowser aBrowser,
572 MaybeDiscardedBrowsingContext aContext);
574 async RawMessage(JSActorMessageMeta aMetadata, ClonedMessageData? aData,
575 ClonedMessageData? aStack);
578 async InitGMPService(Endpoint<PGMPServiceChild> service);
579 async InitProcessHangMonitor(Endpoint<PProcessHangMonitorChild> hangMonitor);
580 async InitProfiler(Endpoint<PProfilerChild> aEndpoint);
582 // Give the content process its endpoints to the compositor.
584 Endpoint<PCompositorManagerChild> compositor,
585 Endpoint<PImageBridgeChild> imageBridge,
586 Endpoint<PVRManagerChild> vr,
587 Endpoint<PRemoteDecoderManagerChild> video,
588 uint32_t[] namespaces);
590 // Re-create the rendering stack using the given endpoints. This is sent
591 // after the compositor process has crashed. The new endpoints may be to a
592 // newly launched GPU process, or the compositor thread of the UI process.
593 async ReinitRendering(
594 Endpoint<PCompositorManagerChild> compositor,
595 Endpoint<PImageBridgeChild> bridge,
596 Endpoint<PVRManagerChild> vr,
597 Endpoint<PRemoteDecoderManagerChild> video,
598 uint32_t[] namespaces);
600 async NetworkLinkTypeChange(uint32_t type);
601 async SocketProcessCrashed();
603 // Re-create the rendering stack for a device reset.
604 async ReinitRenderingForDeviceReset();
607 * Enable system-level sandboxing features, if available. Can
608 * usually only be performed zero or one times. The child may
609 * abnormally exit if this fails; the details are OS-specific.
611 async SetProcessSandbox(FileDescriptor? aBroker);
613 async RequestMemoryReport(uint32_t generation,
615 bool minimizeMemoryUsage,
616 FileDescriptor? DMDFile)
617 returns (uint32_t aGeneration);
621 * Used by third-party modules telemetry (aka "untrusted modules" telemetry)
622 * to pull data from content processes.
624 async GetUntrustedModulesData() returns (UntrustedModulesData? data);
627 * This method is used to notifty a child process to start
628 * processing module loading events in UntrustedModulesProcessor.
629 * This should be called when the parent process has gone idle.
631 async UnblockUntrustedModulesThread();
632 #endif // defined(XP_WIN)
635 * Communication between the PuppetBidiKeyboard and the actual
636 * BidiKeyboard hosted by the parent
638 async BidiKeyboardNotify(bool isLangRTL, bool haveBidiKeyboards);
641 * Dump this process's GC and CC logs to the provided files.
643 * For documentation on the other args, see dumpGCAndCCLogsToFile in
644 * nsIMemoryInfoDumper.idl
646 async PCycleCollectWithLogs(bool dumpAllTraces,
647 FileDescriptor gcLog,
648 FileDescriptor ccLog);
652 async PScriptCache(FileDescOrError cacheFile, bool wantCacheData);
654 async RegisterChrome(ChromePackage[] packages, SubstitutionMapping[] substitutions,
655 OverrideMapping[] overrides, nsCString locale, bool reset);
656 async RegisterChromeItem(ChromeRegistryItem item);
658 async ClearImageCacheFromPrincipal(nullable nsIPrincipal aPrincipal);
660 async ClearImageCacheFromBaseDomain(nsCString aBaseDomain);
662 async ClearImageCache(bool privateLoader, bool chrome);
664 async ClearStyleSheetCache(nullable nsIPrincipal? aForPrincipal,
665 nsCString? aBaseDomain);
667 async SetOffline(bool offline);
668 async SetConnectivity(bool connectivity);
669 async SetCaptivePortalState(int32_t aState);
670 async SetTRRMode(ResolverMode aMode, ResolverMode aModeFromPref);
672 async NotifyVisited(VisitedQueryResult[] uri);
675 * Tell the child that the system theme has changed, and that a repaint is
678 async ThemeChanged(FullLookAndFeel lookAndFeelData, ThemeChangeKind aKind);
680 async PreferenceUpdate(Pref pref);
681 async VarUpdate(GfxVarUpdate var);
683 async UpdatePerfStatsCollectionMask(uint64_t aMask);
684 async CollectPerfStatsJSON() returns (nsCString aStats);
686 async CollectScrollingMetrics() returns (uint32_t pixelsScrolled, uint32_t scrollDurationMS);
688 async NotifyAlertsObserver(nsCString topic, nsString data);
690 async GeolocationUpdate(nullable nsIDOMGeoPosition aPosition);
692 async GeolocationError(uint16_t errorCode);
694 async UpdateDictionaryList(nsCString[] dictionaries);
696 async UpdateFontList(SystemFontList fontList);
699 * The shared font list has been updated by the parent, so child processes
700 * should globally reflow everything to pick up new character coverage etc.
701 * If aFullRebuild is true, child processes must discard and recreate
702 * their mappings to the shmem blocks, as those are no longer valid.
703 * This message has raised priority so that it will take precedence over
704 * vsync messages to the child.
706 [Priority=mediumhigh] async RebuildFontList(bool aFullRebuild);
709 * The shared font list has been modified, potentially adding matches
710 * for src:local() names that were previously not known, so content
711 * may need to be reflowed.
713 async FontListChanged();
716 * The font list or prefs have been updated in such a way that we might need
717 * to do a reflow and maybe reframe.
719 async ForceGlobalReflow(bool aNeedsReframe);
722 * A new shmem block has been added to the font list; the child process
723 * should map the new block and add to its index.
725 async FontListShmBlockAdded(uint32_t aGeneration, uint32_t aIndex,
726 SharedMemoryHandle aHandle);
728 async UpdateAppLocales(nsCString[] appLocales);
729 async UpdateRequestedLocales(nsCString[] requestedLocales);
732 * The system timezone has changed; the child process should ensure that
733 * calls to get the default timezone return the new value.
735 async SystemTimezoneChanged();
737 async UpdateL10nFileSources(L10nFileSourceDescriptor[] sources);
739 async RegisterStringBundles(StringBundleDescriptor[] stringBundles);
741 async UpdateSharedData(FileDescriptor mapFile, uint32_t aSize,
743 nsCString[] changedKeys);
745 // nsIPermissionManager messages
746 async AddPermission(Permission permission);
747 async RemoveAllPermissions();
749 async FlushMemory(nsString reason);
751 async ApplicationBackground();
752 async ApplicationForeground();
753 async GarbageCollect();
754 async CycleCollect();
755 async UnlinkGhosts();
758 * Start accessibility engine in content process.
760 async ActivateA11y();
763 * Shutdown accessibility engine in content process (if not in use).
765 async ShutdownA11y();
767 async AppInfo(nsCString version, nsCString buildID, nsCString name, nsCString UAName,
768 nsCString ID, nsCString vendor, nsCString sourceURL, nsCString updateURL);
771 * Send the remote type associated with the content process.
773 async RemoteType(nsCString aRemoteType, nsCString aProfile);
776 * Send BlobURLRegistrationData to child process.
778 async InitBlobURLs(BlobURLRegistrationData[] registrations);
781 * Send JS{Content, Window}ActorInfos to child process.
783 async InitJSActorInfos(JSProcessActorInfo[] aContentInfos, JSWindowActorInfo[] aWindowInfos);
786 * Unregister a previously registered JSWindowActor in the child process.
788 async UnregisterJSWindowActor(nsCString name);
791 * Unregister a previously registered JSProcessActor in the child process.
793 async UnregisterJSProcessActor(nsCString name);
795 async SetXPCOMProcessAttributes(XPCOMInitData xpcomInit,
796 StructuredCloneData initialData,
797 FullLookAndFeel lookAndFeeldata,
798 /* used on MacOSX/Linux/Android only: */
799 SystemFontList systemFontList,
800 SharedMemoryHandle? sharedUASheetHandle,
801 uintptr_t sharedUASheetAddress,
802 SharedMemoryHandle[] sharedFontListBlocks,
805 // Notify child that last-pb-context-exited notification was observed
806 async LastPrivateDocShellDestroyed();
808 async NotifyProcessPriorityChanged(ProcessPriority priority);
809 async MinimizeMemoryUsage();
812 * Used to manage nsIStyleSheetService across processes.
814 async LoadAndRegisterSheet(nullable nsIURI uri, uint32_t type);
815 async UnregisterSheet(nullable nsIURI uri, uint32_t type);
818 * Notify idle observers in the child
820 async NotifyIdleObserver(uint64_t observerId, nsCString topic, nsString str);
822 async InvokeDragSession(MaybeDiscardedWindowContext aSourceWindowContext,
823 MaybeDiscardedWindowContext aSourceTopWindowContext,
824 IPCTransferableData[] transfers, uint32_t action);
826 async EndDragSession(bool aDoneDrag, bool aUserCancelled,
827 LayoutDeviceIntPoint aDragEndPoint,
828 uint32_t aKeyModifiers,
829 uint32_t aDropEffect);
831 async DomainSetChanged(uint32_t aSetType, uint32_t aChangeType, nullable nsIURI aDomain);
834 * Notify the child that it will soon be asked to shutdown.
835 * This is sent with high priority right before the normal shutdown.
837 [Priority=control] async ShutdownConfirmedHP();
840 * Notify the child to shutdown. The child will in turn call FinishShutdown
841 * and let the parent close the channel.
845 async LoadProcessScript(nsString url);
848 * Requests a full native update of a native plugin child window. This is
849 * a Windows specific call.
851 async UpdateWindow(uintptr_t aChildId);
854 * Notify the child that cache is emptied.
856 async NotifyEmptyHTTPCache();
859 * Send a `push` event without data to a service worker in the child.
861 async Push(nsCString scope, nullable nsIPrincipal principal, nsString messageId);
864 * Send a `push` event with data to a service worker in the child.
866 async PushWithData(nsCString scope, nullable nsIPrincipal principal,
867 nsString messageId, uint8_t[] data);
870 * Send a `pushsubscriptionchange` event to a service worker in the child.
872 async PushSubscriptionChange(nsCString scope, nullable nsIPrincipal principal);
874 async GetFilesResponse(nsID aID, GetFilesResponseResult aResult);
876 async BlobURLRegistration(nsCString aURI, IPCBlob aBlob,
877 nullable nsIPrincipal aPrincipal, nsCString aPartitionKey);
879 async BlobURLUnregistration(nsCString aURI);
881 async GMPsChanged(GMPCapabilityData[] capabilities);
884 async ProvideAnonymousTemporaryFile(uint64_t aID, FileDescOrError aFD);
886 async SetPermissionsWithKey(nsCString aPermissionKey, Permission[] aPermissions);
888 async RefreshScreens(ScreenDetails[] aScreens);
890 async ShareCodeCoverageMutex(CrossProcessMutexHandle handle);
891 async FlushCodeCoverageCounters() returns (bool unused);
894 * IPC message to enable the input event queue on the main thread of the
897 async SetInputEventQueueEnabled();
900 * IPC message to flush the input event queue on the main thread of the
903 * When the ContentParent stops sending the input event with input priority,
904 * there may be some pending events in the input event queue and normal
905 * event queue. Here is a possible scenario.
907 * D: Enable the input priority event.
908 * E: Disable the input priority evnet.
911 * Normal Queue: R1 R2 R3
912 * Input Queue: II I2 I3
914 * To avoid the newly added normal events (e.g. R2, which may be an input
915 * event) preempt the pending input events (e.g. I1), or the newly added
916 * input events (e.g. I3) preempt the pending normal events (e.g. R2), we
917 * have to flush all pending events before enabling and disabling the input
920 * To flush the normal event queue and the input event queue, we use three
921 * IPC messages as the followings.
922 * FI: Flush the input queue.
923 * SI: Suspend the input queue.
924 * RI: Resume the input queue.
926 * Normal Queue: R1 FI RI R2 FI RI R3
927 * Input Queue: II SI I2 SI I3
929 * When the flush input request is processed before the other two requests,
930 * we consume all input events until the suspend request. After handling the
931 * suspend request, we stop consuming the input events until the resume
932 * request to make sure we consume all pending normal events.
934 * If we process the suspend request before the other two requests, we
935 * ignore the flush request and consume all pending normal events until the
938 async FlushInputEventQueue();
941 * IPC message to resume consuming the pending events in the input event
944 async ResumeInputEventQueue();
947 * IPC message to suspend consuming the pending events in the input event
950 [Priority=input] async SuspendInputEventQueue();
953 * IPC message to propagate dynamic scalar definitions, added after the
954 * content process is spawned, from the parent to the child.
955 * Dynamic scalar definitions added at the process startup are handled
956 * using the |TelemetryIPC::AddDynamicScalarDefinitions| functions.
958 async AddDynamicScalars(DynamicScalarDefinition[] definitions);
960 // This message is sent to content processes, and triggers the creation of a
961 // new HttpChannelChild that will be connected to the parent channel
962 // represented by registrarId.
963 // This is on PContent not PNecko, as PNecko may not be initialized yet.
964 // The returned loadInfo needs to be set on the channel - since the channel
965 // moved to a new process it now has different properties.
967 async CrossProcessRedirect(RedirectToRealChannelArgs args,
968 Endpoint<PStreamFilterParent>[] aEndpoint)
969 returns (nsresult rv);
972 * This method is used to notifty content process to start delayed autoplay
973 * media via browsing context.
975 async StartDelayedAutoplayMediaComponents(MaybeDiscardedBrowsingContext aContext);
978 * This method is used to dispatch MediaControlAction to content process in
979 * order to control media within a specific browsing context tree.
981 async UpdateMediaControlAction(MaybeDiscardedBrowsingContext aContext,
982 MediaControlAction aAction);
984 // Begin subscribing to a new BrowsingContextGroup, sending down the current
985 // value for every individual BrowsingContext.
986 async RegisterBrowsingContextGroup(uint64_t aGroupId, SyncedContextInitializer[] aInits);
988 // The BrowsingContextGroup has been destroyed in the parent process. The
989 // content process won't destroy the group until it receives this message or
992 // When the content process receives this message, all contexts in the group
993 // should have already been destroyed.
994 async DestroyBrowsingContextGroup(uint64_t aGroupId);
996 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
997 // Initialize top-level actor for testing content process sandbox.
998 async InitSandboxTesting(Endpoint<PSandboxTestingChild> aEndpoint);
1001 async LoadURI(MaybeDiscardedBrowsingContext aContext, nsDocShellLoadState aLoadState, bool aSetNavigating)
1002 returns (bool aSuccess);
1004 async InternalLoad(nsDocShellLoadState aLoadState);
1006 async DisplayLoadError(MaybeDiscardedBrowsingContext aContext, nsString aURI);
1008 async GoBack(MaybeDiscardedBrowsingContext aContext, int32_t? aCancelContentJSEpoch, bool aRequireUserInteraction, bool aUserActivation);
1009 async GoForward(MaybeDiscardedBrowsingContext aContext, int32_t? aCancelContentJSEpoch, bool aRequireUserInteraction, bool aUserActivation);
1010 async GoToIndex(MaybeDiscardedBrowsingContext aContext, int32_t aIndex, int32_t? aCancelContentJSEpoch, bool aUserActivation);
1011 async Reload(MaybeDiscardedBrowsingContext aContext, uint32_t aReloadFlags);
1012 async StopLoad(MaybeDiscardedBrowsingContext aContext, uint32_t aStopFlags);
1014 async OnAllowAccessFor(MaybeDiscardedBrowsingContext aParentContext,
1015 nsCString aTrackingOrigin,
1016 uint32_t aCookieBehavior,
1017 StorageAccessPermissionGrantedReason aReason);
1019 async OnContentBlockingDecision(MaybeDiscardedBrowsingContext aContext,
1020 BlockingDecision aReason,
1021 uint32_t aRejectedReason);
1024 * Abort orientationPendingPromises for documents in the child which
1025 * are part of a BrowsingContextGroup.
1027 async AbortOrientationPendingPromises(MaybeDiscardedBrowsingContext aContext);
1029 async HistoryCommitIndexAndLength(MaybeDiscardedBrowsingContext aContext,
1030 uint32_t aIndex, uint32_t aLength,
1033 async GetLayoutHistoryState(MaybeDiscardedBrowsingContext aContext)
1034 returns (nullable nsILayoutHistoryState aState, Wireframe? aWireframe);
1036 async DispatchLocationChangeEvent(MaybeDiscardedBrowsingContext aContext);
1038 // Dispatches a "beforeunload" event to each in-process content window in the
1039 // subtree beginning at `aStartingAt`, and returns the result as documented in
1040 // the `PermitUnloadResult` enum.
1041 async DispatchBeforeUnloadToSubtree(MaybeDiscardedBrowsingContext aStartingAt)
1042 returns (PermitUnloadResult result);
1044 // Update the cached list of codec supported in the given process.
1045 async UpdateMediaCodecsSupported(RemoteDecodeIn aLocation, MediaCodecsSupported aSupported);
1047 // Send the list of the supported mimetypes in the given process. GeckoView-specific
1048 async DecoderSupportedMimeTypes(nsCString[] supportedTypes);
1050 // Used to initialize the global variable in content processes with the
1051 // latched value in the parent process. See dom/LocalStorageCommon.h for more
1053 async InitNextGenLocalStorageEnabled(bool enabled);
1055 async PRemotePrintJob();
1057 async PClipboardReadRequest(nsCString[] aTypes);
1060 async SynchronizeLayoutHistoryState(MaybeDiscardedBrowsingContext aContext,
1061 nullable nsILayoutHistoryState aState);
1063 async SessionHistoryEntryTitle(MaybeDiscardedBrowsingContext aContext,
1066 async SessionHistoryEntryScrollRestorationIsManual(MaybeDiscardedBrowsingContext aContext,
1068 async SessionHistoryEntryScrollPosition(MaybeDiscardedBrowsingContext aContext,
1069 int32_t aX, int32_t aY);
1071 async SessionHistoryEntryCacheKey(MaybeDiscardedBrowsingContext aContext,
1072 uint32_t aCacheKey);
1074 async SessionHistoryEntryStoreWindowNameInContiguousEntries(MaybeDiscardedBrowsingContext aContext,
1077 async SessionHistoryEntryWireframe(MaybeDiscardedBrowsingContext aContext,
1078 Wireframe aWireframe);
1080 async GetLoadingSessionHistoryInfoFromParent(MaybeDiscardedBrowsingContext aContext)
1081 returns (LoadingSessionHistoryInfo? aLoadingInfo);
1083 async RemoveFromBFCache(MaybeDiscardedBrowsingContext aContext);
1085 async InitBackground(Endpoint<PBackgroundStarterParent> aEndpoint);
1087 async CreateGMPService();
1089 async InitStreamFilter(uint64_t channelId, nsString addonId)
1090 returns (Endpoint<PStreamFilterChild> aEndpoint);
1092 async PRemoteSpellcheckEngine();
1094 async InitCrashReporter(NativeThreadId tid);
1096 sync IsSecureURI(nullable nsIURI aURI, OriginAttributes aOriginAttributes)
1097 returns (bool isSecureURI);
1099 async AccumulateMixedContentHSTS(nullable nsIURI aURI, bool aActive,
1100 OriginAttributes aOriginAttributes);
1102 [Nested=inside_cpow] async PHal();
1104 async PHeapSnapshotTempFileHelper();
1108 #ifdef MOZ_WEBSPEECH
1109 async PSpeechSynthesis();
1115 async PWebrtcGlobal();
1118 async CreateAudioIPCConnection() returns (FileDescOrError fd);
1120 sync PURLClassifier(nullable nsIPrincipal principal)
1121 returns (bool success);
1123 async PURLClassifierLocal(nullable nsIURI uri, IPCURLClassifierFeature[] features);
1125 async PSessionStorageObserver();
1127 async PBenchmarkStorage();
1129 // Services remoting
1131 async StartVisitedQueries(nullable nsIURI[] uri);
1132 async SetURITitle(nullable nsIURI uri, nsString title);
1134 async LoadURIExternal(nullable nsIURI uri,
1135 nullable nsIPrincipal triggeringPrincipal,
1136 nullable nsIPrincipal redirectPrincipal,
1137 MaybeDiscardedBrowsingContext browsingContext,
1138 bool wasExternallyTriggered,
1139 bool hasValidUserGestureActivation);
1140 async ExtProtocolChannelConnectParent(uint64_t registrarId);
1142 sync SyncMessage(nsString aMessage, ClonedMessageData aData)
1143 returns (StructuredCloneData[] retval);
1145 async ShowAlert(nullable nsIAlertNotification alert);
1147 async CloseAlert(nsString name, bool contextClosed);
1149 async DisableNotifications(nullable nsIPrincipal principal);
1151 async OpenNotificationSettings(nullable nsIPrincipal principal);
1153 async AddSecurityState(MaybeDiscardedWindowContext aContext, uint32_t aStateFlags);
1155 // Request that the ServiceWorkerManager in the parent process create a
1156 // notification "click" or "close" event and dispatch it on the relevant
1157 // ServiceWorker. This needs to happen because when a notification is
1158 // created it is tied to a specific content process and when the user clicks
1159 // on the notification, it will be that content process that is notified.
1160 // However, even if the ServiceWorker lives in that process (it may no
1161 // longer be in that process, or may have never lived there), the right/only
1162 // way to talk through the ServiceWorker is through the parent.
1164 // This happens on PContent because the ServiceWorkerManager lives on the
1165 // main thread and bouncing this off of PBackground would be silly and
1166 // complex. In the long run, the notification implementation will be
1167 // overhauled to directly process the notification click/close and directly
1168 // translate that to a ServiceWorker event.
1169 async NotificationEvent(nsString type, NotificationEventData data);
1171 // Creates a helper for forwarding data from an nsExternalAppHandler
1172 // running in the content process, to one running in the parent
1174 // Bug 1574372 aims to run nsExternalAppHandler entirely in the
1175 // parent so that we can remove this.
1177 // Serializes the uri, loadInfo, contentType, referrer, contentDisposition
1178 // headers and contentLength of the channel so that we can make them
1179 // available to the parent instance via a nsIChannel helper. Also
1180 // passes whether the original channel was an instance of nsIFileChannel.
1182 // aContext is the BrowsingContext that initiated the load, and created the
1185 // Pass true for aForceSave to always save this content to disk, regardless of
1186 // nsIMIMEInfo and other such influences.
1187 // Pass true for aShouldCloseWindow to specify that aContext was opened specifically
1188 // for this load, and should be closed once we've handled it.
1189 async PExternalHelperApp(nullable nsIURI uri,
1190 LoadInfoArgs loadInfoArgs,
1191 nsCString aMimeContentType,
1192 nsCString aContentDisposition,
1193 uint32_t aContentDispositionHint,
1194 nsString aContentDispositionFilename,
1196 int64_t aContentLength,
1197 bool aWasFileChannel,
1198 nullable nsIURI aReferrer,
1199 MaybeDiscardedBrowsingContext aContext,
1200 bool aShouldCloseWindow);
1202 async PHandlerService();
1204 async AddGeolocationListener(bool highAccuracy);
1205 async RemoveGeolocationListener();
1206 async SetGeolocationHigherAccuracy(bool enable);
1208 async ConsoleMessage(nsString message);
1209 async ScriptErrorWithStack(nsString message, nsString sourceName, nsString sourceLine,
1210 uint32_t lineNumber, uint32_t colNumber, uint32_t flags,
1211 nsCString category, bool privateWindow,
1212 bool fromChromeContext, ClonedMessageData stack);
1214 // Places the items within dataTransfer on the clipboard.
1215 async SetClipboard(IPCTransferable aTransferable,
1216 int32_t aWhichClipboard);
1218 // Given a list of supported types, returns the clipboard data for the
1219 // first type that matches.
1220 sync GetClipboard(nsCString[] aTypes, int32_t aWhichClipboard)
1221 returns (IPCTransferableData transferableData);
1223 // Returns a list of formats supported by the clipboard
1224 sync GetExternalClipboardFormats(int32_t aWhichClipboard, bool aPlainTextOnly) returns (nsCString[] aTypes);
1226 // Requests getting data from clipboard.
1227 async GetClipboardAsync(nsCString[] aTypes, int32_t aWhichClipboard)
1228 returns (PClipboardReadRequestOrError aClipboardReadRequest);
1230 // Clears the clipboard.
1231 async EmptyClipboard(int32_t aWhichClipboard);
1233 // Returns true if data of one of the specified types is on the clipboard.
1234 sync ClipboardHasType(nsCString[] aTypes, int32_t aWhichClipboard)
1235 returns (bool hasType);
1238 * Notify the parent that the child has started a clipboard write request,
1239 * and that the data will be sent over another IPC message once it is ready.
1240 * @param aClipboardType
1241 * The clipboard type defined in nsIClipboard.
1243 async PClipboardWriteRequest(int32_t aClipboardType);
1245 sync GetIconForExtension(nsCString aFileExt, uint32_t aIconSize)
1246 returns (uint8_t[] bits);
1248 // Tell the parent that the child has gone idle for the first time.
1251 async CopyFavicon(nullable nsIURI oldURI, nullable nsIURI newURI, bool isPrivate);
1253 async FindImageText(IPCImage image, nsCString[] languages)
1254 returns (TextRecognitionResultOrError result);
1257 async GraphicsError(nsCString aError);
1259 // Driver crash guards. aGuardType must be a member of CrashGuardType.
1260 sync BeginDriverCrashGuard(uint32_t aGuardType) returns (bool crashDetected);
1261 sync EndDriverCrashGuard(uint32_t aGuardType);
1263 async AddIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
1264 async RemoveIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
1267 * This message is only used on X11 platforms.
1269 * Send a dup of the plugin process's X socket to the parent
1270 * process. In theory, this scheme keeps the plugin's X resources
1271 * around until after both the plugin process shuts down *and* the
1272 * parent process closes the dup fd. This is used to prevent the
1273 * parent process from crashing on X errors if, e.g., the plugin
1274 * crashes *just before* a repaint and the parent process tries to
1275 * use the newly-invalid surface.
1277 async BackUpXResources(FileDescriptor aXSocketFd);
1279 async RequestAnonymousTemporaryFile(uint64_t aID);
1282 * Notifies the parent that the child needs no more ForceKill dump.
1284 [Priority=control] async NotifyShutdownSuccess();
1287 * Notifies the parent to continue shutting down after the child performs
1288 * its shutdown tasks.
1290 async FinishShutdown();
1292 async UpdateDropEffect(uint32_t aDragAction, uint32_t aDropEffect);
1295 * Initiates an asynchronous request for permission for the
1296 * provided principal.
1299 * The array of permissions to request.
1301 * The principal of the request.
1302 * @param aTopLevelPrincipal
1303 * The principal of the top level page the request comes from.
1305 * To identify which tab issues this request.
1307 * NOTE: The principal is untrusted in the parent process. Only
1308 * principals that can live in the content process should
1311 async PContentPermissionRequest(PermissionRequest[] aRequests,
1312 nullable nsIPrincipal aPrincipal,
1313 nullable nsIPrincipal aTopLevelPrincipal,
1314 bool aIsHandlingUserInput,
1315 bool aMaybeUnsafePermissionDelegate,
1319 * If the profiler is running when the process shuts down, this sends the
1320 * profile data collected so far.
1323 * This may contain an empty string (unknown issue), an error message
1324 * starting with '*', or a profile as a stringified JSON object.
1326 async ShutdownProfile(nsCString aProfile);
1329 * This sends any collected perf stats data on shutdown.
1331 async ShutdownPerfStats(nsCString aPerfStats);
1334 * A shared font list (see gfx/thebes/SharedFontList.*) contains a list
1335 * of shared-memory blocks that are used to store all the font list data.
1336 * The font list created in the parent process is the only one that can
1337 * create or store objects into the shared memory; content processes font
1338 * lists have read-only access to it.
1340 * To minimize the cost of record allocations, the shared font list
1341 * bump-allocates new objects that it adds to the shared memory blocks
1342 * (i.e. the records stored in the shared memory blocks are only ever
1343 * appended, and never freed except when the entire font list is
1346 * When initially created by the parent process, the font list may contain
1347 * nothing except a header, and the list of the system's installed font
1348 * family names. Additional data about the families (styled faces available
1349 * and character coverage) is appended to the font list during the session
1350 * as a given font is considered for use, because loading all data for all
1351 * installed fonts during startup is too expensive/slow.
1353 * During content process launch, a content process's first step in
1354 * gaining access to the font list is to call GetFontListShmBlock,
1355 * passing index zero in order to get access to the first block, which
1356 * contains the font list header and the list of font-family records
1357 * (which may be virtually all uninitialized at this time, containing
1358 * nothing but the family names). Once a content process determines a
1359 * font-family name it wants to use (e.g. from a CSS font-family list, or
1360 * from preferences), if that Family record has not yet been initialized,
1361 * it will call InitializeFamily (below) to have the parent process
1362 * populate Face records in the shared memory with the family's styles.
1363 * The content process can then pick the face with best style match from
1364 * the available faces according to the CSS font matching algorithm, load
1365 * its character map, then send the map to the parent process using
1366 * SetCharacterMap (so that the parent process can share the map with all
1367 * processes to avoid duplication of work).
1369 * At some point, as the parent process adds data to the font list, a new
1370 * shared-memory block will probably be needed. At that point the parent
1371 * will create a new block and append it to its share memory block list.
1372 * The new Block index will start to appear in Pointer records in the
1373 * shared memory, and the content process's can then fetch those other
1374 * blocks using this function as needed.
1376 * @param aGeneration
1377 * The font list has a Generation ID stored in its Header, and any time
1378 * the parent process needs to reinitialize the list (because of a change
1379 * in the available font repertoire) a new Generation ID is assigned.
1380 * Content processes pass the Generation of the list they're using in
1381 * all messages, so that the parent can recognize if they're out of date
1382 * and safely ignore such messages. (When the parent rebuilds the list,
1383 * it will notify all content processes, but they may still send a few
1384 * messages that relate to the obsolete list before they have processed
1385 * this notification.)
1387 * (Zero-based) index of the shared-memory block to be mapped.
1388 * In a typical case, there will be a handful of blocks altogether, so
1389 * each content process only needs to make this request a few times.
1391 * Handle that can be used to construct a SharedMemory that maps the
1392 * requested block of memory.
1393 * If aGeneration does not match the parent's font list generation ID, or
1394 * if requesting a block that does not exist (i.e. with aIndex greater
1395 * than or equal to the number of blocks actually in existence), returns
1398 * This is a sync message because the content process needs font data in
1399 * order to perform font-matching (e.g. during reflow), and cannot continue
1400 * until it has mapped the font-list memory.
1402 sync GetFontListShmBlock(uint32_t aGeneration, uint32_t aIndex)
1403 returns (SharedMemoryHandle aHandle);
1406 * Ask the parent to initialize a given font family, so that face metadata
1407 * will be available. Content processes will only call this for families
1408 * where the Face data has not yet been populated, so it will generally be
1409 * called no more than once per family. (It may not be needed at all, if
1410 * the parent process has already initialized the families that content
1413 * @param aGeneration
1414 * Font-list generation, so requests relating to an obsolete list can be
1415 * ignored (see comments for GetFontListShmBlock).
1416 * @param aFamilyIndex
1417 * The 0-based index of the Family within the font-list that a content
1418 * process needs to use.
1420 * If true, the parent should eagerly load character maps for the faces
1423 * This is a sync message because the content process cannot complete its
1424 * font-matching until the family is fully populated with Face records.
1425 * If we make it async, content processes will reflow using fallbacks,
1426 * and then have to reflow again once all the font information needed
1427 * becomes available.
1429 sync InitializeFamily(uint32_t aGeneration, uint32_t aFamilyIndex,
1433 * Record the character map of a given Face in the font list.
1435 * @param aGeneration
1436 * Font-list generation, so requests relating to an obsolete list can be
1437 * ignored (see comments for GetFontListShmBlock).
1439 * Font-list shared-memory "pointer" to the Face record to be updated.
1440 * A Pointer is a record of a shared-memory block index and an offset
1441 * within that block, which each process that maps the block can convert
1442 * into a real pointer in its address space.
1444 * The character coverage map of the face. (This will be stored as a
1445 * SharedBitSet record within the shared font list, and the Face record
1446 * will be updated to reference it.)
1448 async SetCharacterMap(uint32_t aGeneration, Pointer aFacePtr, gfxSparseBitSet aMap);
1451 * Ask the parent to set up the merged charmap for a family, to accelerate
1452 * future fallback searches.
1453 * aFamilyPtr may refer to an element of either the Families() or AliasFamilies().
1455 async SetupFamilyCharMap(uint32_t aGeneration, Pointer aFamilyPtr);
1458 * Ask the parent to try and complete the InitOtherFamilyNames task, because
1459 * we're trying to look up a localized font name. This is a sync method so that
1460 * the update will be available before the child continues reflow; however, it
1461 * is possible the task will have timed-out in the parent and not actually
1462 * completed during this call.
1464 * @param aGeneration
1465 * Font-list generation, so requests relating to an obsolete list can be
1466 * ignored (see comments for GetFontListShmBlock).
1468 * Parameter aDeferOtherFamilyNamesLoading to be passed to
1469 * gfxPlatformFontList::InitOtherFamilyNames, to determine whether name
1470 * loading should be deferred to a background task or run immediately.
1472 * Returns whether the font name loading process has completed.
1474 * TODO: This is currently a sync message but can probably be made async,
1475 * at the cost of an increased chance of some testcases failing because
1476 * they depend on lazily-loaded font names.
1478 sync InitOtherFamilyNames(uint32_t aGeneration, bool aDefer) returns (bool aLoaded);
1481 * Ask the parent to load all font character maps, as we need to do an
1482 * exhaustive font-fallback search. This is done asynchronously; when it
1483 * finishes, the parent will trigger global reflow so that font selection
1484 * is re-done in all content, making use of the newly-loaded cmaps.
1485 * Normally this will only happen once per browser session (unless the
1486 * font list is rebuilt due to installation/removal of system fonts).
1488 * @param aGeneration
1489 * Font-list generation, so requests relating to an obsolete list can be
1490 * ignored (see comments for GetFontListShmBlock).
1491 * @param aStartIndex
1492 * The family index to start from; the sender has determined that cmaps
1493 * up to this point are already loaded.
1495 async StartCmapLoading(uint32_t aGeneration, uint32_t aStartIndex);
1498 * Ask the parent for a specific hyphenation resource (identified by URI)
1499 * as a shared memory block.
1501 * This is a sync method because at the point where a content process finds
1502 * that it requires a particular hyphenation dictionary, this is blocking
1503 * reflow; making it async would require scheduling another reflow after
1504 * the resource is available, and a possible layout "jump" as line-breaks
1505 * change. Note that the content process retains a reference to each such
1506 * resource it requests, so it will only make this call once per locale for
1507 * which hyphenation data exists.
1510 * The URI (which currently must always point to an omnijar resource)
1511 * for the required hyphenation dictionary.
1513 * Returns the shmem handle to the resource (or an invalid shmem handle
1514 * in case of failure).
1516 * Returns the size in bytes of the resource.
1518 sync GetHyphDict(nullable nsIURI aURI) returns (SharedMemoryHandle aHandle, uint32_t aSize);
1520 async CreateWindow(PBrowser aThisTab,
1521 MaybeDiscardedBrowsingContext aParent,
1523 uint32_t aChromeFlags,
1526 bool aForWindowDotPrint,
1527 nullable nsIURI aURIToLoad,
1528 nsCString aFeatures,
1529 nullable nsIPrincipal aTriggeringPrincipal,
1530 nullable nsIContentSecurityPolicy aCsp,
1531 nullable nsIReferrerInfo aReferrerInfo,
1532 OriginAttributes aOriginAttributes)
1533 returns (CreatedWindowInfo window);
1535 async CreateWindowInDifferentProcess(
1537 MaybeDiscardedBrowsingContext aParent,
1538 uint32_t aChromeFlags,
1540 nullable nsIURI aURIToLoad,
1541 nsCString aFeatures,
1543 nullable nsIPrincipal aTriggeringPrincipal,
1544 nullable nsIContentSecurityPolicy aCsp,
1545 nullable nsIReferrerInfo aReferrerInfo,
1546 OriginAttributes aOriginAttributes);
1549 * Tell the parent that a decoder's' benchmark has been completed.
1550 * The result can then be stored in permanent storage.
1552 async NotifyBenchmarkResult(nsString aCodecName, uint32_t aDecodeFPS);
1555 * Notify `push-message` observers without data in the parent.
1557 async NotifyPushObservers(nsCString scope, nullable nsIPrincipal principal,
1558 nsString messageId);
1561 * Notify `push-message` observers with data in the parent.
1563 async NotifyPushObserversWithData(nsCString scope, nullable nsIPrincipal principal,
1564 nsString messageId, uint8_t[] data);
1567 * Notify `push-subscription-change` observers in the parent.
1569 async NotifyPushSubscriptionChangeObservers(nsCString scope,
1570 nullable nsIPrincipal principal);
1572 async GetFilesRequest(nsID aID, nsString aDirectory, bool aRecursiveFlag);
1573 async DeleteGetFilesRequest(nsID aID);
1575 async StoreAndBroadcastBlobURLRegistration(nsCString url, IPCBlob blob,
1576 nullable nsIPrincipal principal, nsCString aPartitionKey);
1578 async UnstoreAndBroadcastBlobURLUnregistration(nsCString url, nullable nsIPrincipal principal);
1581 * Messages for communicating child Glean data to the parent process
1583 async RecordPageLoadEvent(PageLoadExtra event);
1586 * Messages for communicating child Telemetry to the parent process
1588 async AccumulateChildHistograms(HistogramAccumulation[] accumulations);
1589 async AccumulateChildKeyedHistograms(KeyedHistogramAccumulation[] accumulations);
1590 async UpdateChildScalars(ScalarAction[] updates);
1591 async UpdateChildKeyedScalars(KeyedScalarAction[] updates);
1592 async RecordChildEvents(ChildEventData[] events);
1593 async RecordDiscardedData(DiscardedData data);
1595 async AddMemoryReport(MemoryReport aReport);
1597 async BHRThreadHang(HangDetails aHangDetails);
1600 * Adds a certificate exception for the given hostname and port.
1602 async AddCertException(nullable nsIX509Cert aCert, nsCString aHostName,
1603 int32_t aPort, OriginAttributes aOriginAttributes,
1605 returns (nsresult success);
1608 * Determines whether storage access can be granted automatically by the
1609 * storage access API without showing a user prompt.
1611 async AutomaticStorageAccessPermissionCanBeGranted(nullable nsIPrincipal aPrincipal)
1612 returns (bool success);
1615 * A 3rd party tracking origin (aTrackingOrigin) has received the permission
1616 * granted to have access to aGrantedOrigin when loaded by aParentWindowId.
1618 async StorageAccessPermissionGrantedForOrigin(uint64_t aTopLevelWindowId,
1619 MaybeDiscardedBrowsingContext aParentContext,
1620 nullable nsIPrincipal aTrackingPrincipal,
1621 nsCString aTrackingOrigin,
1623 StorageAccessPermissionGrantedReason? aReason,
1625 returns (bool unused);
1627 async CompleteAllowAccessFor(MaybeDiscardedBrowsingContext aParentContext,
1628 uint64_t aTopLevelWindowId,
1629 nullable nsIPrincipal aTrackingPrincipal,
1630 nsCString aTrackingOrigin,
1631 uint32_t aCookieBehavior,
1632 StorageAccessPermissionGrantedReason aReason)
1633 returns (StorageAccessPromptChoices? choice);
1635 async SetAllowStorageAccessRequestFlag(
1636 nullable nsIPrincipal aEmbeddingPrincipal,
1637 nullable nsIURI aEmbeddedOrigin)
1638 returns (bool success);
1640 async TestAllowStorageAccessRequestFlag(
1641 nullable nsIPrincipal aEmbeddedPrincipal,
1642 nullable nsIURI aEmbeddingOrigin)
1643 returns (bool success);
1645 async StoreUserInteractionAsPermission(nullable nsIPrincipal aPrincipal);
1647 async TestCookiePermissionDecided(MaybeDiscardedBrowsingContext aContext,
1648 nullable nsIPrincipal aPrincipal)
1649 returns (bool? allowed);
1651 async TestStorageAccessPermission(nullable nsIPrincipal aEmbeddingPrincipal,
1652 nsCString aEmbeddedOrigin)
1653 returns (bool? allowed);
1656 * When media element's controlled state changed in the content process, we
1657 * have to notify the chrome process in order to update the status of the
1658 * corresponding media controller, which is used to control all media in the
1659 * certain tab. We would use the browsing context to find the corresponding
1662 async NotifyMediaPlaybackChanged(MaybeDiscardedBrowsingContext aContext,
1663 MediaPlaybackState aState);
1666 * When media became audible or inaudible in content process, we have to
1667 * notify chrome process in order to which tab is audible.
1669 async NotifyMediaAudibleChanged(MaybeDiscardedBrowsingContext aContext,
1670 MediaAudibleState aState);
1673 * When media enabled or disabled the Picture-in-Picture mode, we have to
1674 * update that to the media controller in the chrome process.
1676 async NotifyPictureInPictureModeChanged(
1677 MaybeDiscardedBrowsingContext aContext, bool aEnabled);
1680 * This method is used to update media session's status when it's being
1681 * created or destroyed.
1683 async NotifyMediaSessionUpdated(MaybeDiscardedBrowsingContext aContext, bool aIsCreated);
1686 * This method is used to update media session's media metadata whenever its
1687 * metadata is being updated.
1689 async NotifyUpdateMediaMetadata(MaybeDiscardedBrowsingContext aContext,
1690 MediaMetadataBase? aMetadata);
1693 * This method is used to update media session's playback state whenever its
1694 * playback state is changed.
1696 async NotifyMediaSessionPlaybackStateChanged(
1697 MaybeDiscardedBrowsingContext aContext,
1698 MediaSessionPlaybackState aMetadata);
1701 * This method is used to update media session's supported media session
1702 * action when the action becomes supported or unsupported.
1704 async NotifyMediaSessionSupportedActionChanged(
1705 MaybeDiscardedBrowsingContext aContext,
1706 MediaSessionAction aAction,
1710 * This method is used to notify the media controller in chrome process that
1711 * the media element in the browsing context entered fullscreen.
1713 async NotifyMediaFullScreenState(
1714 MaybeDiscardedBrowsingContext aContext,
1715 bool aIsInFullScreen);
1718 * This method is used to update media session's position state whenever its
1719 * position state is being updated.
1721 async NotifyPositionStateChanged(
1722 MaybeDiscardedBrowsingContext aContext,
1723 PositionState aState);
1726 * This method will make canonical browsing context to update the count of
1727 * callers which want to keep the page from being suspended even if the page
1730 async AddOrRemovePageAwakeRequest(MaybeDiscardedBrowsingContext aContext,
1731 bool aShouldAddCount);
1735 * Due to sandboxing, a child process's UntrustedModulesProcessor cannot
1736 * obtain enough information about a DLL file to determine its
1737 * trustworthiness. This API asks the chrome process to perform that
1740 async GetModulesTrust(ModulePaths aModPaths, bool aRunAtNormalPriority)
1741 returns (ModulesMapResult? modMapResult);
1742 #endif // defined(XP_WIN)
1745 * Used to route shutdown diagnostic info from the content process
1746 * ServiceWorkers to the parent process' ServiceWorkerManager's
1747 * ServiceWorkerShutdownBlocker. (The only other actor chain available
1748 * for this would be very convoluted and create ordering problems).
1750 async ReportServiceWorkerShutdownProgress(uint32_t aShutdownStateId,
1751 Progress aProgress);
1754 * Whenever a document is updating the OrientationLock, we need to
1755 * reject the orientationPendingPromises in other processes.
1757 async AbortOtherOrientationPendingPromises(MaybeDiscardedBrowsingContext aContext);
1759 async HistoryReload(MaybeDiscardedBrowsingContext aContext, uint32_t aReloadFlags);
1761 async NotifyOnHistoryReload(MaybeDiscardedBrowsingContext aContext,
1763 returns (bool canReload, nsDocShellLoadState? loadState,
1764 bool? reloadActiveEntry);
1766 async HistoryCommit(MaybeDiscardedBrowsingContext aContext,
1767 uint64_t aLoadID, nsID aChangeID, uint32_t aLoadType,
1768 bool aPersist, bool aCloneEntryChildren,
1769 bool aChannelExpired, uint32_t aCacheKey);
1771 async HistoryGo(MaybeDiscardedBrowsingContext aContext, int32_t aOffset,
1772 uint64_t aHistoryEpoch, bool aRequireUserInteraction,
1773 bool aUserActivation) returns(int32_t? requestedIndex);
1775 async BlobURLDataRequest(nsCString aBlobURL,
1776 nullable nsIPrincipal aTriggeringPrincipal,
1777 nullable nsIPrincipal aLoadingPrincipal,
1778 OriginAttributes aOriginAttributes,
1779 uint64_t aInnerWindowId,
1780 nsCString aPartitionKey)
1781 returns (BlobURLDataRequestResult aResult);
1783 async SetActiveSessionHistoryEntry(MaybeDiscardedBrowsingContext context,
1784 nsPoint? previousScrollPosition,
1785 SessionHistoryInfo info, uint32_t loadType,
1786 uint32_t updatedCacheKey, nsID changeID);
1787 async ReplaceActiveSessionHistoryEntry(
1788 MaybeDiscardedBrowsingContext context, SessionHistoryInfo info);
1790 async RemoveDynEntriesFromActiveSessionHistoryEntry(
1791 MaybeDiscardedBrowsingContext aContext);
1793 async RemoveFromSessionHistory(
1794 MaybeDiscardedBrowsingContext aContext, nsID changeID);
1796 // Called when a nsDocShellLoadState which was received over IPC is
1797 // destroyed in the content process to clean up pending state left behind
1798 // tracking the load state in the parent process.
1799 [LazySend] async CleanupPendingLoadState(uint64_t aLoadIdentifier);
1802 async ScriptError(nsString message, nsString sourceName, nsString sourceLine,
1803 uint32_t lineNumber, uint32_t colNumber, uint32_t flags,
1804 nsCString category, bool privateWindow, uint64_t innerWindowId,
1805 bool fromChromeContext);
1808 * Used in fission to report timing data when the parent window is in
1809 * another process. Child frame will send data to its ContentParent which
1810 * will then identify the ContentParent for the innerWindowId and pass
1811 * the data to the correct process.
1812 * loadInfo is passed in order to enforce same-origin security checks
1813 * aData must be non-null.
1815 async ReportFrameTimingData(LoadInfoArgs loadInfo, nsString entryName,
1816 nsString initiatorType,
1817 UniquePtr<PerformanceTimingData> aData);
1819 async CommitBrowsingContextTransaction(MaybeDiscardedBrowsingContext aContext,
1820 BrowsingContextTransaction aTransaction,
1823 async AsyncMessage(nsString aMessage, ClonedMessageData aData);
1826 * Notify `push-subscription-modified` observers in the parent and child.
1828 async NotifyPushSubscriptionModifiedObservers(nsCString scope,
1829 nullable nsIPrincipal principal);
1832 * Send a Push error message to all service worker clients in the parent or
1835 async PushError(nsCString scope, nullable nsIPrincipal principal, nsString message,
1839 * Creates a new BrowsingContext, initialized with the values provided in
1840 * `BrowsingContextInitializer`.
1842 * This message may only be sent to the parent in limited situations. If the
1843 * new BrowsingContext has a parent window, it must be owned by the
1844 * embedding process, otherwise it must be owned by the opener, if set.
1846 [LazySend] async CreateBrowsingContext(uint64_t aGroupId, BrowsingContextInitializer aInit);
1849 * If aDoDiscard is true, discards the passed-in BrowsingContext. If the
1850 * BrowsingContext has already been discarded, this message does nothing.
1851 * If the receiver is the parent process, resolves when all content
1852 * processes have flagged the BrowsingContext as discarded, and if the
1853 * receiver is a child process, resolves when that child process has flagged
1854 * the BrowsingContext as discarded.
1856 async DiscardBrowsingContext(MaybeDiscardedBrowsingContext aContext, bool aDoDiscard)
1857 returns (uint64_t unused);
1859 async AdjustWindowFocus(MaybeDiscardedBrowsingContext aContext,
1860 bool aIsVisible, uint64_t aActionId);
1861 async WindowClose(MaybeDiscardedBrowsingContext aContext,
1862 bool aTrustedCaller);
1863 async WindowFocus(MaybeDiscardedBrowsingContext aContext,
1864 CallerType aCallerType, uint64_t aActionId);
1865 async WindowBlur(MaybeDiscardedBrowsingContext aContext,
1866 CallerType aCallerType);
1867 async RaiseWindow(MaybeDiscardedBrowsingContext aContext, CallerType aCallerType, uint64_t aActionId);
1868 async ClearFocus(MaybeDiscardedBrowsingContext aContext);
1869 async SetFocusedBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1870 async SetActiveBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1871 async UnsetActiveBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1872 async SetFocusedElement(MaybeDiscardedBrowsingContext aContext, bool aNeedsFocus);
1873 async FinalizeFocusOuter(MaybeDiscardedBrowsingContext aContext, bool aCanFocus,
1874 CallerType aCallerType);
1876 [LazySend] async InsertNewFocusActionId(uint64_t aActionId);
1877 async BlurToParent(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1878 MaybeDiscardedBrowsingContext aBrowsingContextToClear,
1879 MaybeDiscardedBrowsingContext aAncestorBrowsingContextToFocus,
1880 bool aIsLeavingDocument, bool aAdjustWidget,
1881 bool aBrowsingContextToClearHandled,
1882 bool aAncestorBrowsingContextToFocusHandled, uint64_t aActionId);
1884 async BlurToChild(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1885 MaybeDiscardedBrowsingContext aBrowsingContextToClear,
1886 MaybeDiscardedBrowsingContext aAncestorBrowsingContextToFocus,
1887 bool aIsLeavingDocument, bool aAdjustWidget, uint64_t aActionId);
1888 async SetupFocusedAndActive(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1889 uint64_t aActionIdForFocused,
1890 MaybeDiscardedBrowsingContext aActiveBrowsingContext,
1891 uint64_t aActionId);
1892 async ReviseActiveBrowsingContext(uint64_t aOldActionId,
1893 MaybeDiscardedBrowsingContext aActiveBrowsingContext,
1894 uint64_t aNewActionId);
1895 async ReviseFocusedBrowsingContext(uint64_t aOldActionId,
1896 MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1897 uint64_t aNewActionId);
1899 async MaybeExitFullscreen(MaybeDiscardedBrowsingContext aContext);
1900 async WindowPostMessage(MaybeDiscardedBrowsingContext aContext,
1901 ClonedOrErrorMessageData aMessage,
1902 PostMessageData aData);
1904 async CommitWindowContextTransaction(MaybeDiscardedWindowContext aContext,
1905 WindowContextTransaction aTransaction,
1909 // NOTE: These methods are only needed on the child, as the parent
1910 // WindowContext is managed using the PWindowGlobal actor's lifecycle.
1911 [LazySend] async CreateWindowContext(WindowContextInitializer aInit);
1912 async DiscardWindowContext(uint64_t aContextId) returns (bool unused);
1915 // Temporary (bug 1641989) conduit for Glean data in content processes.
1916 // Sent from time-to-time to limit the amount of data vulnerable to loss.
1917 // Buffer contains bincoded Rust structs.
1918 async FOGData(ByteBuf buf);
1921 // Temporary (bug 1641989) conduit for Glean data in content processes.
1922 // Tells the child to flush any pending data. Used in tests and ping
1923 // assembly. Buffer contains bincoded Rust structs.
1924 async FlushFOGData() returns (ByteBuf buf);
1927 async SetContainerFeaturePolicy(MaybeDiscardedBrowsingContext aContainerContext,
1928 nullable FeaturePolicy aContainerFeaturePolicy);
1930 // Obtain an icon from the system widget toolkit, in nsIconDecoder
1931 // format. Not supported (or needed) on all platforms; see the
1932 // implementation in ContentParent::RecvGetSystemIcon for details.
1933 async GetSystemIcon(nullable nsIURI aURI) returns (nsresult aResult, ByteBuf? aData);
1935 #ifdef FUZZING_SNAPSHOT
1936 // Used by the child process to signal that it is ready to start fuzzing.
1937 // This can in particular be used to wait for a particular event in a
1938 // test document before taking the snapshot and starting e.g. IPC fuzzing.
1939 async SignalFuzzingReady();