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 * Notifies the parent about a recording device is starting or shutdown.
1266 * @param recordingStatus starting or shutdown
1267 * @param pageURL URL that request that changing the recording status
1268 * @param isAudio recording start with microphone
1269 * @param isVideo recording start with camera
1271 async RecordingDeviceEvents(nsString recordingStatus,
1277 async GraphicsError(nsCString aError);
1279 // Driver crash guards. aGuardType must be a member of CrashGuardType.
1280 sync BeginDriverCrashGuard(uint32_t aGuardType) returns (bool crashDetected);
1281 sync EndDriverCrashGuard(uint32_t aGuardType);
1283 async AddIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
1284 async RemoveIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
1287 * This message is only used on X11 platforms.
1289 * Send a dup of the plugin process's X socket to the parent
1290 * process. In theory, this scheme keeps the plugin's X resources
1291 * around until after both the plugin process shuts down *and* the
1292 * parent process closes the dup fd. This is used to prevent the
1293 * parent process from crashing on X errors if, e.g., the plugin
1294 * crashes *just before* a repaint and the parent process tries to
1295 * use the newly-invalid surface.
1297 async BackUpXResources(FileDescriptor aXSocketFd);
1299 async RequestAnonymousTemporaryFile(uint64_t aID);
1302 * Notifies the parent that the child needs no more ForceKill dump.
1304 [Priority=control] async NotifyShutdownSuccess();
1307 * Notifies the parent to continue shutting down after the child performs
1308 * its shutdown tasks.
1310 async FinishShutdown();
1312 async UpdateDropEffect(uint32_t aDragAction, uint32_t aDropEffect);
1315 * Initiates an asynchronous request for permission for the
1316 * provided principal.
1319 * The array of permissions to request.
1321 * The principal of the request.
1322 * @param aTopLevelPrincipal
1323 * The principal of the top level page the request comes from.
1325 * To identify which tab issues this request.
1327 * NOTE: The principal is untrusted in the parent process. Only
1328 * principals that can live in the content process should
1331 async PContentPermissionRequest(PermissionRequest[] aRequests,
1332 nullable nsIPrincipal aPrincipal,
1333 nullable nsIPrincipal aTopLevelPrincipal,
1334 bool aIsHandlingUserInput,
1335 bool aMaybeUnsafePermissionDelegate,
1339 * If the profiler is running when the process shuts down, this sends the
1340 * profile data collected so far.
1343 * This may contain an empty string (unknown issue), an error message
1344 * starting with '*', or a profile as a stringified JSON object.
1346 async ShutdownProfile(nsCString aProfile);
1349 * This sends any collected perf stats data on shutdown.
1351 async ShutdownPerfStats(nsCString aPerfStats);
1354 * Request graphics initialization information from the parent.
1356 sync GetGraphicsDeviceInitData()
1357 returns (ContentDeviceData aData);
1360 * Request a buffer containing the contents of the output color profile.
1361 * If set, this is the file pointed to by
1362 * gfx.color_management.display_profile, otherwise it contains a
1363 * platform-specific default
1365 sync GetOutputColorProfileData()
1366 returns (uint8_t[] aOutputColorProfileData);
1369 * A shared font list (see gfx/thebes/SharedFontList.*) contains a list
1370 * of shared-memory blocks that are used to store all the font list data.
1371 * The font list created in the parent process is the only one that can
1372 * create or store objects into the shared memory; content processes font
1373 * lists have read-only access to it.
1375 * To minimize the cost of record allocations, the shared font list
1376 * bump-allocates new objects that it adds to the shared memory blocks
1377 * (i.e. the records stored in the shared memory blocks are only ever
1378 * appended, and never freed except when the entire font list is
1381 * When initially created by the parent process, the font list may contain
1382 * nothing except a header, and the list of the system's installed font
1383 * family names. Additional data about the families (styled faces available
1384 * and character coverage) is appended to the font list during the session
1385 * as a given font is considered for use, because loading all data for all
1386 * installed fonts during startup is too expensive/slow.
1388 * During content process launch, a content process's first step in
1389 * gaining access to the font list is to call GetFontListShmBlock,
1390 * passing index zero in order to get access to the first block, which
1391 * contains the font list header and the list of font-family records
1392 * (which may be virtually all uninitialized at this time, containing
1393 * nothing but the family names). Once a content process determines a
1394 * font-family name it wants to use (e.g. from a CSS font-family list, or
1395 * from preferences), if that Family record has not yet been initialized,
1396 * it will call InitializeFamily (below) to have the parent process
1397 * populate Face records in the shared memory with the family's styles.
1398 * The content process can then pick the face with best style match from
1399 * the available faces according to the CSS font matching algorithm, load
1400 * its character map, then send the map to the parent process using
1401 * SetCharacterMap (so that the parent process can share the map with all
1402 * processes to avoid duplication of work).
1404 * At some point, as the parent process adds data to the font list, a new
1405 * shared-memory block will probably be needed. At that point the parent
1406 * will create a new block and append it to its share memory block list.
1407 * The new Block index will start to appear in Pointer records in the
1408 * shared memory, and the content process's can then fetch those other
1409 * blocks using this function as needed.
1411 * @param aGeneration
1412 * The font list has a Generation ID stored in its Header, and any time
1413 * the parent process needs to reinitialize the list (because of a change
1414 * in the available font repertoire) a new Generation ID is assigned.
1415 * Content processes pass the Generation of the list they're using in
1416 * all messages, so that the parent can recognize if they're out of date
1417 * and safely ignore such messages. (When the parent rebuilds the list,
1418 * it will notify all content processes, but they may still send a few
1419 * messages that relate to the obsolete list before they have processed
1420 * this notification.)
1422 * (Zero-based) index of the shared-memory block to be mapped.
1423 * In a typical case, there will be a handful of blocks altogether, so
1424 * each content process only needs to make this request a few times.
1426 * Handle that can be used to construct a SharedMemory that maps the
1427 * requested block of memory.
1428 * If aGeneration does not match the parent's font list generation ID, or
1429 * if requesting a block that does not exist (i.e. with aIndex greater
1430 * than or equal to the number of blocks actually in existence), returns
1433 * This is a sync message because the content process needs font data in
1434 * order to perform font-matching (e.g. during reflow), and cannot continue
1435 * until it has mapped the font-list memory.
1437 sync GetFontListShmBlock(uint32_t aGeneration, uint32_t aIndex)
1438 returns (SharedMemoryHandle aHandle);
1441 * Ask the parent to initialize a given font family, so that face metadata
1442 * will be available. Content processes will only call this for families
1443 * where the Face data has not yet been populated, so it will generally be
1444 * called no more than once per family. (It may not be needed at all, if
1445 * the parent process has already initialized the families that content
1448 * @param aGeneration
1449 * Font-list generation, so requests relating to an obsolete list can be
1450 * ignored (see comments for GetFontListShmBlock).
1451 * @param aFamilyIndex
1452 * The 0-based index of the Family within the font-list that a content
1453 * process needs to use.
1455 * If true, the parent should eagerly load character maps for the faces
1458 * This is a sync message because the content process cannot complete its
1459 * font-matching until the family is fully populated with Face records.
1460 * If we make it async, content processes will reflow using fallbacks,
1461 * and then have to reflow again once all the font information needed
1462 * becomes available.
1464 sync InitializeFamily(uint32_t aGeneration, uint32_t aFamilyIndex,
1468 * Record the character map of a given Face in the font list.
1470 * @param aGeneration
1471 * Font-list generation, so requests relating to an obsolete list can be
1472 * ignored (see comments for GetFontListShmBlock).
1474 * Font-list shared-memory "pointer" to the Face record to be updated.
1475 * A Pointer is a record of a shared-memory block index and an offset
1476 * within that block, which each process that maps the block can convert
1477 * into a real pointer in its address space.
1479 * The character coverage map of the face. (This will be stored as a
1480 * SharedBitSet record within the shared font list, and the Face record
1481 * will be updated to reference it.)
1483 async SetCharacterMap(uint32_t aGeneration, Pointer aFacePtr, gfxSparseBitSet aMap);
1486 * Ask the parent to set up the merged charmap for a family, to accelerate
1487 * future fallback searches.
1488 * aFamilyPtr may refer to an element of either the Families() or AliasFamilies().
1490 async SetupFamilyCharMap(uint32_t aGeneration, Pointer aFamilyPtr);
1493 * Ask the parent to try and complete the InitOtherFamilyNames task, because
1494 * we're trying to look up a localized font name. This is a sync method so that
1495 * the update will be available before the child continues reflow; however, it
1496 * is possible the task will have timed-out in the parent and not actually
1497 * completed during this call.
1499 * @param aGeneration
1500 * Font-list generation, so requests relating to an obsolete list can be
1501 * ignored (see comments for GetFontListShmBlock).
1503 * Parameter aDeferOtherFamilyNamesLoading to be passed to
1504 * gfxPlatformFontList::InitOtherFamilyNames, to determine whether name
1505 * loading should be deferred to a background task or run immediately.
1507 * Returns whether the font name loading process has completed.
1509 * TODO: This is currently a sync message but can probably be made async,
1510 * at the cost of an increased chance of some testcases failing because
1511 * they depend on lazily-loaded font names.
1513 sync InitOtherFamilyNames(uint32_t aGeneration, bool aDefer) returns (bool aLoaded);
1516 * Ask the parent to load all font character maps, as we need to do an
1517 * exhaustive font-fallback search. This is done asynchronously; when it
1518 * finishes, the parent will trigger global reflow so that font selection
1519 * is re-done in all content, making use of the newly-loaded cmaps.
1520 * Normally this will only happen once per browser session (unless the
1521 * font list is rebuilt due to installation/removal of system fonts).
1523 * @param aGeneration
1524 * Font-list generation, so requests relating to an obsolete list can be
1525 * ignored (see comments for GetFontListShmBlock).
1526 * @param aStartIndex
1527 * The family index to start from; the sender has determined that cmaps
1528 * up to this point are already loaded.
1530 async StartCmapLoading(uint32_t aGeneration, uint32_t aStartIndex);
1533 * Ask the parent for a specific hyphenation resource (identified by URI)
1534 * as a shared memory block.
1536 * This is a sync method because at the point where a content process finds
1537 * that it requires a particular hyphenation dictionary, this is blocking
1538 * reflow; making it async would require scheduling another reflow after
1539 * the resource is available, and a possible layout "jump" as line-breaks
1540 * change. Note that the content process retains a reference to each such
1541 * resource it requests, so it will only make this call once per locale for
1542 * which hyphenation data exists.
1545 * The URI (which currently must always point to an omnijar resource)
1546 * for the required hyphenation dictionary.
1548 * Returns the shmem handle to the resource (or an invalid shmem handle
1549 * in case of failure).
1551 * Returns the size in bytes of the resource.
1553 sync GetHyphDict(nullable nsIURI aURI) returns (SharedMemoryHandle aHandle, uint32_t aSize);
1555 async CreateWindow(PBrowser aThisTab,
1556 MaybeDiscardedBrowsingContext aParent,
1558 uint32_t aChromeFlags,
1561 bool aForWindowDotPrint,
1562 nullable nsIURI aURIToLoad,
1563 nsCString aFeatures,
1564 nullable nsIPrincipal aTriggeringPrincipal,
1565 nullable nsIContentSecurityPolicy aCsp,
1566 nullable nsIReferrerInfo aReferrerInfo,
1567 OriginAttributes aOriginAttributes)
1568 returns (CreatedWindowInfo window);
1570 async CreateWindowInDifferentProcess(
1572 MaybeDiscardedBrowsingContext aParent,
1573 uint32_t aChromeFlags,
1575 nullable nsIURI aURIToLoad,
1576 nsCString aFeatures,
1578 nullable nsIPrincipal aTriggeringPrincipal,
1579 nullable nsIContentSecurityPolicy aCsp,
1580 nullable nsIReferrerInfo aReferrerInfo,
1581 OriginAttributes aOriginAttributes);
1584 * Tell the parent that a decoder's' benchmark has been completed.
1585 * The result can then be stored in permanent storage.
1587 async NotifyBenchmarkResult(nsString aCodecName, uint32_t aDecodeFPS);
1590 * Notify `push-message` observers without data in the parent.
1592 async NotifyPushObservers(nsCString scope, nullable nsIPrincipal principal,
1593 nsString messageId);
1596 * Notify `push-message` observers with data in the parent.
1598 async NotifyPushObserversWithData(nsCString scope, nullable nsIPrincipal principal,
1599 nsString messageId, uint8_t[] data);
1602 * Notify `push-subscription-change` observers in the parent.
1604 async NotifyPushSubscriptionChangeObservers(nsCString scope,
1605 nullable nsIPrincipal principal);
1607 async GetFilesRequest(nsID aID, nsString aDirectory, bool aRecursiveFlag);
1608 async DeleteGetFilesRequest(nsID aID);
1610 async StoreAndBroadcastBlobURLRegistration(nsCString url, IPCBlob blob,
1611 nullable nsIPrincipal principal, nsCString aPartitionKey);
1613 async UnstoreAndBroadcastBlobURLUnregistration(nsCString url, nullable nsIPrincipal principal);
1616 * Messages for communicating child Glean data to the parent process
1618 async RecordPageLoadEvent(PageLoadExtra event);
1621 * Messages for communicating child Telemetry to the parent process
1623 async AccumulateChildHistograms(HistogramAccumulation[] accumulations);
1624 async AccumulateChildKeyedHistograms(KeyedHistogramAccumulation[] accumulations);
1625 async UpdateChildScalars(ScalarAction[] updates);
1626 async UpdateChildKeyedScalars(KeyedScalarAction[] updates);
1627 async RecordChildEvents(ChildEventData[] events);
1628 async RecordDiscardedData(DiscardedData data);
1630 async AddMemoryReport(MemoryReport aReport);
1632 async BHRThreadHang(HangDetails aHangDetails);
1635 * Adds a certificate exception for the given hostname and port.
1637 async AddCertException(nullable nsIX509Cert aCert, nsCString aHostName,
1638 int32_t aPort, OriginAttributes aOriginAttributes,
1640 returns (nsresult success);
1643 * Determines whether storage access can be granted automatically by the
1644 * storage access API without showing a user prompt.
1646 async AutomaticStorageAccessPermissionCanBeGranted(nullable nsIPrincipal aPrincipal)
1647 returns (bool success);
1650 * A 3rd party tracking origin (aTrackingOrigin) has received the permission
1651 * granted to have access to aGrantedOrigin when loaded by aParentWindowId.
1653 async StorageAccessPermissionGrantedForOrigin(uint64_t aTopLevelWindowId,
1654 MaybeDiscardedBrowsingContext aParentContext,
1655 nullable nsIPrincipal aTrackingPrincipal,
1656 nsCString aTrackingOrigin,
1658 StorageAccessPermissionGrantedReason? aReason,
1660 returns (bool unused);
1662 async CompleteAllowAccessFor(MaybeDiscardedBrowsingContext aParentContext,
1663 uint64_t aTopLevelWindowId,
1664 nullable nsIPrincipal aTrackingPrincipal,
1665 nsCString aTrackingOrigin,
1666 uint32_t aCookieBehavior,
1667 StorageAccessPermissionGrantedReason aReason)
1668 returns (StorageAccessPromptChoices? choice);
1670 async SetAllowStorageAccessRequestFlag(
1671 nullable nsIPrincipal aEmbeddingPrincipal,
1672 nullable nsIURI aEmbeddedOrigin)
1673 returns (bool success);
1675 async TestAllowStorageAccessRequestFlag(
1676 nullable nsIPrincipal aEmbeddedPrincipal,
1677 nullable nsIURI aEmbeddingOrigin)
1678 returns (bool success);
1680 async StoreUserInteractionAsPermission(nullable nsIPrincipal aPrincipal);
1682 async TestCookiePermissionDecided(MaybeDiscardedBrowsingContext aContext,
1683 nullable nsIPrincipal aPrincipal)
1684 returns (bool? allowed);
1686 async TestStorageAccessPermission(nullable nsIPrincipal aEmbeddingPrincipal,
1687 nsCString aEmbeddedOrigin)
1688 returns (bool? allowed);
1691 * When media element's controlled state changed in the content process, we
1692 * have to notify the chrome process in order to update the status of the
1693 * corresponding media controller, which is used to control all media in the
1694 * certain tab. We would use the browsing context to find the corresponding
1697 async NotifyMediaPlaybackChanged(MaybeDiscardedBrowsingContext aContext,
1698 MediaPlaybackState aState);
1701 * When media became audible or inaudible in content process, we have to
1702 * notify chrome process in order to which tab is audible.
1704 async NotifyMediaAudibleChanged(MaybeDiscardedBrowsingContext aContext,
1705 MediaAudibleState aState);
1708 * When media enabled or disabled the Picture-in-Picture mode, we have to
1709 * update that to the media controller in the chrome process.
1711 async NotifyPictureInPictureModeChanged(
1712 MaybeDiscardedBrowsingContext aContext, bool aEnabled);
1715 * This method is used to update media session's status when it's being
1716 * created or destroyed.
1718 async NotifyMediaSessionUpdated(MaybeDiscardedBrowsingContext aContext, bool aIsCreated);
1721 * This method is used to update media session's media metadata whenever its
1722 * metadata is being updated.
1724 async NotifyUpdateMediaMetadata(MaybeDiscardedBrowsingContext aContext,
1725 MediaMetadataBase? aMetadata);
1728 * This method is used to update media session's playback state whenever its
1729 * playback state is changed.
1731 async NotifyMediaSessionPlaybackStateChanged(
1732 MaybeDiscardedBrowsingContext aContext,
1733 MediaSessionPlaybackState aMetadata);
1736 * This method is used to update media session's supported media session
1737 * action when the action becomes supported or unsupported.
1739 async NotifyMediaSessionSupportedActionChanged(
1740 MaybeDiscardedBrowsingContext aContext,
1741 MediaSessionAction aAction,
1745 * This method is used to notify the media controller in chrome process that
1746 * the media element in the browsing context entered fullscreen.
1748 async NotifyMediaFullScreenState(
1749 MaybeDiscardedBrowsingContext aContext,
1750 bool aIsInFullScreen);
1753 * This method is used to update media session's position state whenever its
1754 * position state is being updated.
1756 async NotifyPositionStateChanged(
1757 MaybeDiscardedBrowsingContext aContext,
1758 PositionState aState);
1761 * This method will make canonical browsing context to update the count of
1762 * callers which want to keep the page from being suspended even if the page
1765 async AddOrRemovePageAwakeRequest(MaybeDiscardedBrowsingContext aContext,
1766 bool aShouldAddCount);
1770 * Due to sandboxing, a child process's UntrustedModulesProcessor cannot
1771 * obtain enough information about a DLL file to determine its
1772 * trustworthiness. This API asks the chrome process to perform that
1775 async GetModulesTrust(ModulePaths aModPaths, bool aRunAtNormalPriority)
1776 returns (ModulesMapResult? modMapResult);
1777 #endif // defined(XP_WIN)
1780 * Used to route shutdown diagnostic info from the content process
1781 * ServiceWorkers to the parent process' ServiceWorkerManager's
1782 * ServiceWorkerShutdownBlocker. (The only other actor chain available
1783 * for this would be very convoluted and create ordering problems).
1785 async ReportServiceWorkerShutdownProgress(uint32_t aShutdownStateId,
1786 Progress aProgress);
1789 * Whenever a document is updating the OrientationLock, we need to
1790 * reject the orientationPendingPromises in other processes.
1792 async AbortOtherOrientationPendingPromises(MaybeDiscardedBrowsingContext aContext);
1794 async HistoryReload(MaybeDiscardedBrowsingContext aContext, uint32_t aReloadFlags);
1796 async NotifyOnHistoryReload(MaybeDiscardedBrowsingContext aContext,
1798 returns (bool canReload, nsDocShellLoadState? loadState,
1799 bool? reloadActiveEntry);
1801 async HistoryCommit(MaybeDiscardedBrowsingContext aContext,
1802 uint64_t aLoadID, nsID aChangeID, uint32_t aLoadType,
1803 bool aPersist, bool aCloneEntryChildren,
1804 bool aChannelExpired, uint32_t aCacheKey);
1806 async HistoryGo(MaybeDiscardedBrowsingContext aContext, int32_t aOffset,
1807 uint64_t aHistoryEpoch, bool aRequireUserInteraction,
1808 bool aUserActivation) returns(int32_t? requestedIndex);
1810 async BlobURLDataRequest(nsCString aBlobURL,
1811 nullable nsIPrincipal aTriggeringPrincipal,
1812 nullable nsIPrincipal aLoadingPrincipal,
1813 OriginAttributes aOriginAttributes,
1814 uint64_t aInnerWindowId,
1815 nsCString aPartitionKey)
1816 returns (BlobURLDataRequestResult aResult);
1818 async SetActiveSessionHistoryEntry(MaybeDiscardedBrowsingContext context,
1819 nsPoint? previousScrollPosition,
1820 SessionHistoryInfo info, uint32_t loadType,
1821 uint32_t updatedCacheKey, nsID changeID);
1822 async ReplaceActiveSessionHistoryEntry(
1823 MaybeDiscardedBrowsingContext context, SessionHistoryInfo info);
1825 async RemoveDynEntriesFromActiveSessionHistoryEntry(
1826 MaybeDiscardedBrowsingContext aContext);
1828 async RemoveFromSessionHistory(
1829 MaybeDiscardedBrowsingContext aContext, nsID changeID);
1831 // Called when a nsDocShellLoadState which was received over IPC is
1832 // destroyed in the content process to clean up pending state left behind
1833 // tracking the load state in the parent process.
1834 [LazySend] async CleanupPendingLoadState(uint64_t aLoadIdentifier);
1837 async ScriptError(nsString message, nsString sourceName, nsString sourceLine,
1838 uint32_t lineNumber, uint32_t colNumber, uint32_t flags,
1839 nsCString category, bool privateWindow, uint64_t innerWindowId,
1840 bool fromChromeContext);
1843 * Used in fission to report timing data when the parent window is in
1844 * another process. Child frame will send data to its ContentParent which
1845 * will then identify the ContentParent for the innerWindowId and pass
1846 * the data to the correct process.
1847 * loadInfo is passed in order to enforce same-origin security checks
1848 * aData must be non-null.
1850 async ReportFrameTimingData(LoadInfoArgs loadInfo, nsString entryName,
1851 nsString initiatorType,
1852 UniquePtr<PerformanceTimingData> aData);
1854 async CommitBrowsingContextTransaction(MaybeDiscardedBrowsingContext aContext,
1855 BrowsingContextTransaction aTransaction,
1858 async AsyncMessage(nsString aMessage, ClonedMessageData aData);
1861 * Notify `push-subscription-modified` observers in the parent and child.
1863 async NotifyPushSubscriptionModifiedObservers(nsCString scope,
1864 nullable nsIPrincipal principal);
1867 * Send a Push error message to all service worker clients in the parent or
1870 async PushError(nsCString scope, nullable nsIPrincipal principal, nsString message,
1874 * Creates a new BrowsingContext, initialized with the values provided in
1875 * `BrowsingContextInitializer`.
1877 * This message may only be sent to the parent in limited situations. If the
1878 * new BrowsingContext has a parent window, it must be owned by the
1879 * embedding process, otherwise it must be owned by the opener, if set.
1881 [LazySend] async CreateBrowsingContext(uint64_t aGroupId, BrowsingContextInitializer aInit);
1884 * If aDoDiscard is true, discards the passed-in BrowsingContext. If the
1885 * BrowsingContext has already been discarded, this message does nothing.
1886 * If the receiver is the parent process, resolves when all content
1887 * processes have flagged the BrowsingContext as discarded, and if the
1888 * receiver is a child process, resolves when that child process has flagged
1889 * the BrowsingContext as discarded.
1891 async DiscardBrowsingContext(MaybeDiscardedBrowsingContext aContext, bool aDoDiscard)
1892 returns (uint64_t unused);
1894 async AdjustWindowFocus(MaybeDiscardedBrowsingContext aContext,
1895 bool aIsVisible, uint64_t aActionId);
1896 async WindowClose(MaybeDiscardedBrowsingContext aContext,
1897 bool aTrustedCaller);
1898 async WindowFocus(MaybeDiscardedBrowsingContext aContext,
1899 CallerType aCallerType, uint64_t aActionId);
1900 async WindowBlur(MaybeDiscardedBrowsingContext aContext,
1901 CallerType aCallerType);
1902 async RaiseWindow(MaybeDiscardedBrowsingContext aContext, CallerType aCallerType, uint64_t aActionId);
1903 async ClearFocus(MaybeDiscardedBrowsingContext aContext);
1904 async SetFocusedBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1905 async SetActiveBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1906 async UnsetActiveBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1907 async SetFocusedElement(MaybeDiscardedBrowsingContext aContext, bool aNeedsFocus);
1908 async FinalizeFocusOuter(MaybeDiscardedBrowsingContext aContext, bool aCanFocus,
1909 CallerType aCallerType);
1911 [LazySend] async InsertNewFocusActionId(uint64_t aActionId);
1912 async BlurToParent(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1913 MaybeDiscardedBrowsingContext aBrowsingContextToClear,
1914 MaybeDiscardedBrowsingContext aAncestorBrowsingContextToFocus,
1915 bool aIsLeavingDocument, bool aAdjustWidget,
1916 bool aBrowsingContextToClearHandled,
1917 bool aAncestorBrowsingContextToFocusHandled, uint64_t aActionId);
1919 async BlurToChild(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1920 MaybeDiscardedBrowsingContext aBrowsingContextToClear,
1921 MaybeDiscardedBrowsingContext aAncestorBrowsingContextToFocus,
1922 bool aIsLeavingDocument, bool aAdjustWidget, uint64_t aActionId);
1923 async SetupFocusedAndActive(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1924 uint64_t aActionIdForFocused,
1925 MaybeDiscardedBrowsingContext aActiveBrowsingContext,
1926 uint64_t aActionId);
1927 async ReviseActiveBrowsingContext(uint64_t aOldActionId,
1928 MaybeDiscardedBrowsingContext aActiveBrowsingContext,
1929 uint64_t aNewActionId);
1930 async ReviseFocusedBrowsingContext(uint64_t aOldActionId,
1931 MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1932 uint64_t aNewActionId);
1934 async MaybeExitFullscreen(MaybeDiscardedBrowsingContext aContext);
1935 async WindowPostMessage(MaybeDiscardedBrowsingContext aContext,
1936 ClonedOrErrorMessageData aMessage,
1937 PostMessageData aData);
1939 async CommitWindowContextTransaction(MaybeDiscardedWindowContext aContext,
1940 WindowContextTransaction aTransaction,
1944 // NOTE: These methods are only needed on the child, as the parent
1945 // WindowContext is managed using the PWindowGlobal actor's lifecycle.
1946 [LazySend] async CreateWindowContext(WindowContextInitializer aInit);
1947 async DiscardWindowContext(uint64_t aContextId) returns (bool unused);
1950 // Temporary (bug 1641989) conduit for Glean data in content processes.
1951 // Sent from time-to-time to limit the amount of data vulnerable to loss.
1952 // Buffer contains bincoded Rust structs.
1953 async FOGData(ByteBuf buf);
1956 // Temporary (bug 1641989) conduit for Glean data in content processes.
1957 // Tells the child to flush any pending data. Used in tests and ping
1958 // assembly. Buffer contains bincoded Rust structs.
1959 async FlushFOGData() returns (ByteBuf buf);
1962 async SetContainerFeaturePolicy(MaybeDiscardedBrowsingContext aContainerContext,
1963 nullable FeaturePolicy aContainerFeaturePolicy);
1965 // Obtain an icon from the system widget toolkit, in nsIconDecoder
1966 // format. Not supported (or needed) on all platforms; see the
1967 // implementation in ContentParent::RecvGetSystemIcon for details.
1968 async GetSystemIcon(nullable nsIURI aURI) returns (nsresult aResult, ByteBuf? aData);
1970 #ifdef FUZZING_SNAPSHOT
1971 // Used by the child process to signal that it is ready to start fuzzing.
1972 // This can in particular be used to wait for a particular event in a
1973 // test document before taking the snapshot and starting e.g. IPC fuzzing.
1974 async SignalFuzzingReady();