1 /* -*- tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 include protocol PBackgroundStarter;
8 include protocol PBrowser;
9 include protocol PClipboardReadRequest;
10 include protocol PClipboardWriteRequest;
11 include protocol PCompositorManager;
12 include protocol PContentPermissionRequest;
13 include protocol PCycleCollectWithLogs;
14 include protocol PDocumentChannel;
15 include protocol PExtensions;
16 include protocol PExternalHelperApp;
17 include protocol PHandlerService;
18 include protocol PHal;
19 include protocol PHeapSnapshotTempFileHelper;
20 include protocol PProcessHangMonitor;
21 include protocol PImageBridge;
22 include protocol PRemotePrintJob;
23 include protocol PMedia;
24 include protocol PNecko;
25 include protocol PStreamFilter;
26 include protocol PGMPContent;
27 include protocol PGMPService;
28 include protocol PGMP;
30 include protocol PSpeechSynthesis;
32 include protocol PTestShell;
33 include protocol PRemoteSpellcheckEngine;
34 include protocol PWebBrowserPersistDocument;
36 include protocol PWebrtcGlobal;
38 include protocol PWindowGlobal;
39 include protocol PURLClassifier;
40 include protocol PURLClassifierLocal;
41 include protocol PVRManager;
42 include protocol PRemoteDecoderManager;
43 include protocol PProfiler;
44 include protocol PScriptCache;
45 include protocol PSessionStorageObserver;
46 include protocol PBenchmarkStorage;
48 include WindowGlobalTypes;
51 include IPCTransferable;
52 include PPrintingTypes;
54 include ProtocolTypes;
55 include PBackgroundSharedTypes;
56 include PContentPermission;
57 include GraphicsMessages;
58 include MemoryReportTypes;
59 include ClientIPCTypes;
62 include NeckoChannelParams;
64 include LookAndFeelTypes;
66 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
67 include protocol PSandboxTesting;
70 include "ipc/MediaControlIPC.h";
71 include "mozilla/AntiTrackingIPCUtils.h";
72 include "mozilla/GfxMessageUtils.h";
73 include "mozilla/dom/BindingIPCUtils.h";
74 include "mozilla/dom/CSPMessageUtils.h";
75 include "mozilla/dom/DocShellMessageUtils.h";
76 include "mozilla/dom/FeaturePolicyUtils.h";
77 include "mozilla/dom/MediaSessionIPCUtils.h";
78 include "mozilla/dom/PageLoadEventUtils.h";
79 include "mozilla/dom/ReferrerInfoUtils.h";
80 include "mozilla/glean/GleanMetrics.h";
81 include "mozilla/ipc/ByteBufUtils.h";
82 include "mozilla/ipc/TransportSecurityInfoUtils.h";
83 include "mozilla/ipc/URIUtils.h";
84 include "mozilla/net/NeckoMessageUtils.h";
85 include "mozilla/PermissionDelegateIPCUtils.h";
87 [RefCounted] using class nsIDOMGeoPosition from "nsGeoPositionIPCSerialiser.h";
88 [RefCounted] using class nsIAlertNotification from "mozilla/AlertNotificationIPCSerializer.h";
90 using struct ChromePackage from "mozilla/chrome/RegistryMessageUtils.h";
91 using struct SubstitutionMapping from "mozilla/chrome/RegistryMessageUtils.h";
92 using struct OverrideMapping from "mozilla/chrome/RegistryMessageUtils.h";
93 using base::ProcessId from "base/process.h";
94 using struct IPC::Permission from "mozilla/net/NeckoMessageUtils.h";
95 using mozilla::dom::NativeThreadId from "mozilla/dom/NativeThreadId.h";
96 using mozilla::hal::ProcessPriority from "mozilla/HalTypes.h";
97 using mozilla::gfx::IntSize from "mozilla/gfx/2D.h";
98 using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h";
99 using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
100 using mozilla::dom::ContentParentId from "mozilla/dom/ipc/IdType.h";
101 using mozilla::EventMessage from "mozilla/EventForwards.h";
102 using mozilla::LayoutDeviceIntPoint from "Units.h";
103 using mozilla::ImagePoint from "Units.h";
104 using mozilla::ImageIntSize from "Units.h";
105 using mozilla::widget::ThemeChangeKind from "mozilla/widget/WidgetMessageUtils.h";
106 using class mozilla::dom::MessagePort from "mozilla/dom/MessagePort.h";
107 [MoveOnly=data] using class mozilla::dom::ipc::StructuredCloneData from "mozilla/dom/ipc/StructuredCloneData.h";
108 using mozilla::OriginAttributes from "mozilla/ipc/BackgroundUtils.h";
109 using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
110 using mozilla::layers::CompositorOptions from "mozilla/layers/CompositorOptions.h";
111 using mozilla::layers::LayersId from "mozilla/layers/LayersTypes.h";
112 using mozilla::Telemetry::HistogramAccumulation from "mozilla/TelemetryComms.h";
113 using mozilla::Telemetry::KeyedHistogramAccumulation from "mozilla/TelemetryComms.h";
114 using mozilla::Telemetry::ScalarAction from "mozilla/TelemetryComms.h";
115 using mozilla::Telemetry::KeyedScalarAction from "mozilla/TelemetryComms.h";
116 using mozilla::Telemetry::DynamicScalarDefinition from "mozilla/TelemetryComms.h";
117 using mozilla::Telemetry::ChildEventData from "mozilla/TelemetryComms.h";
120 [MoveOnly] using mozilla::UntrustedModulesData from "mozilla/UntrustedModulesData.h";
121 [MoveOnly] using mozilla::ModulePaths from "mozilla/UntrustedModulesData.h";
122 [MoveOnly] using mozilla::ModulesMapResult from "mozilla/UntrustedModulesData.h";
123 #endif // defined(XP_WIN)
125 using mozilla::Telemetry::DiscardedData from "mozilla/TelemetryComms.h";
126 using mozilla::glean::perf::PageLoadExtra from "mozilla/glean/GleanMetrics.h";
127 [MoveOnly] using mozilla::CrossProcessMutexHandle from "mozilla/ipc/CrossProcessMutex.h";
128 using mozilla::dom::MaybeDiscardedBrowsingContext from "mozilla/dom/BrowsingContext.h";
129 using mozilla::dom::BrowsingContextTransaction from "mozilla/dom/BrowsingContext.h";
130 using mozilla::dom::BrowsingContextInitializer from "mozilla/dom/BrowsingContext.h";
131 using mozilla::dom::PermitUnloadResult from "nsIDocumentViewer.h";
132 using mozilla::dom::MaybeDiscardedWindowContext from "mozilla/dom/WindowContext.h";
133 using mozilla::dom::WindowContextTransaction from "mozilla/dom/WindowContext.h";
134 [MoveOnly] using base::SharedMemoryHandle from "base/shared_memory.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";
163 using mozilla::dom::UserActivation::Modifiers from "mozilla/dom/UserActivation.h";
165 union ChromeRegistryItem
175 // SetXPCOMProcessAttributes passes an array of font data to the child,
176 // but each platform needs different details so we have platform-specific
177 // versions of the SystemFontListEntry type:
179 // Used on Android to pass the list of fonts on the device
180 // to the child process
181 struct SystemFontListEntry {
182 nsCString familyName;
185 uint32_t weightRange;
186 uint32_t stretchRange;
189 FontVisibility visibility;
191 #elif defined(XP_MACOSX) || defined(XP_IOS)
192 // Used on Mac OS X to pass the list of font families (not faces)
193 // from chrome to content processes.
194 // The entryType field distinguishes several types of font family
195 // record; see gfxMacPlatformFontList.h for values and meaning.
196 struct SystemFontListEntry {
197 nsCString familyName;
198 FontVisibility visibility;
202 // Used on Linux to pass list of font patterns from chrome to content.
203 // (Unused on Windows, but there needs to be a definition of the type.)
204 struct SystemFontListEntry {
210 #ifdef MOZ_WIDGET_GTK
211 struct SystemFontOptions {
212 int32_t antialias; // cairo_antialias_t
213 int32_t subpixelOrder; // cairo_subpixel_order_t
214 int32_t hintStyle; // cairo_hint_style_t
215 int32_t lcdFilter; // cairo_lcd_filter_t
219 struct SystemFontList {
220 SystemFontListEntry[] entries;
221 #ifdef MOZ_WIDGET_GTK
222 SystemFontOptions options;
226 union SystemParameterValue {
231 struct ClipboardCapabilities {
232 bool supportsSelectionClipboard;
233 bool supportsFindClipboard;
234 bool supportsSelectionCache;
237 union FileDescOrError {
242 struct DomainPolicyClone
245 nullable nsIURI[] blocklist;
246 nullable nsIURI[] allowlist;
247 nullable nsIURI[] superBlocklist;
248 nullable nsIURI[] superAllowlist;
251 struct AndroidSystemInfo
254 nsString manufacturer;
255 nsString release_version;
257 uint32_t sdk_version;
261 struct GetFilesResponseSuccess
266 struct GetFilesResponseFailure
271 union GetFilesResponseResult
273 GetFilesResponseSuccess;
274 GetFilesResponseFailure;
277 struct BlobURLRegistrationData
281 nullable nsIPrincipal principal;
282 nsCString partitionKey;
286 struct JSWindowActorEventDecl
296 struct JSWindowActorInfo
301 // True if `url` is for ESM.
302 // False if `url` is for JSM or nothing.
305 // This is to align with JSProcessActorInfo.
306 // This attribute isn't used for JSWindow Actors.
307 bool loadInDevToolsLoader;
309 // The module of the url.
312 JSWindowActorEventDecl[] events;
314 // Observer notifications this actor listens to.
315 nsCString[] observers;
317 nsCString[] remoteTypes;
318 nsString[] messageManagerGroups;
321 struct JSProcessActorInfo
323 // The name of the actor.
326 // True if `url` is for ESM.
327 // False if `url` is for JSM or nothing.
330 // True if the actor should be loaded in the distinct loader dedicated to DevTools.
331 bool loadInDevToolsLoader;
333 // The module of the url.
336 // Observer notifications this actor listens to.
337 nsCString[] observers;
338 nsCString[] remoteTypes;
347 struct GMPCapabilityData
351 GMPAPITags[] capabilities;
354 struct L10nFileSourceDescriptor {
356 nsCString metasource;
366 int32_t captivePortalState;
368 bool haveBidiKeyboards;
369 nsCString[] dictionaries;
370 ClipboardCapabilities clipboardCaps;
371 DomainPolicyClone domainPolicy;
372 nullable nsIURI userContentSheetURL;
373 GfxVarUpdate[] gfxNonDefaultVarUpdates;
374 ContentDeviceData contentDeviceData;
375 GfxInfoFeatureStatus[] gfxFeatureStatus;
376 nsCString[] appLocales;
377 nsCString[] requestedLocales;
378 L10nFileSourceDescriptor[] l10nFileSources;
379 DynamicScalarDefinition[] dynamicScalarDefs;
380 MetricMask perfStatsMask;
382 ResolverMode trrMode;
383 // This is the value of network.trr.mode and can be diffrent than trrMode.
384 ResolverMode trrModeFromPref;
387 struct VisitedQueryResult
393 struct StringBundleDescriptor
396 FileDescriptor mapFile;
400 struct IPCURLClassifierFeature
402 nsCString featureName;
404 nsCString exceptionHostList;
407 // Transport structure for Notifications API notifications
408 // (https://developer.mozilla.org/en-US/docs/Web/API/notification) instances
409 // used exclusively by the NotificationEvent PContent method.
410 struct NotificationEventData
412 nsCString originSuffix;
425 struct PostMessageData
427 MaybeDiscardedBrowsingContext source;
429 nsString targetOrigin;
430 nullable nsIURI targetOriginURI;
431 nullable nsIPrincipal callerPrincipal;
432 nullable nsIPrincipal subjectPrincipal;
433 nullable nsIURI callerURI;
434 bool isFromPrivateWindow;
435 nsCString scriptLocation;
436 uint64_t innerWindowId;
439 union SyncedContextInitializer
441 BrowsingContextInitializer;
442 WindowContextInitializer;
445 union BlobURLDataRequestResult
451 struct TextRecognitionQuad {
457 struct TextRecognitionResult {
458 TextRecognitionQuad[] quads;
461 union TextRecognitionResultOrError {
462 TextRecognitionResult;
469 SurfaceFormat format;
473 struct ClipboardReadRequest {
474 ManagedEndpoint<PClipboardReadRequestChild> childEndpoint;
475 nsCString[] availableTypes;
478 union ClipboardReadRequestOrError {
479 ClipboardReadRequest;
484 * The PContent protocol is a top-level protocol between the UI process
485 * and a content process. There is exactly one PContentParent/PContentChild pair
486 * for each content process.
488 [NestedUpTo=inside_cpow, NeedsOtherPid, ChildProc=Content]
489 sync protocol PContent
492 manages PClipboardReadRequest;
493 manages PClipboardWriteRequest;
494 manages PContentPermissionRequest;
495 manages PCycleCollectWithLogs;
497 manages PExternalHelperApp;
499 manages PHandlerService;
500 manages PHeapSnapshotTempFileHelper;
501 manages PRemotePrintJob;
505 manages PSpeechSynthesis;
508 manages PRemoteSpellcheckEngine;
509 manages PWebBrowserPersistDocument;
511 manages PWebrtcGlobal;
513 manages PURLClassifier;
514 manages PURLClassifierLocal;
515 manages PScriptCache;
516 manages PSessionStorageObserver;
517 manages PBenchmarkStorage;
519 // Depending on exactly how the new browser is being created, it might be
520 // created from either the child or parent process!
522 // The child creates the PBrowser as part of
523 // BrowserChild::BrowserFrameProvideWindow (which happens when the child's
524 // content calls window.open()), and the parent creates the PBrowser as part
525 // of ContentParent::CreateBrowser.
527 // When the parent constructs a PBrowser, the child trusts the attributes it
528 // receives from the parent. In that case, the context should be
529 // FrameIPCTabContext.
531 // When the child constructs a PBrowser, the parent doesn't trust the
532 // attributes it receives from the child. In this case, context must have
533 // type PopupIPCTabContext. The parent checks that if the opener is a
534 // browser element, the context is also for a browser element.
536 // If |sameTabGroupAs| is non-zero, the new tab should go in the same
537 // TabGroup as |sameTabGroupAs|. This parameter should always be zero
538 // for PBrowser messages sent from the child to the parent.
540 // Separate messages are used for the parent and child side constructors due
541 // to the differences in data and actor setup required.
543 // Keep the last 3 attributes in sync with GetProcessAttributes!
545 async ConstructPopupBrowser(ManagedEndpoint<PBrowserParent> browserEp,
546 ManagedEndpoint<PWindowGlobalParent> windowEp,
547 TabId tabId, IPCTabContext context,
548 WindowGlobalInit windowInit,
549 uint32_t chromeFlags);
551 // TODO: Do I need to make this return something to watch for completion?
552 // Guess we'll see how we end up triggering the actual print, for preview
553 // this should be enough...
554 async CloneDocumentTreeInto(MaybeDiscardedBrowsingContext aSourceBc,
555 MaybeDiscardedBrowsingContext aTargetBc,
556 PrintData aPrintData);
558 async UpdateRemotePrintSettings(MaybeDiscardedBrowsingContext aBc,
559 PrintData aPrintData);
564 async ConstructBrowser(ManagedEndpoint<PBrowserChild> browserEp,
565 ManagedEndpoint<PWindowGlobalChild> windowEp,
567 IPCTabContext context,
568 WindowGlobalInit windowInit,
569 uint32_t chromeFlags, ContentParentId cpId,
570 bool isForBrowser, bool isTopLevel);
573 // For parent->child, aBrowser must be non-null; aContext can
574 // be null to indicate the browser's current root document, or non-null
575 // to persist a subdocument. For child->parent, arguments are
576 // ignored and should be null.
577 async PWebBrowserPersistDocument(nullable PBrowser aBrowser,
578 MaybeDiscardedBrowsingContext aContext);
580 async RawMessage(JSActorMessageMeta aMetadata, ClonedMessageData? aData,
581 ClonedMessageData? aStack);
584 async InitGMPService(Endpoint<PGMPServiceChild> service);
585 async InitProcessHangMonitor(Endpoint<PProcessHangMonitorChild> hangMonitor);
586 async InitProfiler(Endpoint<PProfilerChild> aEndpoint);
588 // Give the content process its endpoints to the compositor.
590 Endpoint<PCompositorManagerChild> compositor,
591 Endpoint<PImageBridgeChild> imageBridge,
592 Endpoint<PVRManagerChild> vr,
593 Endpoint<PRemoteDecoderManagerChild> video,
594 uint32_t[] namespaces);
596 // Re-create the rendering stack using the given endpoints. This is sent
597 // after the compositor process has crashed. The new endpoints may be to a
598 // newly launched GPU process, or the compositor thread of the UI process.
599 async ReinitRendering(
600 Endpoint<PCompositorManagerChild> compositor,
601 Endpoint<PImageBridgeChild> bridge,
602 Endpoint<PVRManagerChild> vr,
603 Endpoint<PRemoteDecoderManagerChild> video,
604 uint32_t[] namespaces);
606 async NetworkLinkTypeChange(uint32_t type);
607 async SocketProcessCrashed();
609 // Re-create the rendering stack for a device reset.
610 async ReinitRenderingForDeviceReset();
613 * Enable system-level sandboxing features, if available. Can
614 * usually only be performed zero or one times. The child may
615 * abnormally exit if this fails; the details are OS-specific.
617 async SetProcessSandbox(FileDescriptor? aBroker);
619 async RequestMemoryReport(uint32_t generation,
621 bool minimizeMemoryUsage,
622 FileDescriptor? DMDFile)
623 returns (uint32_t aGeneration);
627 * Used by third-party modules telemetry (aka "untrusted modules" telemetry)
628 * to pull data from content processes.
630 async GetUntrustedModulesData() returns (UntrustedModulesData? data);
633 * This method is used to notifty a child process to start
634 * processing module loading events in UntrustedModulesProcessor.
635 * This should be called when the parent process has gone idle.
637 async UnblockUntrustedModulesThread();
638 #endif // defined(XP_WIN)
641 * Communication between the PuppetBidiKeyboard and the actual
642 * BidiKeyboard hosted by the parent
644 async BidiKeyboardNotify(bool isLangRTL, bool haveBidiKeyboards);
647 * Dump this process's GC and CC logs to the provided files.
649 * For documentation on the other args, see dumpGCAndCCLogsToFile in
650 * nsIMemoryInfoDumper.idl
652 async PCycleCollectWithLogs(bool dumpAllTraces,
653 FileDescriptor gcLog,
654 FileDescriptor ccLog);
658 async PScriptCache(FileDescOrError cacheFile, bool wantCacheData);
660 async RegisterChrome(ChromePackage[] packages, SubstitutionMapping[] substitutions,
661 OverrideMapping[] overrides, nsCString locale, bool reset);
662 async RegisterChromeItem(ChromeRegistryItem item);
664 async ClearImageCacheFromPrincipal(nullable nsIPrincipal aPrincipal);
666 async ClearImageCacheFromBaseDomain(nsCString aBaseDomain);
668 async ClearImageCache(bool privateLoader, bool chrome);
670 async ClearStyleSheetCache(nullable nsIPrincipal? aForPrincipal,
671 nsCString? aBaseDomain);
673 async SetOffline(bool offline);
674 async SetConnectivity(bool connectivity);
675 async SetCaptivePortalState(int32_t aState);
676 async SetTRRMode(ResolverMode aMode, ResolverMode aModeFromPref);
678 async NotifyVisited(VisitedQueryResult[] uri);
681 * Tell the child that the system theme has changed, and that a repaint is
684 async ThemeChanged(FullLookAndFeel lookAndFeelData, ThemeChangeKind aKind);
686 async PreferenceUpdate(Pref pref);
687 async VarUpdate(GfxVarUpdate var);
689 async UpdatePerfStatsCollectionMask(uint64_t aMask);
690 async CollectPerfStatsJSON() returns (nsCString aStats);
692 async CollectScrollingMetrics() returns (uint32_t pixelsScrolled, uint32_t scrollDurationMS);
694 async NotifyAlertsObserver(nsCString topic, nsString data);
696 async GeolocationUpdate(nullable nsIDOMGeoPosition aPosition);
698 async GeolocationError(uint16_t errorCode);
700 async UpdateDictionaryList(nsCString[] dictionaries);
702 async UpdateFontList(SystemFontList fontList);
705 * The shared font list has been updated by the parent, so child processes
706 * should globally reflow everything to pick up new character coverage etc.
707 * If aFullRebuild is true, child processes must discard and recreate
708 * their mappings to the shmem blocks, as those are no longer valid.
709 * This message has raised priority so that it will take precedence over
710 * vsync messages to the child.
712 [Priority=mediumhigh] async RebuildFontList(bool aFullRebuild);
715 * The shared font list has been modified, potentially adding matches
716 * for src:local() names that were previously not known, so content
717 * may need to be reflowed.
719 async FontListChanged();
722 * The font list or prefs have been updated in such a way that we might need
723 * to do a reflow and maybe reframe.
725 async ForceGlobalReflow(bool aNeedsReframe);
728 * A new shmem block has been added to the font list; the child process
729 * should map the new block and add to its index.
731 async FontListShmBlockAdded(uint32_t aGeneration, uint32_t aIndex,
732 SharedMemoryHandle aHandle);
734 async UpdateAppLocales(nsCString[] appLocales);
735 async UpdateRequestedLocales(nsCString[] requestedLocales);
738 * The system timezone has changed; the child process should ensure that
739 * calls to get the default timezone return the new value.
741 async SystemTimezoneChanged();
743 async UpdateL10nFileSources(L10nFileSourceDescriptor[] sources);
745 async RegisterStringBundles(StringBundleDescriptor[] stringBundles);
747 async UpdateSharedData(FileDescriptor mapFile, uint32_t aSize,
749 nsCString[] changedKeys);
751 // nsIPermissionManager messages
752 async AddPermission(Permission permission);
753 async RemoveAllPermissions();
755 async FlushMemory(nsString reason);
757 async ApplicationBackground();
758 async ApplicationForeground();
759 async GarbageCollect();
760 async CycleCollect();
761 async UnlinkGhosts();
764 * Start accessibility engine in content process.
766 async ActivateA11y();
769 * Shutdown accessibility engine in content process (if not in use).
771 async ShutdownA11y();
773 async AppInfo(nsCString version, nsCString buildID, nsCString name, nsCString UAName,
774 nsCString ID, nsCString vendor, nsCString sourceURL, nsCString updateURL);
777 * Send the remote type associated with the content process.
779 async RemoteType(nsCString aRemoteType, nsCString aProfile);
782 * Send BlobURLRegistrationData to child process.
784 async InitBlobURLs(BlobURLRegistrationData[] registrations);
787 * Send JS{Content, Window}ActorInfos to child process.
789 async InitJSActorInfos(JSProcessActorInfo[] aContentInfos, JSWindowActorInfo[] aWindowInfos);
792 * Unregister a previously registered JSWindowActor in the child process.
794 async UnregisterJSWindowActor(nsCString name);
797 * Unregister a previously registered JSProcessActor in the child process.
799 async UnregisterJSProcessActor(nsCString name);
801 async SetXPCOMProcessAttributes(XPCOMInitData xpcomInit,
802 StructuredCloneData initialData,
803 FullLookAndFeel lookAndFeeldata,
804 /* used on MacOSX/Linux/Android only: */
805 SystemFontList systemFontList,
806 SharedMemoryHandle? sharedUASheetHandle,
807 uintptr_t sharedUASheetAddress,
808 SharedMemoryHandle[] sharedFontListBlocks,
811 // Notify child that last-pb-context-exited notification was observed
812 async LastPrivateDocShellDestroyed();
814 async NotifyProcessPriorityChanged(ProcessPriority priority);
815 async MinimizeMemoryUsage();
818 * Used to manage nsIStyleSheetService across processes.
820 async LoadAndRegisterSheet(nullable nsIURI uri, uint32_t type);
821 async UnregisterSheet(nullable nsIURI uri, uint32_t type);
824 * Notify idle observers in the child
826 async NotifyIdleObserver(uint64_t observerId, nsCString topic, nsString str);
828 async InvokeDragSession(MaybeDiscardedWindowContext aSourceWindowContext,
829 MaybeDiscardedWindowContext aSourceTopWindowContext,
830 IPCTransferableData[] transfers, uint32_t action);
832 async UpdateDragSession(IPCTransferableData[] transfers, EventMessage message);
834 async EndDragSession(bool aDoneDrag, bool aUserCancelled,
835 LayoutDeviceIntPoint aDragEndPoint,
836 uint32_t aKeyModifiers,
837 uint32_t aDropEffect);
839 async DomainSetChanged(uint32_t aSetType, uint32_t aChangeType, nullable nsIURI aDomain);
842 * Notify the child that it will soon be asked to shutdown.
843 * This is sent with high priority right before the normal shutdown.
845 [Priority=control] async ShutdownConfirmedHP();
848 * Notify the child to shutdown. The child will in turn call FinishShutdown
849 * and let the parent close the channel.
853 async LoadProcessScript(nsString url);
856 * Requests a full native update of a native plugin child window. This is
857 * a Windows specific call.
859 async UpdateWindow(uintptr_t aChildId);
862 * Notify the child that cache is emptied.
864 async NotifyEmptyHTTPCache();
867 * Send a `push` event without data to a service worker in the child.
869 async Push(nsCString scope, nullable nsIPrincipal principal, nsString messageId);
872 * Send a `push` event with data to a service worker in the child.
874 async PushWithData(nsCString scope, nullable nsIPrincipal principal,
875 nsString messageId, uint8_t[] data);
878 * Send a `pushsubscriptionchange` event to a service worker in the child.
880 async PushSubscriptionChange(nsCString scope, nullable nsIPrincipal principal);
882 async GetFilesResponse(nsID aID, GetFilesResponseResult aResult);
884 async BlobURLRegistration(nsCString aURI, IPCBlob aBlob,
885 nullable nsIPrincipal aPrincipal, nsCString aPartitionKey);
887 async BlobURLUnregistration(nsCString aURI);
889 async GMPsChanged(GMPCapabilityData[] capabilities);
892 async ProvideAnonymousTemporaryFile(uint64_t aID, FileDescOrError aFD);
894 async SetPermissionsWithKey(nsCString aPermissionKey, Permission[] aPermissions);
896 async RefreshScreens(ScreenDetails[] aScreens);
898 async ShareCodeCoverageMutex(CrossProcessMutexHandle handle);
899 async FlushCodeCoverageCounters() returns (bool unused);
902 * IPC message to enable the input event queue on the main thread of the
905 async SetInputEventQueueEnabled();
908 * IPC message to flush the input event queue on the main thread of the
911 * When the ContentParent stops sending the input event with input priority,
912 * there may be some pending events in the input event queue and normal
913 * event queue. Here is a possible scenario.
915 * D: Enable the input priority event.
916 * E: Disable the input priority evnet.
919 * Normal Queue: R1 R2 R3
920 * Input Queue: II I2 I3
922 * To avoid the newly added normal events (e.g. R2, which may be an input
923 * event) preempt the pending input events (e.g. I1), or the newly added
924 * input events (e.g. I3) preempt the pending normal events (e.g. R2), we
925 * have to flush all pending events before enabling and disabling the input
928 * To flush the normal event queue and the input event queue, we use three
929 * IPC messages as the followings.
930 * FI: Flush the input queue.
931 * SI: Suspend the input queue.
932 * RI: Resume the input queue.
934 * Normal Queue: R1 FI RI R2 FI RI R3
935 * Input Queue: II SI I2 SI I3
937 * When the flush input request is processed before the other two requests,
938 * we consume all input events until the suspend request. After handling the
939 * suspend request, we stop consuming the input events until the resume
940 * request to make sure we consume all pending normal events.
942 * If we process the suspend request before the other two requests, we
943 * ignore the flush request and consume all pending normal events until the
946 async FlushInputEventQueue();
949 * IPC message to resume consuming the pending events in the input event
952 async ResumeInputEventQueue();
955 * IPC message to suspend consuming the pending events in the input event
958 [Priority=input] async SuspendInputEventQueue();
961 * IPC message to propagate dynamic scalar definitions, added after the
962 * content process is spawned, from the parent to the child.
963 * Dynamic scalar definitions added at the process startup are handled
964 * using the |TelemetryIPC::AddDynamicScalarDefinitions| functions.
966 async AddDynamicScalars(DynamicScalarDefinition[] definitions);
968 // This message is sent to content processes, and triggers the creation of a
969 // new HttpChannelChild that will be connected to the parent channel
970 // represented by registrarId.
971 // This is on PContent not PNecko, as PNecko may not be initialized yet.
972 // The returned loadInfo needs to be set on the channel - since the channel
973 // moved to a new process it now has different properties.
975 async CrossProcessRedirect(RedirectToRealChannelArgs args,
976 Endpoint<PStreamFilterParent>[] aEndpoint)
977 returns (nsresult rv);
980 * This method is used to notifty content process to start delayed autoplay
981 * media via browsing context.
983 async StartDelayedAutoplayMediaComponents(MaybeDiscardedBrowsingContext aContext);
986 * This method is used to dispatch MediaControlAction to content process in
987 * order to control media within a specific browsing context tree.
989 async UpdateMediaControlAction(MaybeDiscardedBrowsingContext aContext,
990 MediaControlAction aAction);
992 // Begin subscribing to a new BrowsingContextGroup, sending down the current
993 // value for every individual BrowsingContext.
994 async RegisterBrowsingContextGroup(uint64_t aGroupId, SyncedContextInitializer[] aInits);
996 // The BrowsingContextGroup has been destroyed in the parent process. The
997 // content process won't destroy the group until it receives this message or
1000 // When the content process receives this message, all contexts in the group
1001 // should have already been destroyed.
1002 async DestroyBrowsingContextGroup(uint64_t aGroupId);
1004 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
1005 // Initialize top-level actor for testing content process sandbox.
1006 async InitSandboxTesting(Endpoint<PSandboxTestingChild> aEndpoint);
1009 async LoadURI(MaybeDiscardedBrowsingContext aContext, nsDocShellLoadState aLoadState, bool aSetNavigating)
1010 returns (bool aSuccess);
1012 async InternalLoad(nsDocShellLoadState aLoadState);
1014 async DisplayLoadError(MaybeDiscardedBrowsingContext aContext, nsString aURI);
1016 async GoBack(MaybeDiscardedBrowsingContext aContext, int32_t? aCancelContentJSEpoch, bool aRequireUserInteraction, bool aUserActivation);
1017 async GoForward(MaybeDiscardedBrowsingContext aContext, int32_t? aCancelContentJSEpoch, bool aRequireUserInteraction, bool aUserActivation);
1018 async GoToIndex(MaybeDiscardedBrowsingContext aContext, int32_t aIndex, int32_t? aCancelContentJSEpoch, bool aUserActivation);
1019 async Reload(MaybeDiscardedBrowsingContext aContext, uint32_t aReloadFlags);
1020 async StopLoad(MaybeDiscardedBrowsingContext aContext, uint32_t aStopFlags);
1022 async OnAllowAccessFor(MaybeDiscardedBrowsingContext aParentContext,
1023 nsCString aTrackingOrigin,
1024 uint32_t aCookieBehavior,
1025 StorageAccessPermissionGrantedReason aReason);
1027 async OnContentBlockingDecision(MaybeDiscardedBrowsingContext aContext,
1028 BlockingDecision aReason,
1029 uint32_t aRejectedReason);
1032 * Abort orientationPendingPromises for documents in the child which
1033 * are part of a BrowsingContextGroup.
1035 async AbortOrientationPendingPromises(MaybeDiscardedBrowsingContext aContext);
1037 async HistoryCommitIndexAndLength(MaybeDiscardedBrowsingContext aContext,
1038 uint32_t aIndex, uint32_t aLength,
1041 async GetLayoutHistoryState(MaybeDiscardedBrowsingContext aContext)
1042 returns (nullable nsILayoutHistoryState aState, Wireframe? aWireframe);
1044 async DispatchLocationChangeEvent(MaybeDiscardedBrowsingContext aContext);
1046 // Dispatches a "beforeunload" event to each in-process content window in the
1047 // subtree beginning at `aStartingAt`, and returns the result as documented in
1048 // the `PermitUnloadResult` enum.
1049 async DispatchBeforeUnloadToSubtree(MaybeDiscardedBrowsingContext aStartingAt)
1050 returns (PermitUnloadResult result);
1052 // Update the cached list of codec supported in the given process.
1053 async UpdateMediaCodecsSupported(RemoteDecodeIn aLocation, MediaCodecsSupported aSupported);
1055 // Send the list of the supported mimetypes in the given process. GeckoView-specific
1056 async DecoderSupportedMimeTypes(nsCString[] supportedTypes);
1058 // Used to initialize the global variable in content processes with the
1059 // latched value in the parent process. See dom/LocalStorageCommon.h for more
1061 async InitNextGenLocalStorageEnabled(bool enabled);
1063 async PRemotePrintJob();
1066 async SynchronizeLayoutHistoryState(MaybeDiscardedBrowsingContext aContext,
1067 nullable nsILayoutHistoryState aState);
1069 async SessionHistoryEntryTitle(MaybeDiscardedBrowsingContext aContext,
1072 async SessionHistoryEntryScrollRestorationIsManual(MaybeDiscardedBrowsingContext aContext,
1074 async SessionHistoryEntryScrollPosition(MaybeDiscardedBrowsingContext aContext,
1075 int32_t aX, int32_t aY);
1077 async SessionHistoryEntryCacheKey(MaybeDiscardedBrowsingContext aContext,
1078 uint32_t aCacheKey);
1080 async SessionHistoryEntryStoreWindowNameInContiguousEntries(MaybeDiscardedBrowsingContext aContext,
1083 async SessionHistoryEntryWireframe(MaybeDiscardedBrowsingContext aContext,
1084 Wireframe aWireframe);
1086 async GetLoadingSessionHistoryInfoFromParent(MaybeDiscardedBrowsingContext aContext)
1087 returns (LoadingSessionHistoryInfo? aLoadingInfo);
1089 async RemoveFromBFCache(MaybeDiscardedBrowsingContext aContext);
1091 async InitBackground(Endpoint<PBackgroundStarterParent> aEndpoint);
1093 async CreateGMPService();
1095 async InitStreamFilter(uint64_t channelId, nsString addonId)
1096 returns (Endpoint<PStreamFilterChild> aEndpoint);
1098 async PRemoteSpellcheckEngine();
1100 async InitCrashReporter(NativeThreadId tid);
1102 sync IsSecureURI(nullable nsIURI aURI, OriginAttributes aOriginAttributes)
1103 returns (bool isSecureURI);
1105 async AccumulateMixedContentHSTS(nullable nsIURI aURI, bool aActive,
1106 OriginAttributes aOriginAttributes);
1108 [Nested=inside_cpow] async PHal();
1110 async PHeapSnapshotTempFileHelper();
1114 #ifdef MOZ_WEBSPEECH
1115 async PSpeechSynthesis();
1121 async PWebrtcGlobal();
1124 async CreateAudioIPCConnection() returns (FileDescOrError fd);
1126 sync PURLClassifier(nullable nsIPrincipal principal)
1127 returns (bool success);
1129 async PURLClassifierLocal(nullable nsIURI uri, IPCURLClassifierFeature[] features);
1131 async PSessionStorageObserver();
1133 async PBenchmarkStorage();
1135 // Services remoting
1137 async StartVisitedQueries(nullable nsIURI[] uri);
1138 async SetURITitle(nullable nsIURI uri, nsString title);
1140 async LoadURIExternal(nullable nsIURI uri,
1141 nullable nsIPrincipal triggeringPrincipal,
1142 nullable nsIPrincipal redirectPrincipal,
1143 MaybeDiscardedBrowsingContext browsingContext,
1144 bool wasExternallyTriggered,
1145 bool hasValidUserGestureActivation);
1146 async ExtProtocolChannelConnectParent(uint64_t registrarId);
1148 sync SyncMessage(nsString aMessage, ClonedMessageData aData)
1149 returns (StructuredCloneData[] retval);
1151 async ShowAlert(nullable nsIAlertNotification alert);
1153 async CloseAlert(nsString name, bool contextClosed);
1155 async DisableNotifications(nullable nsIPrincipal principal);
1157 async OpenNotificationSettings(nullable nsIPrincipal principal);
1159 async AddSecurityState(MaybeDiscardedWindowContext aContext, uint32_t aStateFlags);
1161 // Request that the ServiceWorkerManager in the parent process create a
1162 // notification "click" or "close" event and dispatch it on the relevant
1163 // ServiceWorker. This needs to happen because when a notification is
1164 // created it is tied to a specific content process and when the user clicks
1165 // on the notification, it will be that content process that is notified.
1166 // However, even if the ServiceWorker lives in that process (it may no
1167 // longer be in that process, or may have never lived there), the right/only
1168 // way to talk through the ServiceWorker is through the parent.
1170 // This happens on PContent because the ServiceWorkerManager lives on the
1171 // main thread and bouncing this off of PBackground would be silly and
1172 // complex. In the long run, the notification implementation will be
1173 // overhauled to directly process the notification click/close and directly
1174 // translate that to a ServiceWorker event.
1175 async NotificationEvent(nsString type, NotificationEventData data);
1177 // Creates a helper for forwarding data from an nsExternalAppHandler
1178 // running in the content process, to one running in the parent
1180 // Bug 1574372 aims to run nsExternalAppHandler entirely in the
1181 // parent so that we can remove this.
1183 // Serializes the uri, loadInfo, contentType, referrer, contentDisposition
1184 // headers and contentLength of the channel so that we can make them
1185 // available to the parent instance via a nsIChannel helper. Also
1186 // passes whether the original channel was an instance of nsIFileChannel.
1188 // aContext is the BrowsingContext that initiated the load, and created the
1191 // Pass true for aForceSave to always save this content to disk, regardless of
1192 // nsIMIMEInfo and other such influences.
1193 // Pass true for aShouldCloseWindow to specify that aContext was opened specifically
1194 // for this load, and should be closed once we've handled it.
1195 async PExternalHelperApp(nullable nsIURI uri,
1196 LoadInfoArgs loadInfoArgs,
1197 nsCString aMimeContentType,
1198 nsCString aContentDisposition,
1199 uint32_t aContentDispositionHint,
1200 nsString aContentDispositionFilename,
1202 int64_t aContentLength,
1203 bool aWasFileChannel,
1204 nullable nsIURI aReferrer,
1205 MaybeDiscardedBrowsingContext aContext,
1206 bool aShouldCloseWindow);
1208 async PHandlerService();
1210 async AddGeolocationListener(bool highAccuracy);
1211 async RemoveGeolocationListener();
1212 async SetGeolocationHigherAccuracy(bool enable);
1214 async ConsoleMessage(nsString message);
1215 async ScriptErrorWithStack(nsString message, nsString sourceName, nsString sourceLine,
1216 uint32_t lineNumber, uint32_t colNumber, uint32_t flags,
1217 nsCString category, bool privateWindow,
1218 bool fromChromeContext, ClonedMessageData stack);
1220 // Places the items within dataTransfer on the clipboard.
1221 async SetClipboard(IPCTransferable aTransferable,
1222 int32_t aWhichClipboard);
1224 // Given a list of supported types, returns the clipboard data for the
1225 // first type that matches.
1226 // aRequestingWindowContext is the window that is requesting the clipboard,
1227 // which is used for content analysis.
1228 sync GetClipboard(nsCString[] aTypes, int32_t aWhichClipboard,
1229 MaybeDiscardedWindowContext aRequestingWindowContext)
1230 returns (IPCTransferableData transferableData);
1232 // Requests getting data from clipboard.
1233 async GetClipboardAsync(nsCString[] aTypes, int32_t aWhichClipboard,
1234 MaybeDiscardedWindowContext aRequestingWindowContext,
1235 nsIPrincipal aRequestingPrincipal)
1236 returns (ClipboardReadRequestOrError aClipboardReadRequestOrError);
1238 // Requests getting data from clipboard.
1239 sync GetClipboardDataSnapshotSync(nsCString[] aTypes, int32_t aWhichClipboard,
1240 MaybeDiscardedWindowContext aRequestingWindowContext)
1241 returns (ClipboardReadRequestOrError aClipboardReadRequestOrError);
1243 // Clears the clipboard.
1244 async EmptyClipboard(int32_t aWhichClipboard);
1246 // Returns true if data of one of the specified types is on the clipboard.
1247 sync ClipboardHasType(nsCString[] aTypes, int32_t aWhichClipboard)
1248 returns (bool hasType);
1251 * Notify the parent that the child has started a clipboard write request,
1252 * and that the data will be sent over another IPC message once it is ready.
1253 * @param aClipboardType
1254 * The clipboard type defined in nsIClipboard.
1256 async PClipboardWriteRequest(int32_t aClipboardType);
1258 sync GetIconForExtension(nsCString aFileExt, uint32_t aIconSize)
1259 returns (uint8_t[] bits);
1261 // Tell the parent that the child has gone idle for the first time.
1264 async CopyFavicon(nullable nsIURI oldURI, nullable nsIURI newURI, bool isPrivate);
1266 async FindImageText(IPCImage image, nsCString[] languages)
1267 returns (TextRecognitionResultOrError result);
1270 async GraphicsError(nsCString aError);
1272 // Driver crash guards. aGuardType must be a member of CrashGuardType.
1273 sync BeginDriverCrashGuard(uint32_t aGuardType) returns (bool crashDetected);
1274 sync EndDriverCrashGuard(uint32_t aGuardType);
1276 async AddIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
1277 async RemoveIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
1280 * This message is only used on X11 platforms.
1282 * Send a dup of the plugin process's X socket to the parent
1283 * process. In theory, this scheme keeps the plugin's X resources
1284 * around until after both the plugin process shuts down *and* the
1285 * parent process closes the dup fd. This is used to prevent the
1286 * parent process from crashing on X errors if, e.g., the plugin
1287 * crashes *just before* a repaint and the parent process tries to
1288 * use the newly-invalid surface.
1290 async BackUpXResources(FileDescriptor aXSocketFd);
1292 async RequestAnonymousTemporaryFile(uint64_t aID);
1295 * Notifies the parent that the child needs no more ForceKill dump.
1297 [Priority=control] async NotifyShutdownSuccess();
1300 * Notifies the parent to continue shutting down after the child performs
1301 * its shutdown tasks.
1303 async FinishShutdown();
1305 async UpdateDropEffect(uint32_t aDragAction, uint32_t aDropEffect);
1308 * Initiates an asynchronous request for permission for the
1309 * provided principal.
1312 * The array of permissions to request.
1314 * The principal of the request.
1315 * @param aTopLevelPrincipal
1316 * The principal of the top level page the request comes from.
1318 * To identify which tab issues this request.
1320 * NOTE: The principal is untrusted in the parent process. Only
1321 * principals that can live in the content process should
1324 async PContentPermissionRequest(PermissionRequest[] aRequests,
1325 nullable nsIPrincipal aPrincipal,
1326 nullable nsIPrincipal aTopLevelPrincipal,
1327 bool aIsHandlingUserInput,
1328 bool aMaybeUnsafePermissionDelegate,
1332 * If the profiler is running when the process shuts down, this sends the
1333 * profile data collected so far.
1336 * This may contain an empty string (unknown issue), an error message
1337 * starting with '*', or a profile as a stringified JSON object.
1339 async ShutdownProfile(nsCString aProfile);
1342 * This sends any collected perf stats data on shutdown.
1344 async ShutdownPerfStats(nsCString aPerfStats);
1347 * A shared font list (see gfx/thebes/SharedFontList.*) contains a list
1348 * of shared-memory blocks that are used to store all the font list data.
1349 * The font list created in the parent process is the only one that can
1350 * create or store objects into the shared memory; content processes font
1351 * lists have read-only access to it.
1353 * To minimize the cost of record allocations, the shared font list
1354 * bump-allocates new objects that it adds to the shared memory blocks
1355 * (i.e. the records stored in the shared memory blocks are only ever
1356 * appended, and never freed except when the entire font list is
1359 * When initially created by the parent process, the font list may contain
1360 * nothing except a header, and the list of the system's installed font
1361 * family names. Additional data about the families (styled faces available
1362 * and character coverage) is appended to the font list during the session
1363 * as a given font is considered for use, because loading all data for all
1364 * installed fonts during startup is too expensive/slow.
1366 * During content process launch, a content process's first step in
1367 * gaining access to the font list is to call GetFontListShmBlock,
1368 * passing index zero in order to get access to the first block, which
1369 * contains the font list header and the list of font-family records
1370 * (which may be virtually all uninitialized at this time, containing
1371 * nothing but the family names). Once a content process determines a
1372 * font-family name it wants to use (e.g. from a CSS font-family list, or
1373 * from preferences), if that Family record has not yet been initialized,
1374 * it will call InitializeFamily (below) to have the parent process
1375 * populate Face records in the shared memory with the family's styles.
1376 * The content process can then pick the face with best style match from
1377 * the available faces according to the CSS font matching algorithm, load
1378 * its character map, then send the map to the parent process using
1379 * SetCharacterMap (so that the parent process can share the map with all
1380 * processes to avoid duplication of work).
1382 * At some point, as the parent process adds data to the font list, a new
1383 * shared-memory block will probably be needed. At that point the parent
1384 * will create a new block and append it to its share memory block list.
1385 * The new Block index will start to appear in Pointer records in the
1386 * shared memory, and the content process's can then fetch those other
1387 * blocks using this function as needed.
1389 * @param aGeneration
1390 * The font list has a Generation ID stored in its Header, and any time
1391 * the parent process needs to reinitialize the list (because of a change
1392 * in the available font repertoire) a new Generation ID is assigned.
1393 * Content processes pass the Generation of the list they're using in
1394 * all messages, so that the parent can recognize if they're out of date
1395 * and safely ignore such messages. (When the parent rebuilds the list,
1396 * it will notify all content processes, but they may still send a few
1397 * messages that relate to the obsolete list before they have processed
1398 * this notification.)
1400 * (Zero-based) index of the shared-memory block to be mapped.
1401 * In a typical case, there will be a handful of blocks altogether, so
1402 * each content process only needs to make this request a few times.
1404 * Handle that can be used to construct a SharedMemory that maps the
1405 * requested block of memory.
1406 * If aGeneration does not match the parent's font list generation ID, or
1407 * if requesting a block that does not exist (i.e. with aIndex greater
1408 * than or equal to the number of blocks actually in existence), returns
1411 * This is a sync message because the content process needs font data in
1412 * order to perform font-matching (e.g. during reflow), and cannot continue
1413 * until it has mapped the font-list memory.
1415 sync GetFontListShmBlock(uint32_t aGeneration, uint32_t aIndex)
1416 returns (SharedMemoryHandle aHandle);
1419 * Ask the parent to initialize a given font family, so that face metadata
1420 * will be available. Content processes will only call this for families
1421 * where the Face data has not yet been populated, so it will generally be
1422 * called no more than once per family. (It may not be needed at all, if
1423 * the parent process has already initialized the families that content
1426 * @param aGeneration
1427 * Font-list generation, so requests relating to an obsolete list can be
1428 * ignored (see comments for GetFontListShmBlock).
1429 * @param aFamilyIndex
1430 * The 0-based index of the Family within the font-list that a content
1431 * process needs to use.
1433 * If true, the parent should eagerly load character maps for the faces
1436 * This is a sync message because the content process cannot complete its
1437 * font-matching until the family is fully populated with Face records.
1438 * If we make it async, content processes will reflow using fallbacks,
1439 * and then have to reflow again once all the font information needed
1440 * becomes available.
1442 sync InitializeFamily(uint32_t aGeneration, uint32_t aFamilyIndex,
1446 * Record the character map of a given Face in the font list.
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 * Index of the font family in the font list (see aAlias for which list).
1454 * Whether aFamilyIndex refers to the Families() or AliasFamilies() list.
1456 * Index of the face within the family's Faces() list.
1458 * The character coverage map of the face. (This will be stored as a
1459 * SharedBitSet record within the shared font list, and the Face record
1460 * will be updated to reference it.)
1462 async SetCharacterMap(uint32_t aGeneration, uint32_t aFamilyIndex, bool aAlias,
1463 uint32_t aFaceIndex, gfxSparseBitSet aMap);
1466 * Ask the parent to set up the merged charmap for a family, to accelerate
1467 * future fallback searches.
1468 * aFamilyIndex may refer to an element in either Families() or AliasFamilies(),
1469 * with aAlias determining which.
1471 async SetupFamilyCharMap(uint32_t aGeneration, uint32_t aFamilyIndex, bool aAlias);
1474 * Ask the parent to try and complete the InitOtherFamilyNames task, because
1475 * we're trying to look up a localized font name. This is a sync method so that
1476 * the update will be available before the child continues reflow; however, it
1477 * is possible the task will have timed-out in the parent and not actually
1478 * completed during this call.
1480 * @param aGeneration
1481 * Font-list generation, so requests relating to an obsolete list can be
1482 * ignored (see comments for GetFontListShmBlock).
1484 * Parameter aDeferOtherFamilyNamesLoading to be passed to
1485 * gfxPlatformFontList::InitOtherFamilyNames, to determine whether name
1486 * loading should be deferred to a background task or run immediately.
1488 * Returns whether the font name loading process has completed.
1490 * TODO: This is currently a sync message but can probably be made async,
1491 * at the cost of an increased chance of some testcases failing because
1492 * they depend on lazily-loaded font names.
1494 sync InitOtherFamilyNames(uint32_t aGeneration, bool aDefer) returns (bool aLoaded);
1497 * Ask the parent to load all font character maps, as we need to do an
1498 * exhaustive font-fallback search. This is done asynchronously; when it
1499 * finishes, the parent will trigger global reflow so that font selection
1500 * is re-done in all content, making use of the newly-loaded cmaps.
1501 * Normally this will only happen once per browser session (unless the
1502 * font list is rebuilt due to installation/removal of system fonts).
1504 * @param aGeneration
1505 * Font-list generation, so requests relating to an obsolete list can be
1506 * ignored (see comments for GetFontListShmBlock).
1507 * @param aStartIndex
1508 * The family index to start from; the sender has determined that cmaps
1509 * up to this point are already loaded.
1511 async StartCmapLoading(uint32_t aGeneration, uint32_t aStartIndex);
1514 * Ask the parent for a specific hyphenation resource (identified by URI)
1515 * as a shared memory block.
1517 * This is a sync method because at the point where a content process finds
1518 * that it requires a particular hyphenation dictionary, this is blocking
1519 * reflow; making it async would require scheduling another reflow after
1520 * the resource is available, and a possible layout "jump" as line-breaks
1521 * change. Note that the content process retains a reference to each such
1522 * resource it requests, so it will only make this call once per locale for
1523 * which hyphenation data exists.
1526 * The URI (which currently must always point to an omnijar resource)
1527 * for the required hyphenation dictionary.
1529 * Returns the shmem handle to the resource (or an invalid shmem handle
1530 * in case of failure).
1532 * Returns the size in bytes of the resource.
1534 sync GetHyphDict(nullable nsIURI aURI) returns (SharedMemoryHandle aHandle, uint32_t aSize);
1536 async CreateWindow(PBrowser aThisTab,
1537 MaybeDiscardedBrowsingContext aParent,
1539 uint32_t aChromeFlags,
1542 bool aForWindowDotPrint,
1543 nullable nsIURI aURIToLoad,
1544 nsCString aFeatures,
1545 Modifiers aModifiers,
1546 nullable nsIPrincipal aTriggeringPrincipal,
1547 nullable nsIContentSecurityPolicy aCsp,
1548 nullable nsIReferrerInfo aReferrerInfo,
1549 OriginAttributes aOriginAttributes)
1550 returns (CreatedWindowInfo window);
1552 async CreateWindowInDifferentProcess(
1554 MaybeDiscardedBrowsingContext aParent,
1555 uint32_t aChromeFlags,
1557 nullable nsIURI aURIToLoad,
1558 nsCString aFeatures,
1559 Modifiers aModifiers,
1561 nullable nsIPrincipal aTriggeringPrincipal,
1562 nullable nsIContentSecurityPolicy aCsp,
1563 nullable nsIReferrerInfo aReferrerInfo,
1564 OriginAttributes aOriginAttributes);
1567 * Tell the parent that a decoder's' benchmark has been completed.
1568 * The result can then be stored in permanent storage.
1570 async NotifyBenchmarkResult(nsString aCodecName, uint32_t aDecodeFPS);
1573 * Notify `push-message` observers without data in the parent.
1575 async NotifyPushObservers(nsCString scope, nullable nsIPrincipal principal,
1576 nsString messageId);
1579 * Notify `push-message` observers with data in the parent.
1581 async NotifyPushObserversWithData(nsCString scope, nullable nsIPrincipal principal,
1582 nsString messageId, uint8_t[] data);
1585 * Notify `push-subscription-change` observers in the parent.
1587 async NotifyPushSubscriptionChangeObservers(nsCString scope,
1588 nullable nsIPrincipal principal);
1590 async GetFilesRequest(nsID aID, nsString aDirectory, bool aRecursiveFlag);
1591 async DeleteGetFilesRequest(nsID aID);
1593 async StoreAndBroadcastBlobURLRegistration(nsCString url, IPCBlob blob,
1594 nullable nsIPrincipal principal, nsCString aPartitionKey);
1596 async UnstoreAndBroadcastBlobURLUnregistration(nsCString url, nullable nsIPrincipal principal);
1599 * Messages for communicating child Glean data to the parent process
1601 async RecordPageLoadEvent(PageLoadExtra event);
1604 * Messages for communicating child Telemetry to the parent process
1606 async AccumulateChildHistograms(HistogramAccumulation[] accumulations);
1607 async AccumulateChildKeyedHistograms(KeyedHistogramAccumulation[] accumulations);
1608 async UpdateChildScalars(ScalarAction[] updates);
1609 async UpdateChildKeyedScalars(KeyedScalarAction[] updates);
1610 async RecordChildEvents(ChildEventData[] events);
1611 async RecordDiscardedData(DiscardedData data);
1613 async AddMemoryReport(MemoryReport aReport);
1615 async BHRThreadHang(HangDetails aHangDetails);
1618 * Adds a certificate exception for the given hostname and port.
1620 async AddCertException(nullable nsIX509Cert aCert, nsCString aHostName,
1621 int32_t aPort, OriginAttributes aOriginAttributes,
1623 returns (nsresult success);
1626 * Determines whether storage access can be granted automatically by the
1627 * storage access API without showing a user prompt.
1629 async AutomaticStorageAccessPermissionCanBeGranted(nullable nsIPrincipal aPrincipal)
1630 returns (bool success);
1633 * A 3rd party tracking origin (aTrackingOrigin) has received the permission
1634 * granted to have access to aGrantedOrigin when loaded by aParentWindowId.
1636 async StorageAccessPermissionGrantedForOrigin(uint64_t aTopLevelWindowId,
1637 MaybeDiscardedBrowsingContext aParentContext,
1638 nullable nsIPrincipal aTrackingPrincipal,
1639 nsCString aTrackingOrigin,
1641 StorageAccessPermissionGrantedReason? aReason,
1643 returns (bool unused);
1645 async CompleteAllowAccessFor(MaybeDiscardedBrowsingContext aParentContext,
1646 uint64_t aTopLevelWindowId,
1647 nullable nsIPrincipal aTrackingPrincipal,
1648 nsCString aTrackingOrigin,
1649 uint32_t aCookieBehavior,
1650 StorageAccessPermissionGrantedReason aReason)
1651 returns (StorageAccessPromptChoices? choice);
1653 async SetAllowStorageAccessRequestFlag(
1654 nullable nsIPrincipal aEmbeddingPrincipal,
1655 nullable nsIURI aEmbeddedOrigin)
1656 returns (bool success);
1658 async TestAllowStorageAccessRequestFlag(
1659 nullable nsIPrincipal aEmbeddedPrincipal,
1660 nullable nsIURI aEmbeddingOrigin)
1661 returns (bool success);
1663 async StoreUserInteractionAsPermission(nullable nsIPrincipal aPrincipal);
1665 async TestCookiePermissionDecided(MaybeDiscardedBrowsingContext aContext,
1666 nullable nsIPrincipal aPrincipal)
1667 returns (bool? allowed);
1669 async TestStorageAccessPermission(nullable nsIPrincipal aEmbeddingPrincipal,
1670 nsCString aEmbeddedOrigin)
1671 returns (bool? allowed);
1674 * When media element's controlled state changed in the content process, we
1675 * have to notify the chrome process in order to update the status of the
1676 * corresponding media controller, which is used to control all media in the
1677 * certain tab. We would use the browsing context to find the corresponding
1680 async NotifyMediaPlaybackChanged(MaybeDiscardedBrowsingContext aContext,
1681 MediaPlaybackState aState);
1684 * When media became audible or inaudible in content process, we have to
1685 * notify chrome process in order to which tab is audible.
1687 async NotifyMediaAudibleChanged(MaybeDiscardedBrowsingContext aContext,
1688 MediaAudibleState aState);
1691 * When media enabled or disabled the Picture-in-Picture mode, we have to
1692 * update that to the media controller in the chrome process.
1694 async NotifyPictureInPictureModeChanged(
1695 MaybeDiscardedBrowsingContext aContext, bool aEnabled);
1698 * This method is used to update media session's status when it's being
1699 * created or destroyed.
1701 async NotifyMediaSessionUpdated(MaybeDiscardedBrowsingContext aContext, bool aIsCreated);
1704 * This method is used to update media session's media metadata whenever its
1705 * metadata is being updated.
1707 async NotifyUpdateMediaMetadata(MaybeDiscardedBrowsingContext aContext,
1708 MediaMetadataBase? aMetadata);
1711 * This method is used to update media session's playback state whenever its
1712 * playback state is changed.
1714 async NotifyMediaSessionPlaybackStateChanged(
1715 MaybeDiscardedBrowsingContext aContext,
1716 MediaSessionPlaybackState aMetadata);
1719 * This method is used to update media session's supported media session
1720 * action when the action becomes supported or unsupported.
1722 async NotifyMediaSessionSupportedActionChanged(
1723 MaybeDiscardedBrowsingContext aContext,
1724 MediaSessionAction aAction,
1728 * This method is used to notify the media controller in chrome process that
1729 * the media element in the browsing context entered fullscreen.
1731 async NotifyMediaFullScreenState(
1732 MaybeDiscardedBrowsingContext aContext,
1733 bool aIsInFullScreen);
1736 * This method is used to update media session's position state whenever its
1737 * position state is being updated.
1739 async NotifyPositionStateChanged(
1740 MaybeDiscardedBrowsingContext aContext,
1741 PositionState? aState);
1744 * This method will make canonical browsing context to update the count of
1745 * callers which want to keep the page from being suspended even if the page
1748 async AddOrRemovePageAwakeRequest(MaybeDiscardedBrowsingContext aContext,
1749 bool aShouldAddCount);
1753 * Due to sandboxing, a child process's UntrustedModulesProcessor cannot
1754 * obtain enough information about a DLL file to determine its
1755 * trustworthiness. This API asks the chrome process to perform that
1758 async GetModulesTrust(ModulePaths aModPaths, bool aRunAtNormalPriority)
1759 returns (ModulesMapResult? modMapResult);
1760 #endif // defined(XP_WIN)
1763 * Used to route shutdown diagnostic info from the content process
1764 * ServiceWorkers to the parent process' ServiceWorkerManager's
1765 * ServiceWorkerShutdownBlocker. (The only other actor chain available
1766 * for this would be very convoluted and create ordering problems).
1768 async ReportServiceWorkerShutdownProgress(uint32_t aShutdownStateId,
1769 Progress aProgress);
1772 * Whenever a document is updating the OrientationLock, we need to
1773 * reject the orientationPendingPromises in other processes.
1775 async AbortOtherOrientationPendingPromises(MaybeDiscardedBrowsingContext aContext);
1777 async HistoryReload(MaybeDiscardedBrowsingContext aContext, uint32_t aReloadFlags);
1779 async NotifyOnHistoryReload(MaybeDiscardedBrowsingContext aContext,
1781 returns (bool canReload, nsDocShellLoadState? loadState,
1782 bool? reloadActiveEntry);
1784 async HistoryCommit(MaybeDiscardedBrowsingContext aContext,
1785 uint64_t aLoadID, nsID aChangeID, uint32_t aLoadType,
1786 bool aPersist, bool aCloneEntryChildren,
1787 bool aChannelExpired, uint32_t aCacheKey);
1789 async HistoryGo(MaybeDiscardedBrowsingContext aContext, int32_t aOffset,
1790 uint64_t aHistoryEpoch, bool aRequireUserInteraction,
1791 bool aUserActivation) returns(int32_t? requestedIndex);
1793 async BlobURLDataRequest(nsCString aBlobURL,
1794 nullable nsIPrincipal aTriggeringPrincipal,
1795 nullable nsIPrincipal aLoadingPrincipal,
1796 OriginAttributes aOriginAttributes,
1797 uint64_t aInnerWindowId,
1798 nsCString aPartitionKey)
1799 returns (BlobURLDataRequestResult aResult);
1801 async SetActiveSessionHistoryEntry(MaybeDiscardedBrowsingContext context,
1802 nsPoint? previousScrollPosition,
1803 SessionHistoryInfo info, uint32_t loadType,
1804 uint32_t updatedCacheKey, nsID changeID);
1805 async ReplaceActiveSessionHistoryEntry(
1806 MaybeDiscardedBrowsingContext context, SessionHistoryInfo info);
1808 async RemoveDynEntriesFromActiveSessionHistoryEntry(
1809 MaybeDiscardedBrowsingContext aContext);
1811 async RemoveFromSessionHistory(
1812 MaybeDiscardedBrowsingContext aContext, nsID changeID);
1814 // Called when a nsDocShellLoadState which was received over IPC is
1815 // destroyed in the content process to clean up pending state left behind
1816 // tracking the load state in the parent process.
1817 [LazySend] async CleanupPendingLoadState(uint64_t aLoadIdentifier);
1820 async ScriptError(nsString message, nsString sourceName, nsString sourceLine,
1821 uint32_t lineNumber, uint32_t colNumber, uint32_t flags,
1822 nsCString category, bool privateWindow, uint64_t innerWindowId,
1823 bool fromChromeContext);
1826 * Used in fission to report timing data when the parent window is in
1827 * another process. Child frame will send data to its ContentParent which
1828 * will then identify the ContentParent for the innerWindowId and pass
1829 * the data to the correct process.
1830 * loadInfo is passed in order to enforce same-origin security checks
1831 * aData must be non-null.
1833 async ReportFrameTimingData(LoadInfoArgs loadInfo, nsString entryName,
1834 nsString initiatorType,
1835 UniquePtr<PerformanceTimingData> aData);
1837 async CommitBrowsingContextTransaction(MaybeDiscardedBrowsingContext aContext,
1838 BrowsingContextTransaction aTransaction,
1841 async AsyncMessage(nsString aMessage, ClonedMessageData aData);
1844 * Notify `push-subscription-modified` observers in the parent and child.
1846 async NotifyPushSubscriptionModifiedObservers(nsCString scope,
1847 nullable nsIPrincipal principal);
1850 * Send a Push error message to all service worker clients in the parent or
1853 async PushError(nsCString scope, nullable nsIPrincipal principal, nsString message,
1857 * Creates a new BrowsingContext, initialized with the values provided in
1858 * `BrowsingContextInitializer`.
1860 * This message may only be sent to the parent in limited situations. If the
1861 * new BrowsingContext has a parent window, it must be owned by the
1862 * embedding process, otherwise it must be owned by the opener, if set.
1864 [LazySend] async CreateBrowsingContext(uint64_t aGroupId, BrowsingContextInitializer aInit);
1867 * If aDoDiscard is true, discards the passed-in BrowsingContext. If the
1868 * BrowsingContext has already been discarded, this message does nothing.
1869 * If the receiver is the parent process, resolves when all content
1870 * processes have flagged the BrowsingContext as discarded, and if the
1871 * receiver is a child process, resolves when that child process has flagged
1872 * the BrowsingContext as discarded.
1874 async DiscardBrowsingContext(MaybeDiscardedBrowsingContext aContext, bool aDoDiscard)
1875 returns (uint64_t unused);
1878 * aContext is the one that's taking the affect. Either the one that
1879 * receives the focus, or the one that loses the focus.
1881 * aAncestorBrowsingContextToFocus can only be non-null when
1882 * aShouldClearAncestorFocus is true. This is the browsing context
1883 * that receives the focus when aContext loses the focus.
1885 async AdjustWindowFocus(MaybeDiscardedBrowsingContext aContext,
1886 bool aIsVisible, uint64_t aActionId,
1887 bool aShouldClearAncestorFocus,
1888 MaybeDiscardedBrowsingContext aAncestorBrowsingContextToFocus);
1889 async WindowClose(MaybeDiscardedBrowsingContext aContext,
1890 bool aTrustedCaller);
1891 async WindowFocus(MaybeDiscardedBrowsingContext aContext,
1892 CallerType aCallerType, uint64_t aActionId);
1893 async WindowBlur(MaybeDiscardedBrowsingContext aContext,
1894 CallerType aCallerType);
1895 async RaiseWindow(MaybeDiscardedBrowsingContext aContext, CallerType aCallerType, uint64_t aActionId);
1896 async ClearFocus(MaybeDiscardedBrowsingContext aContext);
1897 async SetFocusedBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1898 async SetActiveBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1899 async UnsetActiveBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1900 async SetFocusedElement(MaybeDiscardedBrowsingContext aContext, bool aNeedsFocus);
1901 async FinalizeFocusOuter(MaybeDiscardedBrowsingContext aContext, bool aCanFocus,
1902 CallerType aCallerType);
1904 [LazySend] async InsertNewFocusActionId(uint64_t aActionId);
1905 async BlurToParent(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1906 MaybeDiscardedBrowsingContext aBrowsingContextToClear,
1907 MaybeDiscardedBrowsingContext aAncestorBrowsingContextToFocus,
1908 bool aIsLeavingDocument, bool aAdjustWidget,
1909 bool aBrowsingContextToClearHandled,
1910 bool aAncestorBrowsingContextToFocusHandled, uint64_t aActionId);
1912 async BlurToChild(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1913 MaybeDiscardedBrowsingContext aBrowsingContextToClear,
1914 MaybeDiscardedBrowsingContext aAncestorBrowsingContextToFocus,
1915 bool aIsLeavingDocument, bool aAdjustWidget, uint64_t aActionId);
1916 async SetupFocusedAndActive(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1917 uint64_t aActionIdForFocused,
1918 MaybeDiscardedBrowsingContext aActiveBrowsingContext,
1919 uint64_t aActionId);
1920 async ReviseActiveBrowsingContext(uint64_t aOldActionId,
1921 MaybeDiscardedBrowsingContext aActiveBrowsingContext,
1922 uint64_t aNewActionId);
1923 async ReviseFocusedBrowsingContext(uint64_t aOldActionId,
1924 MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1925 uint64_t aNewActionId);
1927 async MaybeExitFullscreen(MaybeDiscardedBrowsingContext aContext);
1928 async WindowPostMessage(MaybeDiscardedBrowsingContext aContext,
1929 ClonedOrErrorMessageData aMessage,
1930 PostMessageData aData);
1932 async CommitWindowContextTransaction(MaybeDiscardedWindowContext aContext,
1933 WindowContextTransaction aTransaction,
1937 // NOTE: These methods are only needed on the child, as the parent
1938 // WindowContext is managed using the PWindowGlobal actor's lifecycle.
1939 [LazySend] async CreateWindowContext(WindowContextInitializer aInit);
1940 async DiscardWindowContext(uint64_t aContextId) returns (bool unused);
1943 // Temporary (bug 1641989) conduit for Glean data in content processes.
1944 // Sent from time-to-time to limit the amount of data vulnerable to loss.
1945 // Buffer contains bincoded Rust structs.
1946 async FOGData(ByteBuf buf);
1949 // Temporary (bug 1641989) conduit for Glean data in content processes.
1950 // Tells the child to flush any pending data. Used in tests and ping
1951 // assembly. Buffer contains bincoded Rust structs.
1952 async FlushFOGData() returns (ByteBuf buf);
1955 async SetContainerFeaturePolicy(MaybeDiscardedBrowsingContext aContainerContext,
1956 nullable FeaturePolicy aContainerFeaturePolicy);
1958 // Obtain an icon from the system widget toolkit, in nsIconDecoder
1959 // format. Not supported (or needed) on all platforms; see the
1960 // implementation in ContentParent::RecvGetSystemIcon for details.
1961 async GetSystemIcon(nullable nsIURI aURI) returns (nsresult aResult, ByteBuf? aData);
1963 #ifdef FUZZING_SNAPSHOT
1964 // Used by the child process to signal that it is ready to start fuzzing.
1965 // This can in particular be used to wait for a particular event in a
1966 // test document before taking the snapshot and starting e.g. IPC fuzzing.
1967 async SignalFuzzingReady();