1 /* -*- tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 include protocol PBackgroundStarter;
8 include protocol PBrowser;
9 include protocol PClipboardWriteRequest;
10 include protocol PCompositorManager;
11 include protocol PContentPermissionRequest;
12 include protocol PCycleCollectWithLogs;
13 include protocol PDocumentChannel;
14 include protocol PExtensions;
15 include protocol PExternalHelperApp;
16 include protocol PHandlerService;
17 include protocol PHal;
18 include protocol PHeapSnapshotTempFileHelper;
19 include protocol PProcessHangMonitor;
20 include protocol PImageBridge;
21 include protocol PRemotePrintJob;
22 include protocol PLoginReputation;
23 include protocol PMedia;
24 include protocol PNecko;
25 include protocol PStreamFilter;
26 include protocol PGMPContent;
27 include protocol PGMPService;
28 include protocol PGMP;
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 "nsIContentViewer.h";
131 using mozilla::dom::MaybeDiscardedWindowContext from "mozilla/dom/WindowContext.h";
132 using mozilla::dom::WindowContextTransaction from "mozilla/dom/WindowContext.h";
133 [MoveOnly] using base::SharedMemoryHandle from "base/shared_memory.h";
134 using mozilla::fontlist::Pointer from "SharedFontList.h";
135 using gfxSparseBitSet from "gfxFontUtils.h";
136 using FontVisibility from "gfxFontEntry.h";
137 using mozilla::dom::MediaControlAction from "mozilla/dom/MediaControlKeySource.h";
138 using mozilla::dom::MediaPlaybackState from "mozilla/dom/MediaPlaybackStatus.h";
139 using mozilla::dom::MediaAudibleState from "mozilla/dom/MediaPlaybackStatus.h";
140 using mozilla::dom::MediaMetadataBase from "mozilla/dom/MediaMetadata.h";
141 using mozilla::dom::MediaSessionAction from "mozilla/dom/MediaSessionBinding.h";
142 using mozilla::dom::MediaSessionPlaybackState from "mozilla/dom/MediaSessionBinding.h";
143 using mozilla::dom::PositionState from "mozilla/dom/MediaSession.h";
144 using mozilla::dom::ServiceWorkerShutdownState::Progress from "mozilla/dom/ServiceWorkerShutdownState.h";
145 using mozilla::ContentBlockingNotifier::StorageAccessPermissionGrantedReason from "mozilla/ContentBlockingNotifier.h";
146 using mozilla::ContentBlockingNotifier::BlockingDecision from "mozilla/ContentBlockingNotifier.h";
147 using mozilla::StorageAccessAPIHelper::StorageAccessPromptChoices from "mozilla/StorageAccessAPIHelper.h";
148 using mozilla::dom::JSActorMessageKind from "mozilla/dom/JSActor.h";
149 using mozilla::dom::JSActorMessageMeta from "mozilla/dom/PWindowGlobal.h";
150 using mozilla::PermissionDelegateHandler::DelegatedPermissionList from "mozilla/PermissionDelegateHandler.h";
151 [RefCounted] using class nsILayoutHistoryState from "nsILayoutHistoryState.h";
152 using class mozilla::dom::SessionHistoryInfo from "mozilla/dom/SessionHistoryEntry.h";
153 using struct nsPoint from "nsPoint.h";
154 using struct mozilla::dom::LoadingSessionHistoryInfo from "mozilla/dom/SessionHistoryEntry.h";
155 using mozilla::media::MediaCodecsSupported from "MediaCodecsSupport.h";
156 using mozilla::RemoteDecodeIn from "mozilla/RemoteDecoderManagerChild.h";
157 using mozilla::dom::PerformanceTimingData from "mozilla/dom/PerformanceTiming.h";
158 [RefCounted] using mozilla::dom::FeaturePolicy from "mozilla/dom/FeaturePolicy.h";
159 using mozilla::dom::Wireframe from "mozilla/dom/DocumentBinding.h";
160 using mozilla::PerfStats::MetricMask from "mozilla/PerfStats.h";
161 [RefCounted] using class nsIX509Cert from "nsIX509Cert.h";
162 using nsIDNSService::ResolverMode from "nsIDNSService.h";
164 union ChromeRegistryItem
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 // The module of the url.
307 JSWindowActorEventDecl[] events;
309 // Observer notifications this actor listens to.
310 nsCString[] observers;
312 nsCString[] remoteTypes;
313 nsString[] messageManagerGroups;
316 struct JSProcessActorInfo
318 // The name of the actor.
321 // True if `url` is for ESM.
322 // False if `url` is for JSM or nothing.
325 // The module of the url.
328 // Observer notifications this actor listens to.
329 nsCString[] observers;
330 nsCString[] remoteTypes;
339 struct GMPCapabilityData
343 GMPAPITags[] capabilities;
346 struct L10nFileSourceDescriptor {
348 nsCString metasource;
358 int32_t captivePortalState;
360 bool haveBidiKeyboards;
361 nsCString[] dictionaries;
362 ClipboardCapabilities clipboardCaps;
363 DomainPolicyClone domainPolicy;
364 nullable nsIURI userContentSheetURL;
365 GfxVarUpdate[] gfxNonDefaultVarUpdates;
366 ContentDeviceData contentDeviceData;
367 GfxInfoFeatureStatus[] gfxFeatureStatus;
368 nsCString[] appLocales;
369 nsCString[] requestedLocales;
370 L10nFileSourceDescriptor[] l10nFileSources;
371 DynamicScalarDefinition[] dynamicScalarDefs;
372 MetricMask perfStatsMask;
374 ResolverMode trrMode;
375 // This is the value of network.trr.mode and can be diffrent than trrMode.
376 ResolverMode trrModeFromPref;
379 struct VisitedQueryResult
385 struct StringBundleDescriptor
388 FileDescriptor mapFile;
392 struct IPCURLClassifierFeature
394 nsCString featureName;
396 nsCString exceptionHostList;
399 // Transport structure for Notifications API notifications
400 // (https://developer.mozilla.org/en-US/docs/Web/API/notification) instances
401 // used exclusively by the NotificationEvent PContent method.
402 struct NotificationEventData
404 nsCString originSuffix;
417 struct PostMessageData
419 MaybeDiscardedBrowsingContext source;
421 nsString targetOrigin;
422 nullable nsIURI targetOriginURI;
423 nullable nsIPrincipal callerPrincipal;
424 nullable nsIPrincipal subjectPrincipal;
425 nullable nsIURI callerURI;
426 bool isFromPrivateWindow;
427 nsCString scriptLocation;
428 uint64_t innerWindowId;
431 union SyncedContextInitializer
433 BrowsingContextInitializer;
434 WindowContextInitializer;
437 union BlobURLDataRequestResult
443 struct TextRecognitionQuad {
449 struct TextRecognitionResult {
450 TextRecognitionQuad[] quads;
453 union TextRecognitionResultOrError {
454 TextRecognitionResult;
461 SurfaceFormat format;
465 union IPCTransferableDataOrError {
471 * The PContent protocol is a top-level protocol between the UI process
472 * and a content process. There is exactly one PContentParent/PContentChild pair
473 * for each content process.
475 [NestedUpTo=inside_cpow, NeedsOtherPid]
476 sync protocol PContent
479 manages PClipboardWriteRequest;
480 manages PContentPermissionRequest;
481 manages PCycleCollectWithLogs;
483 manages PExternalHelperApp;
485 manages PHandlerService;
486 manages PHeapSnapshotTempFileHelper;
487 manages PRemotePrintJob;
491 manages PSpeechSynthesis;
494 manages PRemoteSpellcheckEngine;
495 manages PWebBrowserPersistDocument;
497 manages PWebrtcGlobal;
499 manages PURLClassifier;
500 manages PURLClassifierLocal;
501 manages PScriptCache;
502 manages PLoginReputation;
503 manages PSessionStorageObserver;
504 manages PBenchmarkStorage;
506 // Depending on exactly how the new browser is being created, it might be
507 // created from either the child or parent process!
509 // The child creates the PBrowser as part of
510 // BrowserChild::BrowserFrameProvideWindow (which happens when the child's
511 // content calls window.open()), and the parent creates the PBrowser as part
512 // of ContentParent::CreateBrowser.
514 // When the parent constructs a PBrowser, the child trusts the attributes it
515 // receives from the parent. In that case, the context should be
516 // FrameIPCTabContext.
518 // When the child constructs a PBrowser, the parent doesn't trust the
519 // attributes it receives from the child. In this case, context must have
520 // type PopupIPCTabContext. The parent checks that if the opener is a
521 // browser element, the context is also for a browser element.
523 // If |sameTabGroupAs| is non-zero, the new tab should go in the same
524 // TabGroup as |sameTabGroupAs|. This parameter should always be zero
525 // for PBrowser messages sent from the child to the parent.
527 // Separate messages are used for the parent and child side constructors due
528 // to the differences in data and actor setup required.
530 // Keep the last 3 attributes in sync with GetProcessAttributes!
532 async ConstructPopupBrowser(ManagedEndpoint<PBrowserParent> browserEp,
533 ManagedEndpoint<PWindowGlobalParent> windowEp,
534 TabId tabId, IPCTabContext context,
535 WindowGlobalInit windowInit,
536 uint32_t chromeFlags);
538 // TODO: Do I need to make this return something to watch for completion?
539 // Guess we'll see how we end up triggering the actual print, for preview
540 // this should be enough...
541 async CloneDocumentTreeInto(MaybeDiscardedBrowsingContext aSourceBc,
542 MaybeDiscardedBrowsingContext aTargetBc,
543 PrintData aPrintData);
545 async UpdateRemotePrintSettings(MaybeDiscardedBrowsingContext aBc,
546 PrintData aPrintData);
551 async ConstructBrowser(ManagedEndpoint<PBrowserChild> browserEp,
552 ManagedEndpoint<PWindowGlobalChild> windowEp,
554 IPCTabContext context,
555 WindowGlobalInit windowInit,
556 uint32_t chromeFlags, ContentParentId cpId,
557 bool isForBrowser, bool isTopLevel);
560 // For parent->child, aBrowser must be non-null; aContext can
561 // be null to indicate the browser's current root document, or non-null
562 // to persist a subdocument. For child->parent, arguments are
563 // ignored and should be null.
564 async PWebBrowserPersistDocument(nullable PBrowser aBrowser,
565 MaybeDiscardedBrowsingContext aContext);
567 async RawMessage(JSActorMessageMeta aMetadata, ClonedMessageData? aData,
568 ClonedMessageData? aStack);
571 async InitGMPService(Endpoint<PGMPServiceChild> service);
572 async InitProcessHangMonitor(Endpoint<PProcessHangMonitorChild> hangMonitor);
573 async InitProfiler(Endpoint<PProfilerChild> aEndpoint);
575 // Give the content process its endpoints to the compositor.
577 Endpoint<PCompositorManagerChild> compositor,
578 Endpoint<PImageBridgeChild> imageBridge,
579 Endpoint<PVRManagerChild> vr,
580 Endpoint<PRemoteDecoderManagerChild> video,
581 uint32_t[] namespaces);
583 // Re-create the rendering stack using the given endpoints. This is sent
584 // after the compositor process has crashed. The new endpoints may be to a
585 // newly launched GPU process, or the compositor thread of the UI process.
586 async ReinitRendering(
587 Endpoint<PCompositorManagerChild> compositor,
588 Endpoint<PImageBridgeChild> bridge,
589 Endpoint<PVRManagerChild> vr,
590 Endpoint<PRemoteDecoderManagerChild> video,
591 uint32_t[] namespaces);
593 async NetworkLinkTypeChange(uint32_t type);
594 async SocketProcessCrashed();
596 // Re-create the rendering stack for a device reset.
597 async ReinitRenderingForDeviceReset();
600 * Enable system-level sandboxing features, if available. Can
601 * usually only be performed zero or one times. The child may
602 * abnormally exit if this fails; the details are OS-specific.
604 async SetProcessSandbox(FileDescriptor? aBroker);
606 async RequestMemoryReport(uint32_t generation,
608 bool minimizeMemoryUsage,
609 FileDescriptor? DMDFile)
610 returns (uint32_t aGeneration);
614 * Used by third-party modules telemetry (aka "untrusted modules" telemetry)
615 * to pull data from content processes.
617 async GetUntrustedModulesData() returns (UntrustedModulesData? data);
620 * This method is used to notifty a child process to start
621 * processing module loading events in UntrustedModulesProcessor.
622 * This should be called when the parent process has gone idle.
624 async UnblockUntrustedModulesThread();
625 #endif // defined(XP_WIN)
628 * Communication between the PuppetBidiKeyboard and the actual
629 * BidiKeyboard hosted by the parent
631 async BidiKeyboardNotify(bool isLangRTL, bool haveBidiKeyboards);
634 * Dump this process's GC and CC logs to the provided files.
636 * For documentation on the other args, see dumpGCAndCCLogsToFile in
637 * nsIMemoryInfoDumper.idl
639 async PCycleCollectWithLogs(bool dumpAllTraces,
640 FileDescriptor gcLog,
641 FileDescriptor ccLog);
645 async PScriptCache(FileDescOrError cacheFile, bool wantCacheData);
647 async RegisterChrome(ChromePackage[] packages, SubstitutionMapping[] substitutions,
648 OverrideMapping[] overrides, nsCString locale, bool reset);
649 async RegisterChromeItem(ChromeRegistryItem item);
651 async ClearImageCacheFromPrincipal(nullable nsIPrincipal aPrincipal);
653 async ClearImageCacheFromBaseDomain(nsCString aBaseDomain);
655 async ClearImageCache(bool privateLoader, bool chrome);
657 async ClearStyleSheetCache(nullable nsIPrincipal? aForPrincipal,
658 nsCString? aBaseDomain);
660 async SetOffline(bool offline);
661 async SetConnectivity(bool connectivity);
662 async SetCaptivePortalState(int32_t aState);
663 async SetTRRMode(ResolverMode aMode, ResolverMode aModeFromPref);
665 async NotifyVisited(VisitedQueryResult[] uri);
668 * Tell the child that the system theme has changed, and that a repaint is
671 async ThemeChanged(FullLookAndFeel lookAndFeelData, ThemeChangeKind aKind);
673 async PreferenceUpdate(Pref pref);
674 async VarUpdate(GfxVarUpdate var);
676 async UpdatePerfStatsCollectionMask(uint64_t aMask);
677 async CollectPerfStatsJSON() returns (nsCString aStats);
679 async CollectScrollingMetrics() returns (uint32_t pixelsScrolled, uint32_t scrollDurationMS);
681 async NotifyAlertsObserver(nsCString topic, nsString data);
683 async GeolocationUpdate(nullable nsIDOMGeoPosition aPosition);
685 async GeolocationError(uint16_t errorCode);
687 async UpdateDictionaryList(nsCString[] dictionaries);
689 async UpdateFontList(SystemFontList fontList);
692 * The shared font list has been updated by the parent, so child processes
693 * should globally reflow everything to pick up new character coverage etc.
694 * If aFullRebuild is true, child processes must discard and recreate
695 * their mappings to the shmem blocks, as those are no longer valid.
696 * This message has raised priority so that it will take precedence over
697 * vsync messages to the child.
699 [Priority=mediumhigh] async RebuildFontList(bool aFullRebuild);
702 * The shared font list has been modified, potentially adding matches
703 * for src:local() names that were previously not known, so content
704 * may need to be reflowed.
706 async FontListChanged();
709 * The font list or prefs have been updated in such a way that we might need
710 * to do a reflow and maybe reframe.
712 async ForceGlobalReflow(bool aNeedsReframe);
715 * A new shmem block has been added to the font list; the child process
716 * should map the new block and add to its index.
718 async FontListShmBlockAdded(uint32_t aGeneration, uint32_t aIndex,
719 SharedMemoryHandle aHandle);
721 async UpdateAppLocales(nsCString[] appLocales);
722 async UpdateRequestedLocales(nsCString[] requestedLocales);
725 * The system timezone has changed; the child process should ensure that
726 * calls to get the default timezone return the new value.
728 async SystemTimezoneChanged();
730 async UpdateL10nFileSources(L10nFileSourceDescriptor[] sources);
732 async RegisterStringBundles(StringBundleDescriptor[] stringBundles);
734 async UpdateSharedData(FileDescriptor mapFile, uint32_t aSize,
736 nsCString[] changedKeys);
738 // nsIPermissionManager messages
739 async AddPermission(Permission permission);
740 async RemoveAllPermissions();
742 async FlushMemory(nsString reason);
744 async ApplicationBackground();
745 async ApplicationForeground();
746 async GarbageCollect();
747 async CycleCollect();
748 async UnlinkGhosts();
751 * Start accessibility engine in content process.
753 async ActivateA11y();
756 * Shutdown accessibility engine in content process (if not in use).
758 async ShutdownA11y();
760 async AppInfo(nsCString version, nsCString buildID, nsCString name, nsCString UAName,
761 nsCString ID, nsCString vendor, nsCString sourceURL, nsCString updateURL);
764 * Send the remote type associated with the content process.
766 async RemoteType(nsCString aRemoteType, nsCString aProfile);
769 * Send BlobURLRegistrationData to child process.
771 async InitBlobURLs(BlobURLRegistrationData[] registrations);
774 * Send JS{Content, Window}ActorInfos to child process.
776 async InitJSActorInfos(JSProcessActorInfo[] aContentInfos, JSWindowActorInfo[] aWindowInfos);
779 * Unregister a previously registered JSWindowActor in the child process.
781 async UnregisterJSWindowActor(nsCString name);
784 * Unregister a previously registered JSProcessActor in the child process.
786 async UnregisterJSProcessActor(nsCString name);
788 async SetXPCOMProcessAttributes(XPCOMInitData xpcomInit,
789 StructuredCloneData initialData,
790 FullLookAndFeel lookAndFeeldata,
791 /* used on MacOSX/Linux/Android only: */
792 SystemFontList systemFontList,
793 SharedMemoryHandle? sharedUASheetHandle,
794 uintptr_t sharedUASheetAddress,
795 SharedMemoryHandle[] sharedFontListBlocks,
798 // Notify child that last-pb-context-exited notification was observed
799 async LastPrivateDocShellDestroyed();
801 async NotifyProcessPriorityChanged(ProcessPriority priority);
802 async MinimizeMemoryUsage();
805 * Used to manage nsIStyleSheetService across processes.
807 async LoadAndRegisterSheet(nullable nsIURI uri, uint32_t type);
808 async UnregisterSheet(nullable nsIURI uri, uint32_t type);
811 * Notify idle observers in the child
813 async NotifyIdleObserver(uint64_t observerId, nsCString topic, nsString str);
815 async InvokeDragSession(MaybeDiscardedWindowContext aSourceWindowContext,
816 MaybeDiscardedWindowContext aSourceTopWindowContext,
817 IPCTransferableData[] transfers, uint32_t action);
819 async EndDragSession(bool aDoneDrag, bool aUserCancelled,
820 LayoutDeviceIntPoint aDragEndPoint,
821 uint32_t aKeyModifiers,
822 uint32_t aDropEffect);
824 async DomainSetChanged(uint32_t aSetType, uint32_t aChangeType, nullable nsIURI aDomain);
827 * Notify the child that it will soon be asked to shutdown.
828 * This is sent with high priority right before the normal shutdown.
830 [Priority=control] async ShutdownConfirmedHP();
833 * Notify the child to shutdown. The child will in turn call FinishShutdown
834 * and let the parent close the channel.
838 async LoadProcessScript(nsString url);
841 * Requests a full native update of a native plugin child window. This is
842 * a Windows specific call.
844 async UpdateWindow(uintptr_t aChildId);
847 * Notify the child that cache is emptied.
849 async NotifyEmptyHTTPCache();
852 * Send a `push` event without data to a service worker in the child.
854 async Push(nsCString scope, nullable nsIPrincipal principal, nsString messageId);
857 * Send a `push` event with data to a service worker in the child.
859 async PushWithData(nsCString scope, nullable nsIPrincipal principal,
860 nsString messageId, uint8_t[] data);
863 * Send a `pushsubscriptionchange` event to a service worker in the child.
865 async PushSubscriptionChange(nsCString scope, nullable nsIPrincipal principal);
867 async GetFilesResponse(nsID aID, GetFilesResponseResult aResult);
869 async BlobURLRegistration(nsCString aURI, IPCBlob aBlob,
870 nullable nsIPrincipal aPrincipal, nsCString aPartitionKey);
872 async BlobURLUnregistration(nsCString aURI);
874 async GMPsChanged(GMPCapabilityData[] capabilities);
877 async ProvideAnonymousTemporaryFile(uint64_t aID, FileDescOrError aFD);
879 async SetPermissionsWithKey(nsCString aPermissionKey, Permission[] aPermissions);
881 async RefreshScreens(ScreenDetails[] aScreens);
883 async ShareCodeCoverageMutex(CrossProcessMutexHandle handle);
884 async FlushCodeCoverageCounters() returns (bool unused);
887 * IPC message to enable the input event queue on the main thread of the
890 async SetInputEventQueueEnabled();
893 * IPC message to flush the input event queue on the main thread of the
896 * When the ContentParent stops sending the input event with input priority,
897 * there may be some pending events in the input event queue and normal
898 * event queue. Here is a possible scenario.
900 * D: Enable the input priority event.
901 * E: Disable the input priority evnet.
904 * Normal Queue: R1 R2 R3
905 * Input Queue: II I2 I3
907 * To avoid the newly added normal events (e.g. R2, which may be an input
908 * event) preempt the pending input events (e.g. I1), or the newly added
909 * input events (e.g. I3) preempt the pending normal events (e.g. R2), we
910 * have to flush all pending events before enabling and disabling the input
913 * To flush the normal event queue and the input event queue, we use three
914 * IPC messages as the followings.
915 * FI: Flush the input queue.
916 * SI: Suspend the input queue.
917 * RI: Resume the input queue.
919 * Normal Queue: R1 FI RI R2 FI RI R3
920 * Input Queue: II SI I2 SI I3
922 * When the flush input request is processed before the other two requests,
923 * we consume all input events until the suspend request. After handling the
924 * suspend request, we stop consuming the input events until the resume
925 * request to make sure we consume all pending normal events.
927 * If we process the suspend request before the other two requests, we
928 * ignore the flush request and consume all pending normal events until the
931 async FlushInputEventQueue();
934 * IPC message to resume consuming the pending events in the input event
937 async ResumeInputEventQueue();
940 * IPC message to suspend consuming the pending events in the input event
943 [Priority=input] async SuspendInputEventQueue();
946 * IPC message to propagate dynamic scalar definitions, added after the
947 * content process is spawned, from the parent to the child.
948 * Dynamic scalar definitions added at the process startup are handled
949 * using the |TelemetryIPC::AddDynamicScalarDefinitions| functions.
951 async AddDynamicScalars(DynamicScalarDefinition[] definitions);
953 // This message is sent to content processes, and triggers the creation of a
954 // new HttpChannelChild that will be connected to the parent channel
955 // represented by registrarId.
956 // This is on PContent not PNecko, as PNecko may not be initialized yet.
957 // The returned loadInfo needs to be set on the channel - since the channel
958 // moved to a new process it now has different properties.
960 async CrossProcessRedirect(RedirectToRealChannelArgs args,
961 Endpoint<PStreamFilterParent>[] aEndpoint)
962 returns (nsresult rv);
965 * This method is used to notifty content process to start delayed autoplay
966 * media via browsing context.
968 async StartDelayedAutoplayMediaComponents(MaybeDiscardedBrowsingContext aContext);
971 * This method is used to dispatch MediaControlAction to content process in
972 * order to control media within a specific browsing context tree.
974 async UpdateMediaControlAction(MaybeDiscardedBrowsingContext aContext,
975 MediaControlAction aAction);
977 // Begin subscribing to a new BrowsingContextGroup, sending down the current
978 // value for every individual BrowsingContext.
979 async RegisterBrowsingContextGroup(uint64_t aGroupId, SyncedContextInitializer[] aInits);
981 // The BrowsingContextGroup has been destroyed in the parent process. The
982 // content process won't destroy the group until it receives this message or
985 // When the content process receives this message, all contexts in the group
986 // should have already been destroyed.
987 async DestroyBrowsingContextGroup(uint64_t aGroupId);
989 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
990 // Initialize top-level actor for testing content process sandbox.
991 async InitSandboxTesting(Endpoint<PSandboxTestingChild> aEndpoint);
994 async LoadURI(MaybeDiscardedBrowsingContext aContext, nsDocShellLoadState aLoadState, bool aSetNavigating)
995 returns (bool aSuccess);
997 async InternalLoad(nsDocShellLoadState aLoadState);
999 async DisplayLoadError(MaybeDiscardedBrowsingContext aContext, nsString aURI);
1001 async GoBack(MaybeDiscardedBrowsingContext aContext, int32_t? aCancelContentJSEpoch, bool aRequireUserInteraction, bool aUserActivation);
1002 async GoForward(MaybeDiscardedBrowsingContext aContext, int32_t? aCancelContentJSEpoch, bool aRequireUserInteraction, bool aUserActivation);
1003 async GoToIndex(MaybeDiscardedBrowsingContext aContext, int32_t aIndex, int32_t? aCancelContentJSEpoch, bool aUserActivation);
1004 async Reload(MaybeDiscardedBrowsingContext aContext, uint32_t aReloadFlags);
1005 async StopLoad(MaybeDiscardedBrowsingContext aContext, uint32_t aStopFlags);
1007 async OnAllowAccessFor(MaybeDiscardedBrowsingContext aParentContext,
1008 nsCString aTrackingOrigin,
1009 uint32_t aCookieBehavior,
1010 StorageAccessPermissionGrantedReason aReason);
1012 async OnContentBlockingDecision(MaybeDiscardedBrowsingContext aContext,
1013 BlockingDecision aReason,
1014 uint32_t aRejectedReason);
1017 * Abort orientationPendingPromises for documents in the child which
1018 * are part of a BrowsingContextGroup.
1020 async AbortOrientationPendingPromises(MaybeDiscardedBrowsingContext aContext);
1022 async HistoryCommitIndexAndLength(MaybeDiscardedBrowsingContext aContext,
1023 uint32_t aIndex, uint32_t aLength,
1026 async GetLayoutHistoryState(MaybeDiscardedBrowsingContext aContext)
1027 returns (nullable nsILayoutHistoryState aState, Wireframe? aWireframe);
1029 async DispatchLocationChangeEvent(MaybeDiscardedBrowsingContext aContext);
1031 // Dispatches a "beforeunload" event to each in-process content window in the
1032 // subtree beginning at `aStartingAt`, and returns the result as documented in
1033 // the `PermitUnloadResult` enum.
1034 async DispatchBeforeUnloadToSubtree(MaybeDiscardedBrowsingContext aStartingAt)
1035 returns (PermitUnloadResult result);
1037 // Update the cached list of codec supported in the given process.
1038 async UpdateMediaCodecsSupported(RemoteDecodeIn aLocation, MediaCodecsSupported aSupported);
1040 // Send the list of the supported mimetypes in the given process. GeckoView-specific
1041 async DecoderSupportedMimeTypes(nsCString[] supportedTypes);
1043 // Used to initialize the global variable in content processes with the
1044 // latched value in the parent process. See dom/LocalStorageCommon.h for more
1046 async InitNextGenLocalStorageEnabled(bool enabled);
1048 async PRemotePrintJob();
1052 async SynchronizeLayoutHistoryState(MaybeDiscardedBrowsingContext aContext,
1053 nullable nsILayoutHistoryState aState);
1055 async SessionHistoryEntryTitle(MaybeDiscardedBrowsingContext aContext,
1058 async SessionHistoryEntryScrollRestorationIsManual(MaybeDiscardedBrowsingContext aContext,
1060 async SessionHistoryEntryScrollPosition(MaybeDiscardedBrowsingContext aContext,
1061 int32_t aX, int32_t aY);
1063 async SessionHistoryEntryCacheKey(MaybeDiscardedBrowsingContext aContext,
1064 uint32_t aCacheKey);
1066 async SessionHistoryEntryStoreWindowNameInContiguousEntries(MaybeDiscardedBrowsingContext aContext,
1069 async SessionHistoryEntryWireframe(MaybeDiscardedBrowsingContext aContext,
1070 Wireframe aWireframe);
1072 async GetLoadingSessionHistoryInfoFromParent(MaybeDiscardedBrowsingContext aContext)
1073 returns (LoadingSessionHistoryInfo? aLoadingInfo);
1075 async RemoveFromBFCache(MaybeDiscardedBrowsingContext aContext);
1077 async InitBackground(Endpoint<PBackgroundStarterParent> aEndpoint);
1079 async CreateGMPService();
1081 async InitStreamFilter(uint64_t channelId, nsString addonId)
1082 returns (Endpoint<PStreamFilterChild> aEndpoint);
1084 async PRemoteSpellcheckEngine();
1086 async InitCrashReporter(NativeThreadId tid);
1088 sync IsSecureURI(nullable nsIURI aURI, OriginAttributes aOriginAttributes)
1089 returns (bool isSecureURI);
1091 async AccumulateMixedContentHSTS(nullable nsIURI aURI, bool aActive,
1092 OriginAttributes aOriginAttributes);
1094 [Nested=inside_cpow] async PHal();
1096 async PHeapSnapshotTempFileHelper();
1100 #ifdef MOZ_WEBSPEECH
1101 async PSpeechSynthesis();
1107 async PWebrtcGlobal();
1110 async CreateAudioIPCConnection() returns (FileDescOrError fd);
1112 sync PURLClassifier(nullable nsIPrincipal principal)
1113 returns (bool success);
1115 async PURLClassifierLocal(nullable nsIURI uri, IPCURLClassifierFeature[] features);
1117 async PLoginReputation(nullable nsIURI formURI);
1119 async PSessionStorageObserver();
1121 async PBenchmarkStorage();
1123 // Services remoting
1125 async StartVisitedQueries(nullable nsIURI[] uri);
1126 async SetURITitle(nullable nsIURI uri, nsString title);
1128 async LoadURIExternal(nullable nsIURI uri,
1129 nullable nsIPrincipal triggeringPrincipal,
1130 nullable nsIPrincipal redirectPrincipal,
1131 MaybeDiscardedBrowsingContext browsingContext,
1132 bool wasExternallyTriggered,
1133 bool hasValidUserGestureActivation);
1134 async ExtProtocolChannelConnectParent(uint64_t registrarId);
1136 // PrefService message
1137 sync GetGfxVars() returns (GfxVarUpdate[] vars);
1139 sync SyncMessage(nsString aMessage, ClonedMessageData aData)
1140 returns (StructuredCloneData[] retval);
1142 async ShowAlert(nullable nsIAlertNotification alert);
1144 async CloseAlert(nsString name, bool contextClosed);
1146 async DisableNotifications(nullable nsIPrincipal principal);
1148 async OpenNotificationSettings(nullable nsIPrincipal principal);
1150 async AddSecurityState(MaybeDiscardedWindowContext aContext, uint32_t aStateFlags);
1152 // Request that the ServiceWorkerManager in the parent process create a
1153 // notification "click" or "close" event and dispatch it on the relevant
1154 // ServiceWorker. This needs to happen because when a notification is
1155 // created it is tied to a specific content process and when the user clicks
1156 // on the notification, it will be that content process that is notified.
1157 // However, even if the ServiceWorker lives in that process (it may no
1158 // longer be in that process, or may have never lived there), the right/only
1159 // way to talk through the ServiceWorker is through the parent.
1161 // This happens on PContent because the ServiceWorkerManager lives on the
1162 // main thread and bouncing this off of PBackground would be silly and
1163 // complex. In the long run, the notification implementation will be
1164 // overhauled to directly process the notification click/close and directly
1165 // translate that to a ServiceWorker event.
1166 async NotificationEvent(nsString type, NotificationEventData data);
1168 // Creates a helper for forwarding data from an nsExternalAppHandler
1169 // running in the content process, to one running in the parent
1171 // Bug 1574372 aims to run nsExternalAppHandler entirely in the
1172 // parent so that we can remove this.
1174 // Serializes the uri, loadInfo, contentType, referrer, contentDisposition
1175 // headers and contentLength of the channel so that we can make them
1176 // available to the parent instance via a nsIChannel helper. Also
1177 // passes whether the original channel was an instance of nsIFileChannel.
1179 // aContext is the BrowsingContext that initiated the load, and created the
1182 // Pass true for aForceSave to always save this content to disk, regardless of
1183 // nsIMIMEInfo and other such influences.
1184 // Pass true for aShouldCloseWindow to specify that aContext was opened specifically
1185 // for this load, and should be closed once we've handled it.
1186 async PExternalHelperApp(nullable nsIURI uri,
1187 LoadInfoArgs loadInfoArgs,
1188 nsCString aMimeContentType,
1189 nsCString aContentDisposition,
1190 uint32_t aContentDispositionHint,
1191 nsString aContentDispositionFilename,
1193 int64_t aContentLength,
1194 bool aWasFileChannel,
1195 nullable nsIURI aReferrer,
1196 MaybeDiscardedBrowsingContext aContext,
1197 bool aShouldCloseWindow);
1199 async PHandlerService();
1201 async AddGeolocationListener(bool highAccuracy);
1202 async RemoveGeolocationListener();
1203 async SetGeolocationHigherAccuracy(bool enable);
1205 async ConsoleMessage(nsString message);
1206 async ScriptErrorWithStack(nsString message, nsString sourceName, nsString sourceLine,
1207 uint32_t lineNumber, uint32_t colNumber, uint32_t flags,
1208 nsCString category, bool privateWindow,
1209 bool fromChromeContext, ClonedMessageData stack);
1211 // Places the items within dataTransfer on the clipboard.
1212 async SetClipboard(IPCTransferable aTransferable,
1213 int32_t aWhichClipboard);
1215 // Given a list of supported types, returns the clipboard data for the
1216 // first type that matches.
1217 sync GetClipboard(nsCString[] aTypes, int32_t aWhichClipboard)
1218 returns (IPCTransferableData transferableData);
1220 // Returns a list of formats supported by the clipboard
1221 sync GetExternalClipboardFormats(int32_t aWhichClipboard, bool aPlainTextOnly) returns (nsCString[] aTypes);
1223 // Given a list of supported types, returns the clipboard data for the
1224 // first type that matches.
1225 async GetClipboardAsync(nsCString[] aTypes, int32_t aWhichClipboard) returns (IPCTransferableDataOrError transferableData);
1227 // Clears the clipboard.
1228 async EmptyClipboard(int32_t aWhichClipboard);
1230 // Returns true if data of one of the specified types is on the clipboard.
1231 sync ClipboardHasType(nsCString[] aTypes, int32_t aWhichClipboard)
1232 returns (bool hasType);
1234 // Given a list of supported types, returns a list of types that clipboard
1235 // constains the data for the specified type.
1236 async ClipboardHasTypesAsync(nsCString [] aTypes, int32_t aWhichClipboard)
1237 returns (nsCString [] types);
1240 * Notify the parent that the child has started a clipboard write request,
1241 * and that the data will be sent over another IPC message once it is ready.
1242 * @param aClipboardType
1243 * The clipboard type defined in nsIClipboard.
1245 async PClipboardWriteRequest(int32_t aClipboardType);
1247 // 'Play', 'Beep' and 'PlayEventSound' are the only nsISound methods used in
1248 // the content process.
1249 [Compress] async PlaySound(nullable nsIURI aURL);
1250 [Compress] async Beep();
1251 [Compress] async PlayEventSound(uint32_t aEventId);
1253 sync GetIconForExtension(nsCString aFileExt, uint32_t aIconSize)
1254 returns (uint8_t[] bits);
1256 // Tell the parent that the child has gone idle for the first time.
1259 async CopyFavicon(nullable nsIURI oldURI, nullable nsIURI newURI, bool isPrivate);
1261 async FindImageText(IPCImage image, nsCString[] languages)
1262 returns (TextRecognitionResultOrError result);
1265 async GraphicsError(nsCString aError);
1267 // Driver crash guards. aGuardType must be a member of CrashGuardType.
1268 sync BeginDriverCrashGuard(uint32_t aGuardType) returns (bool crashDetected);
1269 sync EndDriverCrashGuard(uint32_t aGuardType);
1271 async AddIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
1272 async RemoveIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
1275 * This message is only used on X11 platforms.
1277 * Send a dup of the plugin process's X socket to the parent
1278 * process. In theory, this scheme keeps the plugin's X resources
1279 * around until after both the plugin process shuts down *and* the
1280 * parent process closes the dup fd. This is used to prevent the
1281 * parent process from crashing on X errors if, e.g., the plugin
1282 * crashes *just before* a repaint and the parent process tries to
1283 * use the newly-invalid surface.
1285 async BackUpXResources(FileDescriptor aXSocketFd);
1287 async RequestAnonymousTemporaryFile(uint64_t aID);
1290 * Notifies the parent that the child needs no more ForceKill dump.
1292 [Priority=control] async NotifyShutdownSuccess();
1295 * Notifies the parent to continue shutting down after the child performs
1296 * its shutdown tasks.
1298 async FinishShutdown();
1300 async UpdateDropEffect(uint32_t aDragAction, uint32_t aDropEffect);
1303 * Initiates an asynchronous request for permission for the
1304 * provided principal.
1307 * The array of permissions to request.
1309 * The principal of the request.
1310 * @param aTopLevelPrincipal
1311 * The principal of the top level page the request comes from.
1313 * To identify which tab issues this request.
1315 * NOTE: The principal is untrusted in the parent process. Only
1316 * principals that can live in the content process should
1319 async PContentPermissionRequest(PermissionRequest[] aRequests,
1320 nullable nsIPrincipal aPrincipal,
1321 nullable nsIPrincipal aTopLevelPrincipal,
1322 bool aIsHandlingUserInput,
1323 bool aMaybeUnsafePermissionDelegate,
1327 * If the profiler is running when the process shuts down, this sends the
1328 * profile data collected so far.
1331 * This may contain an empty string (unknown issue), an error message
1332 * starting with '*', or a profile as a stringified JSON object.
1334 async ShutdownProfile(nsCString aProfile);
1337 * This sends any collected perf stats data on shutdown.
1339 async ShutdownPerfStats(nsCString aPerfStats);
1342 * Request graphics initialization information from the parent.
1344 sync GetGraphicsDeviceInitData()
1345 returns (ContentDeviceData aData);
1348 * Request a buffer containing the contents of the output color profile.
1349 * If set, this is the file pointed to by
1350 * gfx.color_management.display_profile, otherwise it contains a
1351 * platform-specific default
1353 sync GetOutputColorProfileData()
1354 returns (uint8_t[] aOutputColorProfileData);
1357 * A shared font list (see gfx/thebes/SharedFontList.*) contains a list
1358 * of shared-memory blocks that are used to store all the font list data.
1359 * The font list created in the parent process is the only one that can
1360 * create or store objects into the shared memory; content processes font
1361 * lists have read-only access to it.
1363 * To minimize the cost of record allocations, the shared font list
1364 * bump-allocates new objects that it adds to the shared memory blocks
1365 * (i.e. the records stored in the shared memory blocks are only ever
1366 * appended, and never freed except when the entire font list is
1369 * When initially created by the parent process, the font list may contain
1370 * nothing except a header, and the list of the system's installed font
1371 * family names. Additional data about the families (styled faces available
1372 * and character coverage) is appended to the font list during the session
1373 * as a given font is considered for use, because loading all data for all
1374 * installed fonts during startup is too expensive/slow.
1376 * During content process launch, a content process's first step in
1377 * gaining access to the font list is to call GetFontListShmBlock,
1378 * passing index zero in order to get access to the first block, which
1379 * contains the font list header and the list of font-family records
1380 * (which may be virtually all uninitialized at this time, containing
1381 * nothing but the family names). Once a content process determines a
1382 * font-family name it wants to use (e.g. from a CSS font-family list, or
1383 * from preferences), if that Family record has not yet been initialized,
1384 * it will call InitializeFamily (below) to have the parent process
1385 * populate Face records in the shared memory with the family's styles.
1386 * The content process can then pick the face with best style match from
1387 * the available faces according to the CSS font matching algorithm, load
1388 * its character map, then send the map to the parent process using
1389 * SetCharacterMap (so that the parent process can share the map with all
1390 * processes to avoid duplication of work).
1392 * At some point, as the parent process adds data to the font list, a new
1393 * shared-memory block will probably be needed. At that point the parent
1394 * will create a new block and append it to its share memory block list.
1395 * The new Block index will start to appear in Pointer records in the
1396 * shared memory, and the content process's can then fetch those other
1397 * blocks using this function as needed.
1399 * @param aGeneration
1400 * The font list has a Generation ID stored in its Header, and any time
1401 * the parent process needs to reinitialize the list (because of a change
1402 * in the available font repertoire) a new Generation ID is assigned.
1403 * Content processes pass the Generation of the list they're using in
1404 * all messages, so that the parent can recognize if they're out of date
1405 * and safely ignore such messages. (When the parent rebuilds the list,
1406 * it will notify all content processes, but they may still send a few
1407 * messages that relate to the obsolete list before they have processed
1408 * this notification.)
1410 * (Zero-based) index of the shared-memory block to be mapped.
1411 * In a typical case, there will be a handful of blocks altogether, so
1412 * each content process only needs to make this request a few times.
1414 * Handle that can be used to construct a SharedMemory that maps the
1415 * requested block of memory.
1416 * If aGeneration does not match the parent's font list generation ID, or
1417 * if requesting a block that does not exist (i.e. with aIndex greater
1418 * than or equal to the number of blocks actually in existence), returns
1421 * This is a sync message because the content process needs font data in
1422 * order to perform font-matching (e.g. during reflow), and cannot continue
1423 * until it has mapped the font-list memory.
1425 sync GetFontListShmBlock(uint32_t aGeneration, uint32_t aIndex)
1426 returns (SharedMemoryHandle aHandle);
1429 * Ask the parent to initialize a given font family, so that face metadata
1430 * will be available. Content processes will only call this for families
1431 * where the Face data has not yet been populated, so it will generally be
1432 * called no more than once per family. (It may not be needed at all, if
1433 * the parent process has already initialized the families that content
1436 * @param aGeneration
1437 * Font-list generation, so requests relating to an obsolete list can be
1438 * ignored (see comments for GetFontListShmBlock).
1439 * @param aFamilyIndex
1440 * The 0-based index of the Family within the font-list that a content
1441 * process needs to use.
1443 * If true, the parent should eagerly load character maps for the faces
1446 * This is a sync message because the content process cannot complete its
1447 * font-matching until the family is fully populated with Face records.
1448 * If we make it async, content processes will reflow using fallbacks,
1449 * and then have to reflow again once all the font information needed
1450 * becomes available.
1452 sync InitializeFamily(uint32_t aGeneration, uint32_t aFamilyIndex,
1456 * Record the character map of a given Face in the font list.
1458 * @param aGeneration
1459 * Font-list generation, so requests relating to an obsolete list can be
1460 * ignored (see comments for GetFontListShmBlock).
1462 * Font-list shared-memory "pointer" to the Face record to be updated.
1463 * A Pointer is a record of a shared-memory block index and an offset
1464 * within that block, which each process that maps the block can convert
1465 * into a real pointer in its address space.
1467 * The character coverage map of the face. (This will be stored as a
1468 * SharedBitSet record within the shared font list, and the Face record
1469 * will be updated to reference it.)
1471 async SetCharacterMap(uint32_t aGeneration, Pointer aFacePtr, gfxSparseBitSet aMap);
1474 * Ask the parent to set up the merged charmap for a family, to accelerate
1475 * future fallback searches.
1476 * aFamilyPtr may refer to an element of either the Families() or AliasFamilies().
1478 async SetupFamilyCharMap(uint32_t aGeneration, Pointer aFamilyPtr);
1481 * Ask the parent to try and complete the InitOtherFamilyNames task, because
1482 * we're trying to look up a localized font name. This is a sync method so that
1483 * the update will be available before the child continues reflow; however, it
1484 * is possible the task will have timed-out in the parent and not actually
1485 * completed during this call.
1487 * @param aGeneration
1488 * Font-list generation, so requests relating to an obsolete list can be
1489 * ignored (see comments for GetFontListShmBlock).
1491 * Parameter aDeferOtherFamilyNamesLoading to be passed to
1492 * gfxPlatformFontList::InitOtherFamilyNames, to determine whether name
1493 * loading should be deferred to a background task or run immediately.
1495 * Returns whether the font name loading process has completed.
1497 * TODO: This is currently a sync message but can probably be made async,
1498 * at the cost of an increased chance of some testcases failing because
1499 * they depend on lazily-loaded font names.
1501 sync InitOtherFamilyNames(uint32_t aGeneration, bool aDefer) returns (bool aLoaded);
1504 * Ask the parent to load all font character maps, as we need to do an
1505 * exhaustive font-fallback search. This is done asynchronously; when it
1506 * finishes, the parent will trigger global reflow so that font selection
1507 * is re-done in all content, making use of the newly-loaded cmaps.
1508 * Normally this will only happen once per browser session (unless the
1509 * font list is rebuilt due to installation/removal of system fonts).
1511 * @param aGeneration
1512 * Font-list generation, so requests relating to an obsolete list can be
1513 * ignored (see comments for GetFontListShmBlock).
1514 * @param aStartIndex
1515 * The family index to start from; the sender has determined that cmaps
1516 * up to this point are already loaded.
1518 async StartCmapLoading(uint32_t aGeneration, uint32_t aStartIndex);
1521 * Ask the parent for a specific hyphenation resource (identified by URI)
1522 * as a shared memory block.
1524 * This is a sync method because at the point where a content process finds
1525 * that it requires a particular hyphenation dictionary, this is blocking
1526 * reflow; making it async would require scheduling another reflow after
1527 * the resource is available, and a possible layout "jump" as line-breaks
1528 * change. Note that the content process retains a reference to each such
1529 * resource it requests, so it will only make this call once per locale for
1530 * which hyphenation data exists.
1533 * The URI (which currently must always point to an omnijar resource)
1534 * for the required hyphenation dictionary.
1536 * Returns the shmem handle to the resource (or an invalid shmem handle
1537 * in case of failure).
1539 * Returns the size in bytes of the resource.
1541 sync GetHyphDict(nullable nsIURI aURI) returns (SharedMemoryHandle aHandle, uint32_t aSize);
1543 async CreateWindow(PBrowser aThisTab,
1544 MaybeDiscardedBrowsingContext aParent,
1546 uint32_t aChromeFlags,
1549 bool aForWindowDotPrint,
1550 nullable nsIURI aURIToLoad,
1551 nsCString aFeatures,
1552 nullable nsIPrincipal aTriggeringPrincipal,
1553 nullable nsIContentSecurityPolicy aCsp,
1554 nullable nsIReferrerInfo aReferrerInfo,
1555 OriginAttributes aOriginAttributes)
1556 returns (CreatedWindowInfo window);
1558 async CreateWindowInDifferentProcess(
1560 MaybeDiscardedBrowsingContext aParent,
1561 uint32_t aChromeFlags,
1563 nullable nsIURI aURIToLoad,
1564 nsCString aFeatures,
1566 nullable nsIPrincipal aTriggeringPrincipal,
1567 nullable nsIContentSecurityPolicy aCsp,
1568 nullable nsIReferrerInfo aReferrerInfo,
1569 OriginAttributes aOriginAttributes);
1572 * Tell the parent that a decoder's' benchmark has been completed.
1573 * The result can then be stored in permanent storage.
1575 async NotifyBenchmarkResult(nsString aCodecName, uint32_t aDecodeFPS);
1578 * Notify `push-message` observers without data in the parent.
1580 async NotifyPushObservers(nsCString scope, nullable nsIPrincipal principal,
1581 nsString messageId);
1584 * Notify `push-message` observers with data in the parent.
1586 async NotifyPushObserversWithData(nsCString scope, nullable nsIPrincipal principal,
1587 nsString messageId, uint8_t[] data);
1590 * Notify `push-subscription-change` observers in the parent.
1592 async NotifyPushSubscriptionChangeObservers(nsCString scope,
1593 nullable nsIPrincipal principal);
1595 async GetFilesRequest(nsID aID, nsString aDirectory, bool aRecursiveFlag);
1596 async DeleteGetFilesRequest(nsID aID);
1598 async StoreAndBroadcastBlobURLRegistration(nsCString url, IPCBlob blob,
1599 nullable nsIPrincipal principal, nsCString aPartitionKey);
1601 async UnstoreAndBroadcastBlobURLUnregistration(nsCString url, nullable nsIPrincipal principal);
1604 * Messages for communicating child Glean data to the parent process
1606 async RecordPageLoadEvent(PageLoadExtra event);
1609 * Messages for communicating child Telemetry to the parent process
1611 async AccumulateChildHistograms(HistogramAccumulation[] accumulations);
1612 async AccumulateChildKeyedHistograms(KeyedHistogramAccumulation[] accumulations);
1613 async UpdateChildScalars(ScalarAction[] updates);
1614 async UpdateChildKeyedScalars(KeyedScalarAction[] updates);
1615 async RecordChildEvents(ChildEventData[] events);
1616 async RecordDiscardedData(DiscardedData data);
1618 async AddMemoryReport(MemoryReport aReport);
1620 async BHRThreadHang(HangDetails aHangDetails);
1623 * Adds a certificate exception for the given hostname and port.
1625 async AddCertException(nullable nsIX509Cert aCert, nsCString aHostName,
1626 int32_t aPort, OriginAttributes aOriginAttributes,
1628 returns (nsresult success);
1631 * Determines whether storage access can be granted automatically by the
1632 * storage access API without showing a user prompt.
1634 async AutomaticStorageAccessPermissionCanBeGranted(nullable nsIPrincipal aPrincipal)
1635 returns (bool success);
1638 * A 3rd party tracking origin (aTrackingOrigin) has received the permission
1639 * granted to have access to aGrantedOrigin when loaded by aParentWindowId.
1641 async StorageAccessPermissionGrantedForOrigin(uint64_t aTopLevelWindowId,
1642 MaybeDiscardedBrowsingContext aParentContext,
1643 nullable nsIPrincipal aTrackingPrincipal,
1644 nsCString aTrackingOrigin,
1646 StorageAccessPermissionGrantedReason? aReason,
1648 returns (bool unused);
1650 async CompleteAllowAccessFor(MaybeDiscardedBrowsingContext aParentContext,
1651 uint64_t aTopLevelWindowId,
1652 nullable nsIPrincipal aTrackingPrincipal,
1653 nsCString aTrackingOrigin,
1654 uint32_t aCookieBehavior,
1655 StorageAccessPermissionGrantedReason aReason)
1656 returns (StorageAccessPromptChoices? choice);
1658 async SetAllowStorageAccessRequestFlag(
1659 nullable nsIPrincipal aEmbeddingPrincipal,
1660 nullable nsIURI aEmbeddedOrigin)
1661 returns (bool success);
1663 async TestAllowStorageAccessRequestFlag(
1664 nullable nsIPrincipal aEmbeddedPrincipal,
1665 nullable nsIURI aEmbeddingOrigin)
1666 returns (bool success);
1668 async StoreUserInteractionAsPermission(nullable nsIPrincipal aPrincipal);
1670 async TestCookiePermissionDecided(MaybeDiscardedBrowsingContext aContext,
1671 nullable nsIPrincipal aPrincipal)
1672 returns (bool? allowed);
1674 async TestStorageAccessPermission(nullable nsIPrincipal aEmbeddingPrincipal,
1675 nsCString aEmbeddedOrigin)
1676 returns (bool? allowed);
1679 * When media element's controlled state changed in the content process, we
1680 * have to notify the chrome process in order to update the status of the
1681 * corresponding media controller, which is used to control all media in the
1682 * certain tab. We would use the browsing context to find the corresponding
1685 async NotifyMediaPlaybackChanged(MaybeDiscardedBrowsingContext aContext,
1686 MediaPlaybackState aState);
1689 * When media became audible or inaudible in content process, we have to
1690 * notify chrome process in order to which tab is audible.
1692 async NotifyMediaAudibleChanged(MaybeDiscardedBrowsingContext aContext,
1693 MediaAudibleState aState);
1696 * When media enabled or disabled the Picture-in-Picture mode, we have to
1697 * update that to the media controller in the chrome process.
1699 async NotifyPictureInPictureModeChanged(
1700 MaybeDiscardedBrowsingContext aContext, bool aEnabled);
1703 * This method is used to update media session's status when it's being
1704 * created or destroyed.
1706 async NotifyMediaSessionUpdated(MaybeDiscardedBrowsingContext aContext, bool aIsCreated);
1709 * This method is used to update media session's media metadata whenever its
1710 * metadata is being updated.
1712 async NotifyUpdateMediaMetadata(MaybeDiscardedBrowsingContext aContext,
1713 MediaMetadataBase? aMetadata);
1716 * This method is used to update media session's playback state whenever its
1717 * playback state is changed.
1719 async NotifyMediaSessionPlaybackStateChanged(
1720 MaybeDiscardedBrowsingContext aContext,
1721 MediaSessionPlaybackState aMetadata);
1724 * This method is used to update media session's supported media session
1725 * action when the action becomes supported or unsupported.
1727 async NotifyMediaSessionSupportedActionChanged(
1728 MaybeDiscardedBrowsingContext aContext,
1729 MediaSessionAction aAction,
1733 * This method is used to notify the media controller in chrome process that
1734 * the media element in the browsing context entered fullscreen.
1736 async NotifyMediaFullScreenState(
1737 MaybeDiscardedBrowsingContext aContext,
1738 bool aIsInFullScreen);
1741 * This method is used to update media session's position state whenever its
1742 * position state is being updated.
1744 async NotifyPositionStateChanged(
1745 MaybeDiscardedBrowsingContext aContext,
1746 PositionState aState);
1749 * This method will make canonical browsing context to update the count of
1750 * callers which want to keep the page from being suspended even if the page
1753 async AddOrRemovePageAwakeRequest(MaybeDiscardedBrowsingContext aContext,
1754 bool aShouldAddCount);
1758 * Due to sandboxing, a child process's UntrustedModulesProcessor cannot
1759 * obtain enough information about a DLL file to determine its
1760 * trustworthiness. This API asks the chrome process to perform that
1763 async GetModulesTrust(ModulePaths aModPaths, bool aRunAtNormalPriority)
1764 returns (ModulesMapResult? modMapResult);
1765 #endif // defined(XP_WIN)
1768 * Used to route shutdown diagnostic info from the content process
1769 * ServiceWorkers to the parent process' ServiceWorkerManager's
1770 * ServiceWorkerShutdownBlocker. (The only other actor chain available
1771 * for this would be very convoluted and create ordering problems).
1773 async ReportServiceWorkerShutdownProgress(uint32_t aShutdownStateId,
1774 Progress aProgress);
1777 * Whenever a document is updating the OrientationLock, we need to
1778 * reject the orientationPendingPromises in other processes.
1780 async AbortOtherOrientationPendingPromises(MaybeDiscardedBrowsingContext aContext);
1782 async HistoryReload(MaybeDiscardedBrowsingContext aContext, uint32_t aReloadFlags);
1784 async NotifyOnHistoryReload(MaybeDiscardedBrowsingContext aContext,
1786 returns (bool canReload, nsDocShellLoadState? loadState,
1787 bool? reloadActiveEntry);
1789 async HistoryCommit(MaybeDiscardedBrowsingContext aContext,
1790 uint64_t aLoadID, nsID aChangeID, uint32_t aLoadType,
1791 bool aPersist, bool aCloneEntryChildren,
1792 bool aChannelExpired, uint32_t aCacheKey);
1794 async HistoryGo(MaybeDiscardedBrowsingContext aContext, int32_t aOffset,
1795 uint64_t aHistoryEpoch, bool aRequireUserInteraction,
1796 bool aUserActivation) returns(int32_t? requestedIndex);
1798 async BlobURLDataRequest(nsCString aBlobURL,
1799 nullable nsIPrincipal aTriggeringPrincipal,
1800 nullable nsIPrincipal aLoadingPrincipal,
1801 OriginAttributes aOriginAttributes,
1802 uint64_t aInnerWindowId,
1803 nsCString aPartitionKey)
1804 returns (BlobURLDataRequestResult aResult);
1806 async SetActiveSessionHistoryEntry(MaybeDiscardedBrowsingContext context,
1807 nsPoint? previousScrollPosition,
1808 SessionHistoryInfo info, uint32_t loadType,
1809 uint32_t updatedCacheKey, nsID changeID);
1810 async ReplaceActiveSessionHistoryEntry(
1811 MaybeDiscardedBrowsingContext context, SessionHistoryInfo info);
1813 async RemoveDynEntriesFromActiveSessionHistoryEntry(
1814 MaybeDiscardedBrowsingContext aContext);
1816 async RemoveFromSessionHistory(
1817 MaybeDiscardedBrowsingContext aContext, nsID changeID);
1819 // Called when a nsDocShellLoadState which was received over IPC is
1820 // destroyed in the content process to clean up pending state left behind
1821 // tracking the load state in the parent process.
1822 [LazySend] async CleanupPendingLoadState(uint64_t aLoadIdentifier);
1825 async ScriptError(nsString message, nsString sourceName, nsString sourceLine,
1826 uint32_t lineNumber, uint32_t colNumber, uint32_t flags,
1827 nsCString category, bool privateWindow, uint64_t innerWindowId,
1828 bool fromChromeContext);
1831 * Used in fission to report timing data when the parent window is in
1832 * another process. Child frame will send data to its ContentParent which
1833 * will then identify the ContentParent for the innerWindowId and pass
1834 * the data to the correct process.
1835 * loadInfo is passed in order to enforce same-origin security checks
1836 * aData must be non-null.
1838 async ReportFrameTimingData(LoadInfoArgs loadInfo, nsString entryName,
1839 nsString initiatorType,
1840 UniquePtr<PerformanceTimingData> aData);
1842 async CommitBrowsingContextTransaction(MaybeDiscardedBrowsingContext aContext,
1843 BrowsingContextTransaction aTransaction,
1846 async AsyncMessage(nsString aMessage, ClonedMessageData aData);
1849 * Notify `push-subscription-modified` observers in the parent and child.
1851 async NotifyPushSubscriptionModifiedObservers(nsCString scope,
1852 nullable nsIPrincipal principal);
1855 * Send a Push error message to all service worker clients in the parent or
1858 async PushError(nsCString scope, nullable nsIPrincipal principal, nsString message,
1862 * Creates a new BrowsingContext, initialized with the values provided in
1863 * `BrowsingContextInitializer`.
1865 * This message may only be sent to the parent in limited situations. If the
1866 * new BrowsingContext has a parent window, it must be owned by the
1867 * embedding process, otherwise it must be owned by the opener, if set.
1869 [LazySend] async CreateBrowsingContext(uint64_t aGroupId, BrowsingContextInitializer aInit);
1872 * If aDoDiscard is true, discards the passed-in BrowsingContext. If the
1873 * BrowsingContext has already been discarded, this message does nothing.
1874 * If the receiver is the parent process, resolves when all content
1875 * processes have flagged the BrowsingContext as discarded, and if the
1876 * receiver is a child process, resolves when that child process has flagged
1877 * the BrowsingContext as discarded.
1879 async DiscardBrowsingContext(MaybeDiscardedBrowsingContext aContext, bool aDoDiscard)
1880 returns (uint64_t unused);
1882 async AdjustWindowFocus(MaybeDiscardedBrowsingContext aContext,
1883 bool aIsVisible, uint64_t aActionId);
1884 async WindowClose(MaybeDiscardedBrowsingContext aContext,
1885 bool aTrustedCaller);
1886 async WindowFocus(MaybeDiscardedBrowsingContext aContext,
1887 CallerType aCallerType, uint64_t aActionId);
1888 async WindowBlur(MaybeDiscardedBrowsingContext aContext,
1889 CallerType aCallerType);
1890 async RaiseWindow(MaybeDiscardedBrowsingContext aContext, CallerType aCallerType, uint64_t aActionId);
1891 async ClearFocus(MaybeDiscardedBrowsingContext aContext);
1892 async SetFocusedBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1893 async SetActiveBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1894 async UnsetActiveBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1895 async SetFocusedElement(MaybeDiscardedBrowsingContext aContext, bool aNeedsFocus);
1896 async FinalizeFocusOuter(MaybeDiscardedBrowsingContext aContext, bool aCanFocus,
1897 CallerType aCallerType);
1899 [LazySend] async InsertNewFocusActionId(uint64_t aActionId);
1900 async BlurToParent(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1901 MaybeDiscardedBrowsingContext aBrowsingContextToClear,
1902 MaybeDiscardedBrowsingContext aAncestorBrowsingContextToFocus,
1903 bool aIsLeavingDocument, bool aAdjustWidget,
1904 bool aBrowsingContextToClearHandled,
1905 bool aAncestorBrowsingContextToFocusHandled, uint64_t aActionId);
1907 async BlurToChild(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1908 MaybeDiscardedBrowsingContext aBrowsingContextToClear,
1909 MaybeDiscardedBrowsingContext aAncestorBrowsingContextToFocus,
1910 bool aIsLeavingDocument, bool aAdjustWidget, uint64_t aActionId);
1911 async SetupFocusedAndActive(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1912 uint64_t aActionIdForFocused,
1913 MaybeDiscardedBrowsingContext aActiveBrowsingContext,
1914 uint64_t aActionId);
1915 async ReviseActiveBrowsingContext(uint64_t aOldActionId,
1916 MaybeDiscardedBrowsingContext aActiveBrowsingContext,
1917 uint64_t aNewActionId);
1918 async ReviseFocusedBrowsingContext(uint64_t aOldActionId,
1919 MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1920 uint64_t aNewActionId);
1922 async MaybeExitFullscreen(MaybeDiscardedBrowsingContext aContext);
1923 async WindowPostMessage(MaybeDiscardedBrowsingContext aContext,
1924 ClonedOrErrorMessageData aMessage,
1925 PostMessageData aData);
1927 async CommitWindowContextTransaction(MaybeDiscardedWindowContext aContext,
1928 WindowContextTransaction aTransaction,
1932 // NOTE: These methods are only needed on the child, as the parent
1933 // WindowContext is managed using the PWindowGlobal actor's lifecycle.
1934 [LazySend] async CreateWindowContext(WindowContextInitializer aInit);
1935 async DiscardWindowContext(uint64_t aContextId) returns (bool unused);
1938 // Temporary (bug 1641989) conduit for Glean data in content processes.
1939 // Sent from time-to-time to limit the amount of data vulnerable to loss.
1940 // Buffer contains bincoded Rust structs.
1941 async FOGData(ByteBuf buf);
1944 // Temporary (bug 1641989) conduit for Glean data in content processes.
1945 // Tells the child to flush any pending data. Used in tests and ping
1946 // assembly. Buffer contains bincoded Rust structs.
1947 async FlushFOGData() returns (ByteBuf buf);
1950 async SetContainerFeaturePolicy(MaybeDiscardedBrowsingContext aContainerContext,
1951 nullable FeaturePolicy aContainerFeaturePolicy);
1953 // Obtain an icon from the system widget toolkit, in nsIconDecoder
1954 // format. Not supported (or needed) on all platforms; see the
1955 // implementation in ContentParent::RecvGetSystemIcon for details.
1956 async GetSystemIcon(nullable nsIURI aURI) returns (nsresult aResult, ByteBuf? aData);
1958 #ifdef FUZZING_SNAPSHOT
1959 // Used by the child process to signal that it is ready to start fuzzing.
1960 // This can in particular be used to wait for a particular event in a
1961 // test document before taking the snapshot and starting e.g. IPC fuzzing.
1962 async SignalFuzzingReady();