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 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 union PClipboardReadRequestOrError {
474 PClipboardReadRequest;
479 * The PContent protocol is a top-level protocol between the UI process
480 * and a content process. There is exactly one PContentParent/PContentChild pair
481 * for each content process.
483 [NestedUpTo=inside_cpow, NeedsOtherPid, ChildProc=Content]
484 sync protocol PContent
487 manages PClipboardReadRequest;
488 manages PClipboardWriteRequest;
489 manages PContentPermissionRequest;
490 manages PCycleCollectWithLogs;
492 manages PExternalHelperApp;
494 manages PHandlerService;
495 manages PHeapSnapshotTempFileHelper;
496 manages PRemotePrintJob;
500 manages PSpeechSynthesis;
503 manages PRemoteSpellcheckEngine;
504 manages PWebBrowserPersistDocument;
506 manages PWebrtcGlobal;
508 manages PURLClassifier;
509 manages PURLClassifierLocal;
510 manages PScriptCache;
511 manages PSessionStorageObserver;
512 manages PBenchmarkStorage;
514 // Depending on exactly how the new browser is being created, it might be
515 // created from either the child or parent process!
517 // The child creates the PBrowser as part of
518 // BrowserChild::BrowserFrameProvideWindow (which happens when the child's
519 // content calls window.open()), and the parent creates the PBrowser as part
520 // of ContentParent::CreateBrowser.
522 // When the parent constructs a PBrowser, the child trusts the attributes it
523 // receives from the parent. In that case, the context should be
524 // FrameIPCTabContext.
526 // When the child constructs a PBrowser, the parent doesn't trust the
527 // attributes it receives from the child. In this case, context must have
528 // type PopupIPCTabContext. The parent checks that if the opener is a
529 // browser element, the context is also for a browser element.
531 // If |sameTabGroupAs| is non-zero, the new tab should go in the same
532 // TabGroup as |sameTabGroupAs|. This parameter should always be zero
533 // for PBrowser messages sent from the child to the parent.
535 // Separate messages are used for the parent and child side constructors due
536 // to the differences in data and actor setup required.
538 // Keep the last 3 attributes in sync with GetProcessAttributes!
540 async ConstructPopupBrowser(ManagedEndpoint<PBrowserParent> browserEp,
541 ManagedEndpoint<PWindowGlobalParent> windowEp,
542 TabId tabId, IPCTabContext context,
543 WindowGlobalInit windowInit,
544 uint32_t chromeFlags);
546 // TODO: Do I need to make this return something to watch for completion?
547 // Guess we'll see how we end up triggering the actual print, for preview
548 // this should be enough...
549 async CloneDocumentTreeInto(MaybeDiscardedBrowsingContext aSourceBc,
550 MaybeDiscardedBrowsingContext aTargetBc,
551 PrintData aPrintData);
553 async UpdateRemotePrintSettings(MaybeDiscardedBrowsingContext aBc,
554 PrintData aPrintData);
559 async ConstructBrowser(ManagedEndpoint<PBrowserChild> browserEp,
560 ManagedEndpoint<PWindowGlobalChild> windowEp,
562 IPCTabContext context,
563 WindowGlobalInit windowInit,
564 uint32_t chromeFlags, ContentParentId cpId,
565 bool isForBrowser, bool isTopLevel);
568 // For parent->child, aBrowser must be non-null; aContext can
569 // be null to indicate the browser's current root document, or non-null
570 // to persist a subdocument. For child->parent, arguments are
571 // ignored and should be null.
572 async PWebBrowserPersistDocument(nullable PBrowser aBrowser,
573 MaybeDiscardedBrowsingContext aContext);
575 async RawMessage(JSActorMessageMeta aMetadata, ClonedMessageData? aData,
576 ClonedMessageData? aStack);
579 async InitGMPService(Endpoint<PGMPServiceChild> service);
580 async InitProcessHangMonitor(Endpoint<PProcessHangMonitorChild> hangMonitor);
581 async InitProfiler(Endpoint<PProfilerChild> aEndpoint);
583 // Give the content process its endpoints to the compositor.
585 Endpoint<PCompositorManagerChild> compositor,
586 Endpoint<PImageBridgeChild> imageBridge,
587 Endpoint<PVRManagerChild> vr,
588 Endpoint<PRemoteDecoderManagerChild> video,
589 uint32_t[] namespaces);
591 // Re-create the rendering stack using the given endpoints. This is sent
592 // after the compositor process has crashed. The new endpoints may be to a
593 // newly launched GPU process, or the compositor thread of the UI process.
594 async ReinitRendering(
595 Endpoint<PCompositorManagerChild> compositor,
596 Endpoint<PImageBridgeChild> bridge,
597 Endpoint<PVRManagerChild> vr,
598 Endpoint<PRemoteDecoderManagerChild> video,
599 uint32_t[] namespaces);
601 async NetworkLinkTypeChange(uint32_t type);
602 async SocketProcessCrashed();
604 // Re-create the rendering stack for a device reset.
605 async ReinitRenderingForDeviceReset();
608 * Enable system-level sandboxing features, if available. Can
609 * usually only be performed zero or one times. The child may
610 * abnormally exit if this fails; the details are OS-specific.
612 async SetProcessSandbox(FileDescriptor? aBroker);
614 async RequestMemoryReport(uint32_t generation,
616 bool minimizeMemoryUsage,
617 FileDescriptor? DMDFile)
618 returns (uint32_t aGeneration);
622 * Used by third-party modules telemetry (aka "untrusted modules" telemetry)
623 * to pull data from content processes.
625 async GetUntrustedModulesData() returns (UntrustedModulesData? data);
628 * This method is used to notifty a child process to start
629 * processing module loading events in UntrustedModulesProcessor.
630 * This should be called when the parent process has gone idle.
632 async UnblockUntrustedModulesThread();
633 #endif // defined(XP_WIN)
636 * Communication between the PuppetBidiKeyboard and the actual
637 * BidiKeyboard hosted by the parent
639 async BidiKeyboardNotify(bool isLangRTL, bool haveBidiKeyboards);
642 * Dump this process's GC and CC logs to the provided files.
644 * For documentation on the other args, see dumpGCAndCCLogsToFile in
645 * nsIMemoryInfoDumper.idl
647 async PCycleCollectWithLogs(bool dumpAllTraces,
648 FileDescriptor gcLog,
649 FileDescriptor ccLog);
653 async PScriptCache(FileDescOrError cacheFile, bool wantCacheData);
655 async RegisterChrome(ChromePackage[] packages, SubstitutionMapping[] substitutions,
656 OverrideMapping[] overrides, nsCString locale, bool reset);
657 async RegisterChromeItem(ChromeRegistryItem item);
659 async ClearImageCacheFromPrincipal(nullable nsIPrincipal aPrincipal);
661 async ClearImageCacheFromBaseDomain(nsCString aBaseDomain);
663 async ClearImageCache(bool privateLoader, bool chrome);
665 async ClearStyleSheetCache(nullable nsIPrincipal? aForPrincipal,
666 nsCString? aBaseDomain);
668 async SetOffline(bool offline);
669 async SetConnectivity(bool connectivity);
670 async SetCaptivePortalState(int32_t aState);
671 async SetTRRMode(ResolverMode aMode, ResolverMode aModeFromPref);
673 async NotifyVisited(VisitedQueryResult[] uri);
676 * Tell the child that the system theme has changed, and that a repaint is
679 async ThemeChanged(FullLookAndFeel lookAndFeelData, ThemeChangeKind aKind);
681 async PreferenceUpdate(Pref pref);
682 async VarUpdate(GfxVarUpdate var);
684 async UpdatePerfStatsCollectionMask(uint64_t aMask);
685 async CollectPerfStatsJSON() returns (nsCString aStats);
687 async CollectScrollingMetrics() returns (uint32_t pixelsScrolled, uint32_t scrollDurationMS);
689 async NotifyAlertsObserver(nsCString topic, nsString data);
691 async GeolocationUpdate(nullable nsIDOMGeoPosition aPosition);
693 async GeolocationError(uint16_t errorCode);
695 async UpdateDictionaryList(nsCString[] dictionaries);
697 async UpdateFontList(SystemFontList fontList);
700 * The shared font list has been updated by the parent, so child processes
701 * should globally reflow everything to pick up new character coverage etc.
702 * If aFullRebuild is true, child processes must discard and recreate
703 * their mappings to the shmem blocks, as those are no longer valid.
704 * This message has raised priority so that it will take precedence over
705 * vsync messages to the child.
707 [Priority=mediumhigh] async RebuildFontList(bool aFullRebuild);
710 * The shared font list has been modified, potentially adding matches
711 * for src:local() names that were previously not known, so content
712 * may need to be reflowed.
714 async FontListChanged();
717 * The font list or prefs have been updated in such a way that we might need
718 * to do a reflow and maybe reframe.
720 async ForceGlobalReflow(bool aNeedsReframe);
723 * A new shmem block has been added to the font list; the child process
724 * should map the new block and add to its index.
726 async FontListShmBlockAdded(uint32_t aGeneration, uint32_t aIndex,
727 SharedMemoryHandle aHandle);
729 async UpdateAppLocales(nsCString[] appLocales);
730 async UpdateRequestedLocales(nsCString[] requestedLocales);
733 * The system timezone has changed; the child process should ensure that
734 * calls to get the default timezone return the new value.
736 async SystemTimezoneChanged();
738 async UpdateL10nFileSources(L10nFileSourceDescriptor[] sources);
740 async RegisterStringBundles(StringBundleDescriptor[] stringBundles);
742 async UpdateSharedData(FileDescriptor mapFile, uint32_t aSize,
744 nsCString[] changedKeys);
746 // nsIPermissionManager messages
747 async AddPermission(Permission permission);
748 async RemoveAllPermissions();
750 async FlushMemory(nsString reason);
752 async ApplicationBackground();
753 async ApplicationForeground();
754 async GarbageCollect();
755 async CycleCollect();
756 async UnlinkGhosts();
759 * Start accessibility engine in content process.
761 async ActivateA11y();
764 * Shutdown accessibility engine in content process (if not in use).
766 async ShutdownA11y();
768 async AppInfo(nsCString version, nsCString buildID, nsCString name, nsCString UAName,
769 nsCString ID, nsCString vendor, nsCString sourceURL, nsCString updateURL);
772 * Send the remote type associated with the content process.
774 async RemoteType(nsCString aRemoteType, nsCString aProfile);
777 * Send BlobURLRegistrationData to child process.
779 async InitBlobURLs(BlobURLRegistrationData[] registrations);
782 * Send JS{Content, Window}ActorInfos to child process.
784 async InitJSActorInfos(JSProcessActorInfo[] aContentInfos, JSWindowActorInfo[] aWindowInfos);
787 * Unregister a previously registered JSWindowActor in the child process.
789 async UnregisterJSWindowActor(nsCString name);
792 * Unregister a previously registered JSProcessActor in the child process.
794 async UnregisterJSProcessActor(nsCString name);
796 async SetXPCOMProcessAttributes(XPCOMInitData xpcomInit,
797 StructuredCloneData initialData,
798 FullLookAndFeel lookAndFeeldata,
799 /* used on MacOSX/Linux/Android only: */
800 SystemFontList systemFontList,
801 SharedMemoryHandle? sharedUASheetHandle,
802 uintptr_t sharedUASheetAddress,
803 SharedMemoryHandle[] sharedFontListBlocks,
806 // Notify child that last-pb-context-exited notification was observed
807 async LastPrivateDocShellDestroyed();
809 async NotifyProcessPriorityChanged(ProcessPriority priority);
810 async MinimizeMemoryUsage();
813 * Used to manage nsIStyleSheetService across processes.
815 async LoadAndRegisterSheet(nullable nsIURI uri, uint32_t type);
816 async UnregisterSheet(nullable nsIURI uri, uint32_t type);
819 * Notify idle observers in the child
821 async NotifyIdleObserver(uint64_t observerId, nsCString topic, nsString str);
823 async InvokeDragSession(MaybeDiscardedWindowContext aSourceWindowContext,
824 MaybeDiscardedWindowContext aSourceTopWindowContext,
825 IPCTransferableData[] transfers, uint32_t action);
827 async UpdateDragSession(IPCTransferableData[] transfers, EventMessage message);
829 async EndDragSession(bool aDoneDrag, bool aUserCancelled,
830 LayoutDeviceIntPoint aDragEndPoint,
831 uint32_t aKeyModifiers,
832 uint32_t aDropEffect);
834 async DomainSetChanged(uint32_t aSetType, uint32_t aChangeType, nullable nsIURI aDomain);
837 * Notify the child that it will soon be asked to shutdown.
838 * This is sent with high priority right before the normal shutdown.
840 [Priority=control] async ShutdownConfirmedHP();
843 * Notify the child to shutdown. The child will in turn call FinishShutdown
844 * and let the parent close the channel.
848 async LoadProcessScript(nsString url);
851 * Requests a full native update of a native plugin child window. This is
852 * a Windows specific call.
854 async UpdateWindow(uintptr_t aChildId);
857 * Notify the child that cache is emptied.
859 async NotifyEmptyHTTPCache();
862 * Send a `push` event without data to a service worker in the child.
864 async Push(nsCString scope, nullable nsIPrincipal principal, nsString messageId);
867 * Send a `push` event with data to a service worker in the child.
869 async PushWithData(nsCString scope, nullable nsIPrincipal principal,
870 nsString messageId, uint8_t[] data);
873 * Send a `pushsubscriptionchange` event to a service worker in the child.
875 async PushSubscriptionChange(nsCString scope, nullable nsIPrincipal principal);
877 async GetFilesResponse(nsID aID, GetFilesResponseResult aResult);
879 async BlobURLRegistration(nsCString aURI, IPCBlob aBlob,
880 nullable nsIPrincipal aPrincipal, nsCString aPartitionKey);
882 async BlobURLUnregistration(nsCString aURI);
884 async GMPsChanged(GMPCapabilityData[] capabilities);
887 async ProvideAnonymousTemporaryFile(uint64_t aID, FileDescOrError aFD);
889 async SetPermissionsWithKey(nsCString aPermissionKey, Permission[] aPermissions);
891 async RefreshScreens(ScreenDetails[] aScreens);
893 async ShareCodeCoverageMutex(CrossProcessMutexHandle handle);
894 async FlushCodeCoverageCounters() returns (bool unused);
897 * IPC message to enable the input event queue on the main thread of the
900 async SetInputEventQueueEnabled();
903 * IPC message to flush the input event queue on the main thread of the
906 * When the ContentParent stops sending the input event with input priority,
907 * there may be some pending events in the input event queue and normal
908 * event queue. Here is a possible scenario.
910 * D: Enable the input priority event.
911 * E: Disable the input priority evnet.
914 * Normal Queue: R1 R2 R3
915 * Input Queue: II I2 I3
917 * To avoid the newly added normal events (e.g. R2, which may be an input
918 * event) preempt the pending input events (e.g. I1), or the newly added
919 * input events (e.g. I3) preempt the pending normal events (e.g. R2), we
920 * have to flush all pending events before enabling and disabling the input
923 * To flush the normal event queue and the input event queue, we use three
924 * IPC messages as the followings.
925 * FI: Flush the input queue.
926 * SI: Suspend the input queue.
927 * RI: Resume the input queue.
929 * Normal Queue: R1 FI RI R2 FI RI R3
930 * Input Queue: II SI I2 SI I3
932 * When the flush input request is processed before the other two requests,
933 * we consume all input events until the suspend request. After handling the
934 * suspend request, we stop consuming the input events until the resume
935 * request to make sure we consume all pending normal events.
937 * If we process the suspend request before the other two requests, we
938 * ignore the flush request and consume all pending normal events until the
941 async FlushInputEventQueue();
944 * IPC message to resume consuming the pending events in the input event
947 async ResumeInputEventQueue();
950 * IPC message to suspend consuming the pending events in the input event
953 [Priority=input] async SuspendInputEventQueue();
956 * IPC message to propagate dynamic scalar definitions, added after the
957 * content process is spawned, from the parent to the child.
958 * Dynamic scalar definitions added at the process startup are handled
959 * using the |TelemetryIPC::AddDynamicScalarDefinitions| functions.
961 async AddDynamicScalars(DynamicScalarDefinition[] definitions);
963 // This message is sent to content processes, and triggers the creation of a
964 // new HttpChannelChild that will be connected to the parent channel
965 // represented by registrarId.
966 // This is on PContent not PNecko, as PNecko may not be initialized yet.
967 // The returned loadInfo needs to be set on the channel - since the channel
968 // moved to a new process it now has different properties.
970 async CrossProcessRedirect(RedirectToRealChannelArgs args,
971 Endpoint<PStreamFilterParent>[] aEndpoint)
972 returns (nsresult rv);
975 * This method is used to notifty content process to start delayed autoplay
976 * media via browsing context.
978 async StartDelayedAutoplayMediaComponents(MaybeDiscardedBrowsingContext aContext);
981 * This method is used to dispatch MediaControlAction to content process in
982 * order to control media within a specific browsing context tree.
984 async UpdateMediaControlAction(MaybeDiscardedBrowsingContext aContext,
985 MediaControlAction aAction);
987 // Begin subscribing to a new BrowsingContextGroup, sending down the current
988 // value for every individual BrowsingContext.
989 async RegisterBrowsingContextGroup(uint64_t aGroupId, SyncedContextInitializer[] aInits);
991 // The BrowsingContextGroup has been destroyed in the parent process. The
992 // content process won't destroy the group until it receives this message or
995 // When the content process receives this message, all contexts in the group
996 // should have already been destroyed.
997 async DestroyBrowsingContextGroup(uint64_t aGroupId);
999 #if defined(MOZ_SANDBOX) && defined(MOZ_DEBUG) && defined(ENABLE_TESTS)
1000 // Initialize top-level actor for testing content process sandbox.
1001 async InitSandboxTesting(Endpoint<PSandboxTestingChild> aEndpoint);
1004 async LoadURI(MaybeDiscardedBrowsingContext aContext, nsDocShellLoadState aLoadState, bool aSetNavigating)
1005 returns (bool aSuccess);
1007 async InternalLoad(nsDocShellLoadState aLoadState);
1009 async DisplayLoadError(MaybeDiscardedBrowsingContext aContext, nsString aURI);
1011 async GoBack(MaybeDiscardedBrowsingContext aContext, int32_t? aCancelContentJSEpoch, bool aRequireUserInteraction, bool aUserActivation);
1012 async GoForward(MaybeDiscardedBrowsingContext aContext, int32_t? aCancelContentJSEpoch, bool aRequireUserInteraction, bool aUserActivation);
1013 async GoToIndex(MaybeDiscardedBrowsingContext aContext, int32_t aIndex, int32_t? aCancelContentJSEpoch, bool aUserActivation);
1014 async Reload(MaybeDiscardedBrowsingContext aContext, uint32_t aReloadFlags);
1015 async StopLoad(MaybeDiscardedBrowsingContext aContext, uint32_t aStopFlags);
1017 async OnAllowAccessFor(MaybeDiscardedBrowsingContext aParentContext,
1018 nsCString aTrackingOrigin,
1019 uint32_t aCookieBehavior,
1020 StorageAccessPermissionGrantedReason aReason);
1022 async OnContentBlockingDecision(MaybeDiscardedBrowsingContext aContext,
1023 BlockingDecision aReason,
1024 uint32_t aRejectedReason);
1027 * Abort orientationPendingPromises for documents in the child which
1028 * are part of a BrowsingContextGroup.
1030 async AbortOrientationPendingPromises(MaybeDiscardedBrowsingContext aContext);
1032 async HistoryCommitIndexAndLength(MaybeDiscardedBrowsingContext aContext,
1033 uint32_t aIndex, uint32_t aLength,
1036 async GetLayoutHistoryState(MaybeDiscardedBrowsingContext aContext)
1037 returns (nullable nsILayoutHistoryState aState, Wireframe? aWireframe);
1039 async DispatchLocationChangeEvent(MaybeDiscardedBrowsingContext aContext);
1041 // Dispatches a "beforeunload" event to each in-process content window in the
1042 // subtree beginning at `aStartingAt`, and returns the result as documented in
1043 // the `PermitUnloadResult` enum.
1044 async DispatchBeforeUnloadToSubtree(MaybeDiscardedBrowsingContext aStartingAt)
1045 returns (PermitUnloadResult result);
1047 // Update the cached list of codec supported in the given process.
1048 async UpdateMediaCodecsSupported(RemoteDecodeIn aLocation, MediaCodecsSupported aSupported);
1050 // Send the list of the supported mimetypes in the given process. GeckoView-specific
1051 async DecoderSupportedMimeTypes(nsCString[] supportedTypes);
1053 // Used to initialize the global variable in content processes with the
1054 // latched value in the parent process. See dom/LocalStorageCommon.h for more
1056 async InitNextGenLocalStorageEnabled(bool enabled);
1058 async PRemotePrintJob();
1060 async PClipboardReadRequest(nsCString[] aTypes);
1063 async SynchronizeLayoutHistoryState(MaybeDiscardedBrowsingContext aContext,
1064 nullable nsILayoutHistoryState aState);
1066 async SessionHistoryEntryTitle(MaybeDiscardedBrowsingContext aContext,
1069 async SessionHistoryEntryScrollRestorationIsManual(MaybeDiscardedBrowsingContext aContext,
1071 async SessionHistoryEntryScrollPosition(MaybeDiscardedBrowsingContext aContext,
1072 int32_t aX, int32_t aY);
1074 async SessionHistoryEntryCacheKey(MaybeDiscardedBrowsingContext aContext,
1075 uint32_t aCacheKey);
1077 async SessionHistoryEntryStoreWindowNameInContiguousEntries(MaybeDiscardedBrowsingContext aContext,
1080 async SessionHistoryEntryWireframe(MaybeDiscardedBrowsingContext aContext,
1081 Wireframe aWireframe);
1083 async GetLoadingSessionHistoryInfoFromParent(MaybeDiscardedBrowsingContext aContext)
1084 returns (LoadingSessionHistoryInfo? aLoadingInfo);
1086 async RemoveFromBFCache(MaybeDiscardedBrowsingContext aContext);
1088 async InitBackground(Endpoint<PBackgroundStarterParent> aEndpoint);
1090 async CreateGMPService();
1092 async InitStreamFilter(uint64_t channelId, nsString addonId)
1093 returns (Endpoint<PStreamFilterChild> aEndpoint);
1095 async PRemoteSpellcheckEngine();
1097 async InitCrashReporter(NativeThreadId tid);
1099 sync IsSecureURI(nullable nsIURI aURI, OriginAttributes aOriginAttributes)
1100 returns (bool isSecureURI);
1102 async AccumulateMixedContentHSTS(nullable nsIURI aURI, bool aActive,
1103 OriginAttributes aOriginAttributes);
1105 [Nested=inside_cpow] async PHal();
1107 async PHeapSnapshotTempFileHelper();
1111 #ifdef MOZ_WEBSPEECH
1112 async PSpeechSynthesis();
1118 async PWebrtcGlobal();
1121 async CreateAudioIPCConnection() returns (FileDescOrError fd);
1123 sync PURLClassifier(nullable nsIPrincipal principal)
1124 returns (bool success);
1126 async PURLClassifierLocal(nullable nsIURI uri, IPCURLClassifierFeature[] features);
1128 async PSessionStorageObserver();
1130 async PBenchmarkStorage();
1132 // Services remoting
1134 async StartVisitedQueries(nullable nsIURI[] uri);
1135 async SetURITitle(nullable nsIURI uri, nsString title);
1137 async LoadURIExternal(nullable nsIURI uri,
1138 nullable nsIPrincipal triggeringPrincipal,
1139 nullable nsIPrincipal redirectPrincipal,
1140 MaybeDiscardedBrowsingContext browsingContext,
1141 bool wasExternallyTriggered,
1142 bool hasValidUserGestureActivation);
1143 async ExtProtocolChannelConnectParent(uint64_t registrarId);
1145 sync SyncMessage(nsString aMessage, ClonedMessageData aData)
1146 returns (StructuredCloneData[] retval);
1148 async ShowAlert(nullable nsIAlertNotification alert);
1150 async CloseAlert(nsString name, bool contextClosed);
1152 async DisableNotifications(nullable nsIPrincipal principal);
1154 async OpenNotificationSettings(nullable nsIPrincipal principal);
1156 async AddSecurityState(MaybeDiscardedWindowContext aContext, uint32_t aStateFlags);
1158 // Request that the ServiceWorkerManager in the parent process create a
1159 // notification "click" or "close" event and dispatch it on the relevant
1160 // ServiceWorker. This needs to happen because when a notification is
1161 // created it is tied to a specific content process and when the user clicks
1162 // on the notification, it will be that content process that is notified.
1163 // However, even if the ServiceWorker lives in that process (it may no
1164 // longer be in that process, or may have never lived there), the right/only
1165 // way to talk through the ServiceWorker is through the parent.
1167 // This happens on PContent because the ServiceWorkerManager lives on the
1168 // main thread and bouncing this off of PBackground would be silly and
1169 // complex. In the long run, the notification implementation will be
1170 // overhauled to directly process the notification click/close and directly
1171 // translate that to a ServiceWorker event.
1172 async NotificationEvent(nsString type, NotificationEventData data);
1174 // Creates a helper for forwarding data from an nsExternalAppHandler
1175 // running in the content process, to one running in the parent
1177 // Bug 1574372 aims to run nsExternalAppHandler entirely in the
1178 // parent so that we can remove this.
1180 // Serializes the uri, loadInfo, contentType, referrer, contentDisposition
1181 // headers and contentLength of the channel so that we can make them
1182 // available to the parent instance via a nsIChannel helper. Also
1183 // passes whether the original channel was an instance of nsIFileChannel.
1185 // aContext is the BrowsingContext that initiated the load, and created the
1188 // Pass true for aForceSave to always save this content to disk, regardless of
1189 // nsIMIMEInfo and other such influences.
1190 // Pass true for aShouldCloseWindow to specify that aContext was opened specifically
1191 // for this load, and should be closed once we've handled it.
1192 async PExternalHelperApp(nullable nsIURI uri,
1193 LoadInfoArgs loadInfoArgs,
1194 nsCString aMimeContentType,
1195 nsCString aContentDisposition,
1196 uint32_t aContentDispositionHint,
1197 nsString aContentDispositionFilename,
1199 int64_t aContentLength,
1200 bool aWasFileChannel,
1201 nullable nsIURI aReferrer,
1202 MaybeDiscardedBrowsingContext aContext,
1203 bool aShouldCloseWindow);
1205 async PHandlerService();
1207 async AddGeolocationListener(bool highAccuracy);
1208 async RemoveGeolocationListener();
1209 async SetGeolocationHigherAccuracy(bool enable);
1211 async ConsoleMessage(nsString message);
1212 async ScriptErrorWithStack(nsString message, nsString sourceName, nsString sourceLine,
1213 uint32_t lineNumber, uint32_t colNumber, uint32_t flags,
1214 nsCString category, bool privateWindow,
1215 bool fromChromeContext, ClonedMessageData stack);
1217 // Places the items within dataTransfer on the clipboard.
1218 async SetClipboard(IPCTransferable aTransferable,
1219 int32_t aWhichClipboard);
1221 // Given a list of supported types, returns the clipboard data for the
1222 // first type that matches.
1223 // aRequestingWindowContext is the window that is requesting the clipboard,
1224 // which is used for content analysis.
1225 sync GetClipboard(nsCString[] aTypes, int32_t aWhichClipboard,
1226 MaybeDiscardedWindowContext aRequestingWindowContext)
1227 returns (IPCTransferableData transferableData);
1229 // Returns a list of formats supported by the clipboard
1230 sync GetExternalClipboardFormats(int32_t aWhichClipboard, bool aPlainTextOnly) returns (nsCString[] aTypes);
1232 // Requests getting data from clipboard.
1233 async GetClipboardAsync(nsCString[] aTypes, int32_t aWhichClipboard,
1234 MaybeDiscardedWindowContext aRequestingWindowContext,
1235 nsIPrincipal aRequestingPrincipal)
1236 returns (PClipboardReadRequestOrError aClipboardReadRequest);
1238 // Clears the clipboard.
1239 async EmptyClipboard(int32_t aWhichClipboard);
1241 // Returns true if data of one of the specified types is on the clipboard.
1242 sync ClipboardHasType(nsCString[] aTypes, int32_t aWhichClipboard)
1243 returns (bool hasType);
1246 * Notify the parent that the child has started a clipboard write request,
1247 * and that the data will be sent over another IPC message once it is ready.
1248 * @param aClipboardType
1249 * The clipboard type defined in nsIClipboard.
1251 async PClipboardWriteRequest(int32_t aClipboardType);
1253 sync GetIconForExtension(nsCString aFileExt, uint32_t aIconSize)
1254 returns (uint8_t[] bits);
1256 // Tell the parent that the child has gone idle for the first time.
1259 async CopyFavicon(nullable nsIURI oldURI, nullable nsIURI newURI, bool isPrivate);
1261 async FindImageText(IPCImage image, nsCString[] languages)
1262 returns (TextRecognitionResultOrError result);
1265 async GraphicsError(nsCString aError);
1267 // Driver crash guards. aGuardType must be a member of CrashGuardType.
1268 sync BeginDriverCrashGuard(uint32_t aGuardType) returns (bool crashDetected);
1269 sync EndDriverCrashGuard(uint32_t aGuardType);
1271 async AddIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
1272 async RemoveIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
1275 * This message is only used on X11 platforms.
1277 * Send a dup of the plugin process's X socket to the parent
1278 * process. In theory, this scheme keeps the plugin's X resources
1279 * around until after both the plugin process shuts down *and* the
1280 * parent process closes the dup fd. This is used to prevent the
1281 * parent process from crashing on X errors if, e.g., the plugin
1282 * crashes *just before* a repaint and the parent process tries to
1283 * use the newly-invalid surface.
1285 async BackUpXResources(FileDescriptor aXSocketFd);
1287 async RequestAnonymousTemporaryFile(uint64_t aID);
1290 * Notifies the parent that the child needs no more ForceKill dump.
1292 [Priority=control] async NotifyShutdownSuccess();
1295 * Notifies the parent to continue shutting down after the child performs
1296 * its shutdown tasks.
1298 async FinishShutdown();
1300 async UpdateDropEffect(uint32_t aDragAction, uint32_t aDropEffect);
1303 * Initiates an asynchronous request for permission for the
1304 * provided principal.
1307 * The array of permissions to request.
1309 * The principal of the request.
1310 * @param aTopLevelPrincipal
1311 * The principal of the top level page the request comes from.
1313 * To identify which tab issues this request.
1315 * NOTE: The principal is untrusted in the parent process. Only
1316 * principals that can live in the content process should
1319 async PContentPermissionRequest(PermissionRequest[] aRequests,
1320 nullable nsIPrincipal aPrincipal,
1321 nullable nsIPrincipal aTopLevelPrincipal,
1322 bool aIsHandlingUserInput,
1323 bool aMaybeUnsafePermissionDelegate,
1327 * If the profiler is running when the process shuts down, this sends the
1328 * profile data collected so far.
1331 * This may contain an empty string (unknown issue), an error message
1332 * starting with '*', or a profile as a stringified JSON object.
1334 async ShutdownProfile(nsCString aProfile);
1337 * This sends any collected perf stats data on shutdown.
1339 async ShutdownPerfStats(nsCString aPerfStats);
1342 * A shared font list (see gfx/thebes/SharedFontList.*) contains a list
1343 * of shared-memory blocks that are used to store all the font list data.
1344 * The font list created in the parent process is the only one that can
1345 * create or store objects into the shared memory; content processes font
1346 * lists have read-only access to it.
1348 * To minimize the cost of record allocations, the shared font list
1349 * bump-allocates new objects that it adds to the shared memory blocks
1350 * (i.e. the records stored in the shared memory blocks are only ever
1351 * appended, and never freed except when the entire font list is
1354 * When initially created by the parent process, the font list may contain
1355 * nothing except a header, and the list of the system's installed font
1356 * family names. Additional data about the families (styled faces available
1357 * and character coverage) is appended to the font list during the session
1358 * as a given font is considered for use, because loading all data for all
1359 * installed fonts during startup is too expensive/slow.
1361 * During content process launch, a content process's first step in
1362 * gaining access to the font list is to call GetFontListShmBlock,
1363 * passing index zero in order to get access to the first block, which
1364 * contains the font list header and the list of font-family records
1365 * (which may be virtually all uninitialized at this time, containing
1366 * nothing but the family names). Once a content process determines a
1367 * font-family name it wants to use (e.g. from a CSS font-family list, or
1368 * from preferences), if that Family record has not yet been initialized,
1369 * it will call InitializeFamily (below) to have the parent process
1370 * populate Face records in the shared memory with the family's styles.
1371 * The content process can then pick the face with best style match from
1372 * the available faces according to the CSS font matching algorithm, load
1373 * its character map, then send the map to the parent process using
1374 * SetCharacterMap (so that the parent process can share the map with all
1375 * processes to avoid duplication of work).
1377 * At some point, as the parent process adds data to the font list, a new
1378 * shared-memory block will probably be needed. At that point the parent
1379 * will create a new block and append it to its share memory block list.
1380 * The new Block index will start to appear in Pointer records in the
1381 * shared memory, and the content process's can then fetch those other
1382 * blocks using this function as needed.
1384 * @param aGeneration
1385 * The font list has a Generation ID stored in its Header, and any time
1386 * the parent process needs to reinitialize the list (because of a change
1387 * in the available font repertoire) a new Generation ID is assigned.
1388 * Content processes pass the Generation of the list they're using in
1389 * all messages, so that the parent can recognize if they're out of date
1390 * and safely ignore such messages. (When the parent rebuilds the list,
1391 * it will notify all content processes, but they may still send a few
1392 * messages that relate to the obsolete list before they have processed
1393 * this notification.)
1395 * (Zero-based) index of the shared-memory block to be mapped.
1396 * In a typical case, there will be a handful of blocks altogether, so
1397 * each content process only needs to make this request a few times.
1399 * Handle that can be used to construct a SharedMemory that maps the
1400 * requested block of memory.
1401 * If aGeneration does not match the parent's font list generation ID, or
1402 * if requesting a block that does not exist (i.e. with aIndex greater
1403 * than or equal to the number of blocks actually in existence), returns
1406 * This is a sync message because the content process needs font data in
1407 * order to perform font-matching (e.g. during reflow), and cannot continue
1408 * until it has mapped the font-list memory.
1410 sync GetFontListShmBlock(uint32_t aGeneration, uint32_t aIndex)
1411 returns (SharedMemoryHandle aHandle);
1414 * Ask the parent to initialize a given font family, so that face metadata
1415 * will be available. Content processes will only call this for families
1416 * where the Face data has not yet been populated, so it will generally be
1417 * called no more than once per family. (It may not be needed at all, if
1418 * the parent process has already initialized the families that content
1421 * @param aGeneration
1422 * Font-list generation, so requests relating to an obsolete list can be
1423 * ignored (see comments for GetFontListShmBlock).
1424 * @param aFamilyIndex
1425 * The 0-based index of the Family within the font-list that a content
1426 * process needs to use.
1428 * If true, the parent should eagerly load character maps for the faces
1431 * This is a sync message because the content process cannot complete its
1432 * font-matching until the family is fully populated with Face records.
1433 * If we make it async, content processes will reflow using fallbacks,
1434 * and then have to reflow again once all the font information needed
1435 * becomes available.
1437 sync InitializeFamily(uint32_t aGeneration, uint32_t aFamilyIndex,
1441 * Record the character map of a given Face in the font list.
1443 * @param aGeneration
1444 * Font-list generation, so requests relating to an obsolete list can be
1445 * ignored (see comments for GetFontListShmBlock).
1446 * @param aFamilyIndex
1447 * Index of the font family in the font list (see aAlias for which list).
1449 * Whether aFamilyIndex refers to the Families() or AliasFamilies() list.
1451 * Index of the face within the family's Faces() list.
1453 * The character coverage map of the face. (This will be stored as a
1454 * SharedBitSet record within the shared font list, and the Face record
1455 * will be updated to reference it.)
1457 async SetCharacterMap(uint32_t aGeneration, uint32_t aFamilyIndex, bool aAlias,
1458 uint32_t aFaceIndex, gfxSparseBitSet aMap);
1461 * Ask the parent to set up the merged charmap for a family, to accelerate
1462 * future fallback searches.
1463 * aFamilyIndex may refer to an element in either Families() or AliasFamilies(),
1464 * with aAlias determining which.
1466 async SetupFamilyCharMap(uint32_t aGeneration, uint32_t aFamilyIndex, bool aAlias);
1469 * Ask the parent to try and complete the InitOtherFamilyNames task, because
1470 * we're trying to look up a localized font name. This is a sync method so that
1471 * the update will be available before the child continues reflow; however, it
1472 * is possible the task will have timed-out in the parent and not actually
1473 * completed during this call.
1475 * @param aGeneration
1476 * Font-list generation, so requests relating to an obsolete list can be
1477 * ignored (see comments for GetFontListShmBlock).
1479 * Parameter aDeferOtherFamilyNamesLoading to be passed to
1480 * gfxPlatformFontList::InitOtherFamilyNames, to determine whether name
1481 * loading should be deferred to a background task or run immediately.
1483 * Returns whether the font name loading process has completed.
1485 * TODO: This is currently a sync message but can probably be made async,
1486 * at the cost of an increased chance of some testcases failing because
1487 * they depend on lazily-loaded font names.
1489 sync InitOtherFamilyNames(uint32_t aGeneration, bool aDefer) returns (bool aLoaded);
1492 * Ask the parent to load all font character maps, as we need to do an
1493 * exhaustive font-fallback search. This is done asynchronously; when it
1494 * finishes, the parent will trigger global reflow so that font selection
1495 * is re-done in all content, making use of the newly-loaded cmaps.
1496 * Normally this will only happen once per browser session (unless the
1497 * font list is rebuilt due to installation/removal of system fonts).
1499 * @param aGeneration
1500 * Font-list generation, so requests relating to an obsolete list can be
1501 * ignored (see comments for GetFontListShmBlock).
1502 * @param aStartIndex
1503 * The family index to start from; the sender has determined that cmaps
1504 * up to this point are already loaded.
1506 async StartCmapLoading(uint32_t aGeneration, uint32_t aStartIndex);
1509 * Ask the parent for a specific hyphenation resource (identified by URI)
1510 * as a shared memory block.
1512 * This is a sync method because at the point where a content process finds
1513 * that it requires a particular hyphenation dictionary, this is blocking
1514 * reflow; making it async would require scheduling another reflow after
1515 * the resource is available, and a possible layout "jump" as line-breaks
1516 * change. Note that the content process retains a reference to each such
1517 * resource it requests, so it will only make this call once per locale for
1518 * which hyphenation data exists.
1521 * The URI (which currently must always point to an omnijar resource)
1522 * for the required hyphenation dictionary.
1524 * Returns the shmem handle to the resource (or an invalid shmem handle
1525 * in case of failure).
1527 * Returns the size in bytes of the resource.
1529 sync GetHyphDict(nullable nsIURI aURI) returns (SharedMemoryHandle aHandle, uint32_t aSize);
1531 async CreateWindow(PBrowser aThisTab,
1532 MaybeDiscardedBrowsingContext aParent,
1534 uint32_t aChromeFlags,
1537 bool aForWindowDotPrint,
1538 nullable nsIURI aURIToLoad,
1539 nsCString aFeatures,
1540 Modifiers aModifiers,
1541 nullable nsIPrincipal aTriggeringPrincipal,
1542 nullable nsIContentSecurityPolicy aCsp,
1543 nullable nsIReferrerInfo aReferrerInfo,
1544 OriginAttributes aOriginAttributes)
1545 returns (CreatedWindowInfo window);
1547 async CreateWindowInDifferentProcess(
1549 MaybeDiscardedBrowsingContext aParent,
1550 uint32_t aChromeFlags,
1552 nullable nsIURI aURIToLoad,
1553 nsCString aFeatures,
1554 Modifiers aModifiers,
1556 nullable nsIPrincipal aTriggeringPrincipal,
1557 nullable nsIContentSecurityPolicy aCsp,
1558 nullable nsIReferrerInfo aReferrerInfo,
1559 OriginAttributes aOriginAttributes);
1562 * Tell the parent that a decoder's' benchmark has been completed.
1563 * The result can then be stored in permanent storage.
1565 async NotifyBenchmarkResult(nsString aCodecName, uint32_t aDecodeFPS);
1568 * Notify `push-message` observers without data in the parent.
1570 async NotifyPushObservers(nsCString scope, nullable nsIPrincipal principal,
1571 nsString messageId);
1574 * Notify `push-message` observers with data in the parent.
1576 async NotifyPushObserversWithData(nsCString scope, nullable nsIPrincipal principal,
1577 nsString messageId, uint8_t[] data);
1580 * Notify `push-subscription-change` observers in the parent.
1582 async NotifyPushSubscriptionChangeObservers(nsCString scope,
1583 nullable nsIPrincipal principal);
1585 async GetFilesRequest(nsID aID, nsString aDirectory, bool aRecursiveFlag);
1586 async DeleteGetFilesRequest(nsID aID);
1588 async StoreAndBroadcastBlobURLRegistration(nsCString url, IPCBlob blob,
1589 nullable nsIPrincipal principal, nsCString aPartitionKey);
1591 async UnstoreAndBroadcastBlobURLUnregistration(nsCString url, nullable nsIPrincipal principal);
1594 * Messages for communicating child Glean data to the parent process
1596 async RecordPageLoadEvent(PageLoadExtra event);
1599 * Messages for communicating child Telemetry to the parent process
1601 async AccumulateChildHistograms(HistogramAccumulation[] accumulations);
1602 async AccumulateChildKeyedHistograms(KeyedHistogramAccumulation[] accumulations);
1603 async UpdateChildScalars(ScalarAction[] updates);
1604 async UpdateChildKeyedScalars(KeyedScalarAction[] updates);
1605 async RecordChildEvents(ChildEventData[] events);
1606 async RecordDiscardedData(DiscardedData data);
1608 async AddMemoryReport(MemoryReport aReport);
1610 async BHRThreadHang(HangDetails aHangDetails);
1613 * Adds a certificate exception for the given hostname and port.
1615 async AddCertException(nullable nsIX509Cert aCert, nsCString aHostName,
1616 int32_t aPort, OriginAttributes aOriginAttributes,
1618 returns (nsresult success);
1621 * Determines whether storage access can be granted automatically by the
1622 * storage access API without showing a user prompt.
1624 async AutomaticStorageAccessPermissionCanBeGranted(nullable nsIPrincipal aPrincipal)
1625 returns (bool success);
1628 * A 3rd party tracking origin (aTrackingOrigin) has received the permission
1629 * granted to have access to aGrantedOrigin when loaded by aParentWindowId.
1631 async StorageAccessPermissionGrantedForOrigin(uint64_t aTopLevelWindowId,
1632 MaybeDiscardedBrowsingContext aParentContext,
1633 nullable nsIPrincipal aTrackingPrincipal,
1634 nsCString aTrackingOrigin,
1636 StorageAccessPermissionGrantedReason? aReason,
1638 returns (bool unused);
1640 async CompleteAllowAccessFor(MaybeDiscardedBrowsingContext aParentContext,
1641 uint64_t aTopLevelWindowId,
1642 nullable nsIPrincipal aTrackingPrincipal,
1643 nsCString aTrackingOrigin,
1644 uint32_t aCookieBehavior,
1645 StorageAccessPermissionGrantedReason aReason)
1646 returns (StorageAccessPromptChoices? choice);
1648 async SetAllowStorageAccessRequestFlag(
1649 nullable nsIPrincipal aEmbeddingPrincipal,
1650 nullable nsIURI aEmbeddedOrigin)
1651 returns (bool success);
1653 async TestAllowStorageAccessRequestFlag(
1654 nullable nsIPrincipal aEmbeddedPrincipal,
1655 nullable nsIURI aEmbeddingOrigin)
1656 returns (bool success);
1658 async StoreUserInteractionAsPermission(nullable nsIPrincipal aPrincipal);
1660 async TestCookiePermissionDecided(MaybeDiscardedBrowsingContext aContext,
1661 nullable nsIPrincipal aPrincipal)
1662 returns (bool? allowed);
1664 async TestStorageAccessPermission(nullable nsIPrincipal aEmbeddingPrincipal,
1665 nsCString aEmbeddedOrigin)
1666 returns (bool? allowed);
1669 * When media element's controlled state changed in the content process, we
1670 * have to notify the chrome process in order to update the status of the
1671 * corresponding media controller, which is used to control all media in the
1672 * certain tab. We would use the browsing context to find the corresponding
1675 async NotifyMediaPlaybackChanged(MaybeDiscardedBrowsingContext aContext,
1676 MediaPlaybackState aState);
1679 * When media became audible or inaudible in content process, we have to
1680 * notify chrome process in order to which tab is audible.
1682 async NotifyMediaAudibleChanged(MaybeDiscardedBrowsingContext aContext,
1683 MediaAudibleState aState);
1686 * When media enabled or disabled the Picture-in-Picture mode, we have to
1687 * update that to the media controller in the chrome process.
1689 async NotifyPictureInPictureModeChanged(
1690 MaybeDiscardedBrowsingContext aContext, bool aEnabled);
1693 * This method is used to update media session's status when it's being
1694 * created or destroyed.
1696 async NotifyMediaSessionUpdated(MaybeDiscardedBrowsingContext aContext, bool aIsCreated);
1699 * This method is used to update media session's media metadata whenever its
1700 * metadata is being updated.
1702 async NotifyUpdateMediaMetadata(MaybeDiscardedBrowsingContext aContext,
1703 MediaMetadataBase? aMetadata);
1706 * This method is used to update media session's playback state whenever its
1707 * playback state is changed.
1709 async NotifyMediaSessionPlaybackStateChanged(
1710 MaybeDiscardedBrowsingContext aContext,
1711 MediaSessionPlaybackState aMetadata);
1714 * This method is used to update media session's supported media session
1715 * action when the action becomes supported or unsupported.
1717 async NotifyMediaSessionSupportedActionChanged(
1718 MaybeDiscardedBrowsingContext aContext,
1719 MediaSessionAction aAction,
1723 * This method is used to notify the media controller in chrome process that
1724 * the media element in the browsing context entered fullscreen.
1726 async NotifyMediaFullScreenState(
1727 MaybeDiscardedBrowsingContext aContext,
1728 bool aIsInFullScreen);
1731 * This method is used to update media session's position state whenever its
1732 * position state is being updated.
1734 async NotifyPositionStateChanged(
1735 MaybeDiscardedBrowsingContext aContext,
1736 PositionState? aState);
1739 * This method will make canonical browsing context to update the count of
1740 * callers which want to keep the page from being suspended even if the page
1743 async AddOrRemovePageAwakeRequest(MaybeDiscardedBrowsingContext aContext,
1744 bool aShouldAddCount);
1748 * Due to sandboxing, a child process's UntrustedModulesProcessor cannot
1749 * obtain enough information about a DLL file to determine its
1750 * trustworthiness. This API asks the chrome process to perform that
1753 async GetModulesTrust(ModulePaths aModPaths, bool aRunAtNormalPriority)
1754 returns (ModulesMapResult? modMapResult);
1755 #endif // defined(XP_WIN)
1758 * Used to route shutdown diagnostic info from the content process
1759 * ServiceWorkers to the parent process' ServiceWorkerManager's
1760 * ServiceWorkerShutdownBlocker. (The only other actor chain available
1761 * for this would be very convoluted and create ordering problems).
1763 async ReportServiceWorkerShutdownProgress(uint32_t aShutdownStateId,
1764 Progress aProgress);
1767 * Whenever a document is updating the OrientationLock, we need to
1768 * reject the orientationPendingPromises in other processes.
1770 async AbortOtherOrientationPendingPromises(MaybeDiscardedBrowsingContext aContext);
1772 async HistoryReload(MaybeDiscardedBrowsingContext aContext, uint32_t aReloadFlags);
1774 async NotifyOnHistoryReload(MaybeDiscardedBrowsingContext aContext,
1776 returns (bool canReload, nsDocShellLoadState? loadState,
1777 bool? reloadActiveEntry);
1779 async HistoryCommit(MaybeDiscardedBrowsingContext aContext,
1780 uint64_t aLoadID, nsID aChangeID, uint32_t aLoadType,
1781 bool aPersist, bool aCloneEntryChildren,
1782 bool aChannelExpired, uint32_t aCacheKey);
1784 async HistoryGo(MaybeDiscardedBrowsingContext aContext, int32_t aOffset,
1785 uint64_t aHistoryEpoch, bool aRequireUserInteraction,
1786 bool aUserActivation) returns(int32_t? requestedIndex);
1788 async BlobURLDataRequest(nsCString aBlobURL,
1789 nullable nsIPrincipal aTriggeringPrincipal,
1790 nullable nsIPrincipal aLoadingPrincipal,
1791 OriginAttributes aOriginAttributes,
1792 uint64_t aInnerWindowId,
1793 nsCString aPartitionKey)
1794 returns (BlobURLDataRequestResult aResult);
1796 async SetActiveSessionHistoryEntry(MaybeDiscardedBrowsingContext context,
1797 nsPoint? previousScrollPosition,
1798 SessionHistoryInfo info, uint32_t loadType,
1799 uint32_t updatedCacheKey, nsID changeID);
1800 async ReplaceActiveSessionHistoryEntry(
1801 MaybeDiscardedBrowsingContext context, SessionHistoryInfo info);
1803 async RemoveDynEntriesFromActiveSessionHistoryEntry(
1804 MaybeDiscardedBrowsingContext aContext);
1806 async RemoveFromSessionHistory(
1807 MaybeDiscardedBrowsingContext aContext, nsID changeID);
1809 // Called when a nsDocShellLoadState which was received over IPC is
1810 // destroyed in the content process to clean up pending state left behind
1811 // tracking the load state in the parent process.
1812 [LazySend] async CleanupPendingLoadState(uint64_t aLoadIdentifier);
1815 async ScriptError(nsString message, nsString sourceName, nsString sourceLine,
1816 uint32_t lineNumber, uint32_t colNumber, uint32_t flags,
1817 nsCString category, bool privateWindow, uint64_t innerWindowId,
1818 bool fromChromeContext);
1821 * Used in fission to report timing data when the parent window is in
1822 * another process. Child frame will send data to its ContentParent which
1823 * will then identify the ContentParent for the innerWindowId and pass
1824 * the data to the correct process.
1825 * loadInfo is passed in order to enforce same-origin security checks
1826 * aData must be non-null.
1828 async ReportFrameTimingData(LoadInfoArgs loadInfo, nsString entryName,
1829 nsString initiatorType,
1830 UniquePtr<PerformanceTimingData> aData);
1832 async CommitBrowsingContextTransaction(MaybeDiscardedBrowsingContext aContext,
1833 BrowsingContextTransaction aTransaction,
1836 async AsyncMessage(nsString aMessage, ClonedMessageData aData);
1839 * Notify `push-subscription-modified` observers in the parent and child.
1841 async NotifyPushSubscriptionModifiedObservers(nsCString scope,
1842 nullable nsIPrincipal principal);
1845 * Send a Push error message to all service worker clients in the parent or
1848 async PushError(nsCString scope, nullable nsIPrincipal principal, nsString message,
1852 * Creates a new BrowsingContext, initialized with the values provided in
1853 * `BrowsingContextInitializer`.
1855 * This message may only be sent to the parent in limited situations. If the
1856 * new BrowsingContext has a parent window, it must be owned by the
1857 * embedding process, otherwise it must be owned by the opener, if set.
1859 [LazySend] async CreateBrowsingContext(uint64_t aGroupId, BrowsingContextInitializer aInit);
1862 * If aDoDiscard is true, discards the passed-in BrowsingContext. If the
1863 * BrowsingContext has already been discarded, this message does nothing.
1864 * If the receiver is the parent process, resolves when all content
1865 * processes have flagged the BrowsingContext as discarded, and if the
1866 * receiver is a child process, resolves when that child process has flagged
1867 * the BrowsingContext as discarded.
1869 async DiscardBrowsingContext(MaybeDiscardedBrowsingContext aContext, bool aDoDiscard)
1870 returns (uint64_t unused);
1872 async AdjustWindowFocus(MaybeDiscardedBrowsingContext aContext,
1873 bool aIsVisible, uint64_t aActionId);
1874 async WindowClose(MaybeDiscardedBrowsingContext aContext,
1875 bool aTrustedCaller);
1876 async WindowFocus(MaybeDiscardedBrowsingContext aContext,
1877 CallerType aCallerType, uint64_t aActionId);
1878 async WindowBlur(MaybeDiscardedBrowsingContext aContext,
1879 CallerType aCallerType);
1880 async RaiseWindow(MaybeDiscardedBrowsingContext aContext, CallerType aCallerType, uint64_t aActionId);
1881 async ClearFocus(MaybeDiscardedBrowsingContext aContext);
1882 async SetFocusedBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1883 async SetActiveBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1884 async UnsetActiveBrowsingContext(MaybeDiscardedBrowsingContext aContext, uint64_t aActionId);
1885 async SetFocusedElement(MaybeDiscardedBrowsingContext aContext, bool aNeedsFocus);
1886 async FinalizeFocusOuter(MaybeDiscardedBrowsingContext aContext, bool aCanFocus,
1887 CallerType aCallerType);
1889 [LazySend] async InsertNewFocusActionId(uint64_t aActionId);
1890 async BlurToParent(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1891 MaybeDiscardedBrowsingContext aBrowsingContextToClear,
1892 MaybeDiscardedBrowsingContext aAncestorBrowsingContextToFocus,
1893 bool aIsLeavingDocument, bool aAdjustWidget,
1894 bool aBrowsingContextToClearHandled,
1895 bool aAncestorBrowsingContextToFocusHandled, uint64_t aActionId);
1897 async BlurToChild(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1898 MaybeDiscardedBrowsingContext aBrowsingContextToClear,
1899 MaybeDiscardedBrowsingContext aAncestorBrowsingContextToFocus,
1900 bool aIsLeavingDocument, bool aAdjustWidget, uint64_t aActionId);
1901 async SetupFocusedAndActive(MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1902 uint64_t aActionIdForFocused,
1903 MaybeDiscardedBrowsingContext aActiveBrowsingContext,
1904 uint64_t aActionId);
1905 async ReviseActiveBrowsingContext(uint64_t aOldActionId,
1906 MaybeDiscardedBrowsingContext aActiveBrowsingContext,
1907 uint64_t aNewActionId);
1908 async ReviseFocusedBrowsingContext(uint64_t aOldActionId,
1909 MaybeDiscardedBrowsingContext aFocusedBrowsingContext,
1910 uint64_t aNewActionId);
1912 async MaybeExitFullscreen(MaybeDiscardedBrowsingContext aContext);
1913 async WindowPostMessage(MaybeDiscardedBrowsingContext aContext,
1914 ClonedOrErrorMessageData aMessage,
1915 PostMessageData aData);
1917 async CommitWindowContextTransaction(MaybeDiscardedWindowContext aContext,
1918 WindowContextTransaction aTransaction,
1922 // NOTE: These methods are only needed on the child, as the parent
1923 // WindowContext is managed using the PWindowGlobal actor's lifecycle.
1924 [LazySend] async CreateWindowContext(WindowContextInitializer aInit);
1925 async DiscardWindowContext(uint64_t aContextId) returns (bool unused);
1928 // Temporary (bug 1641989) conduit for Glean data in content processes.
1929 // Sent from time-to-time to limit the amount of data vulnerable to loss.
1930 // Buffer contains bincoded Rust structs.
1931 async FOGData(ByteBuf buf);
1934 // Temporary (bug 1641989) conduit for Glean data in content processes.
1935 // Tells the child to flush any pending data. Used in tests and ping
1936 // assembly. Buffer contains bincoded Rust structs.
1937 async FlushFOGData() returns (ByteBuf buf);
1940 async SetContainerFeaturePolicy(MaybeDiscardedBrowsingContext aContainerContext,
1941 nullable FeaturePolicy aContainerFeaturePolicy);
1943 // Obtain an icon from the system widget toolkit, in nsIconDecoder
1944 // format. Not supported (or needed) on all platforms; see the
1945 // implementation in ContentParent::RecvGetSystemIcon for details.
1946 async GetSystemIcon(nullable nsIURI aURI) returns (nsresult aResult, ByteBuf? aData);
1948 #ifdef FUZZING_SNAPSHOT
1949 // Used by the child process to signal that it is ready to start fuzzing.
1950 // This can in particular be used to wait for a particular event in a
1951 // test document before taking the snapshot and starting e.g. IPC fuzzing.
1952 async SignalFuzzingReady();