Bug 1909986 - For sidebar revamp, only show chatbot entrypoints (context menu, shortc...
[gecko.git] / dom / ipc / DOMTypes.ipdlh
blob56be9f6557663bd9628dc66a3cd62e078c7a38c7
1 /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
2 /* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
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 "mozilla/dom/DomSecurityIPCUtils.h";
8 include "mozilla/GfxMessageUtils.h";
9 include "mozilla/dom/CSPMessageUtils.h";
10 include "mozilla/dom/DocShellMessageUtils.h";
11 include "mozilla/dom/PermissionMessageUtils.h";
12 include "mozilla/dom/PropertyBagUtils.h";
13 include "mozilla/dom/ReferrerInfoUtils.h";
14 include "mozilla/dom/TabMessageUtils.h";
15 include "mozilla/ipc/URIUtils.h";
16 include "mozilla/layers/LayersMessageUtils.h";
17 include "mozilla/net/NeckoMessageUtils.h";
19 include IPCBlob;
20 include IPCStream;
21 include ProtocolTypes;
23 using struct mozilla::void_t from "mozilla/ipc/IPCCore.h";
25 [MoveOnly=data] using struct mozilla::SerializedStructuredCloneBuffer
26   from "mozilla/ipc/SerializedStructuredCloneBuffer.h";
28 using struct mozilla::dom::LoadingSessionHistoryInfo
29   from "mozilla/dom/SessionHistoryEntry.h";
31 using mozilla::net::ClassOfService from "mozilla/net/ClassOfService.h";
34 using mozilla::hal::ScreenOrientation from "mozilla/HalIPCUtils.h";
35 using mozilla::LayoutDeviceIntRect from "Units.h";
36 using mozilla::DesktopIntRect from "Units.h";
37 using mozilla::DesktopToLayoutDeviceScale from "Units.h";
38 using mozilla::CSSToLayoutDeviceScale from "Units.h";
39 using mozilla::CSSRect from "Units.h";
40 using mozilla::CSSSize from "Units.h";
41 using mozilla::ScreenIntSize from "Units.h";
42 using mozilla::LayoutDeviceIntPoint from "Units.h";
43 using mozilla::ImageIntSize from "Units.h";
44 using nsSizeMode from "nsIWidgetListener.h";
45 using mozilla::ScrollbarPreference from "mozilla/ScrollbarPreferences.h";
46 using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h";
47 using nsILoadInfo::HTTPSUpgradeTelemetryType from "nsILoadInfo.h";
48 [RefCounted] using class nsIPrincipal from "nsIPrincipal.h";
49 using mozilla::dom::MaybeDiscardedBrowsingContext from "mozilla/dom/BrowsingContext.h";
50 [RefCounted] using class nsIURI from "nsIURI.h";
51 [RefCounted] using class nsIContentSecurityPolicy from "nsIContentSecurityPolicy.h";
52 [RefCounted] using class nsIInputStream from "mozilla/ipc/IPCStreamUtils.h";
53 [RefCounted] using class nsIReferrerInfo from "nsIReferrerInfo.h";
54 [RefCounted] using class nsIVariant from "nsIVariant.h";
55 using mozilla::TimeStamp from "mozilla/TimeStamp.h";
56 [RefCounted] using class mozilla::RemoteLazyInputStream from "mozilla/RemoteLazyInputStream.h";
57 [MoveOnly] using class mozilla::ipc::BigBuffer from "mozilla/ipc/BigBuffer.h";
59 namespace mozilla {
60 namespace dom {
62 struct MessagePortIdentifier
64   nsID uuid;
65   nsID destinationUuid;
66   uint32_t sequenceId;
67   bool neutered;
70 /**
71  * Cross-process representation for postMessage() style payloads where Blobs may
72  * be referenced/"cloned" and (optionally) messageports transferred.  Use
73  * StructuredCloneData in your code to convert between this wire representation
74  * and the StructuredCloneData StructuredCloneHolder-subclass.
75  */
76 struct ClonedMessageData
78   SerializedStructuredCloneBuffer data;
79   IPCBlob[] blobs;
80   IPCStream[] inputStreams;
81   MessagePortIdentifier[] identifiers;
84 struct ErrorMessageData {
87 union ClonedOrErrorMessageData {
88   ClonedMessageData;
89   ErrorMessageData;
92 struct RefMessageData {
93   nsID uuid;
96 union MessageDataType {
97   ClonedMessageData;
98   RefMessageData;
101 struct MessageData {
102   nsID? agentClusterId;
103   MessageDataType data;
106 struct ScreenDetails {
107   LayoutDeviceIntRect rect;
108   DesktopIntRect rectDisplayPix;
109   LayoutDeviceIntRect availRect;
110   DesktopIntRect availRectDisplayPix;
111   int32_t pixelDepth;
112   int32_t colorDepth;
113   uint32_t refreshRate; // In Hz, or 0 if not known.
114   DesktopToLayoutDeviceScale contentsScaleFactor;
115   CSSToLayoutDeviceScale defaultCSSScaleFactor;
116   float dpi;
117   ScreenOrientation orientation;
118   uint16_t orientationAngle;
119   bool isPseudoDisplay;
120   bool isHDR;
123 struct DimensionInfo
125   CSSRect rect;
126   CSSSize size;
127   LayoutDeviceIntPoint clientOffset;
128   LayoutDeviceIntPoint chromeOffset;
131 struct FrameScriptInfo
133   nsString url;
134   bool runInGlobalScope;
138  * The information required to complete a window creation request.
139  */
140 struct CreatedWindowInfo
142   nsresult rv;
143   bool windowOpened;
144   FrameScriptInfo[] frameScripts;
145   uint32_t maxTouchPoints;
146   DimensionInfo dimensions;
150 struct DocShellLoadStateInit
152   nullable nsIURI URI;
153   nullable nsIURI OriginalURI;
154   nullable nsIURI ResultPrincipalURI;
155   nullable nsIPrincipal TriggeringPrincipal;
156   nullable nsIReferrerInfo ReferrerInfo;
157   nullable nsIPrincipal PrincipalToInherit;
158   nullable nsIPrincipal PartitionedPrincipalToInherit;
159   nullable nsIURI BaseURI;
160   // The Content Security Policy of the load, that is, the CSP of the entity
161   // responsible for causing the load to occur. Most likely this is the CSP
162   // of the document that started the load. In case the entity starting the
163   // load did not use a CSP, then Csp can be null. Please note that this is
164   // also the CSP that will be applied to the load in case the load
165   // encounters a server side redirect.
166   nullable nsIContentSecurityPolicy Csp;
167   nullable nsIInputStream PostDataStream;
168   nullable nsIInputStream HeadersStream;
169   nullable nsIURI UnstrippedURI;
170   uint64_t LoadIdentifier;
171   nsString Target;
172   nsCString TypeHint;
173   nsString FileName;
175   MaybeDiscardedBrowsingContext SourceBrowsingContext;
176   MaybeDiscardedBrowsingContext TargetBrowsingContext;
178   // The provided remote type of the process responsible for causing the load to
179   // occur. Validated in the parent process.
180   nsCString TriggeringRemoteType;
182   nsString SrcdocData; // useless without sourcedocshell
184   nsCString? OriginalURIString;
186   nsCString? RemoteTypeOverride;
188   LoadingSessionHistoryInfo? loadingSessionHistoryInfo;
190   uint32_t LoadType;
191   uint32_t LoadFlags;
192   uint32_t InternalLoadFlags;
193   
194   // The TriggineringSandboxFlags are the SandboxFlags of the entity
195   // responsible for causing the load to occur.
196   uint32_t TriggeringSandboxFlags;
197   uint64_t TriggeringWindowId;
198   bool TriggeringStorageAccess;
199   int32_t? CancelContentJSEpoch;
201   bool ResultPrincipalURIIsSome;
202   bool KeepResultPrincipalURIIfSet;
203   bool LoadReplace;
204   bool InheritPrincipal;
205   bool PrincipalIsExplicit;
206   bool ForceAllowDataURI;
207   bool IsExemptFromHTTPSFirstMode;
208   bool OriginalFrameSrc;
209   bool IsFormSubmission;
210   bool FirstParty;
211   bool HasValidUserGestureActivation;
212   bool TextDirectiveUserActivation;
213   bool AllowFocusMove;
214   bool IsFromProcessingFrameAttributes;
215   bool WasSchemelessInput;
216   HTTPSUpgradeTelemetryType HttpsUpgradeTelemetry;
218   // Fields missing due to lack of need or serialization
219   // nsCOMPtr<nsIDocShell> mSourceDocShell;
220   // bool mIsSrcDocLoad; // useless without sourcedocshell
221   // nsIChannel pendingRedirectedChannel; // sent through other mechanism
223   bool ChannelInitialized;
225   bool TryToReplaceWithSessionHistoryLoad;
227   bool IsMetaRefresh;
230 struct TimedChannelInfo
232   bool timingEnabled;
233   int8_t redirectCount;
234   int8_t internalRedirectCount;
235   TimeStamp asyncOpen;
236   TimeStamp channelCreation;
237   TimeStamp redirectStart;
238   TimeStamp redirectEnd;
239   nsString initiatorType;
240   bool allRedirectsSameOrigin;
241   bool allRedirectsPassTimingAllowCheck;
242   bool? timingAllowCheckForPrincipal;
243   bool renderBlocking;
244   TimeStamp launchServiceWorkerStart;
245   TimeStamp launchServiceWorkerEnd;
246   TimeStamp dispatchFetchEventStart;
247   TimeStamp dispatchFetchEventEnd;
248   TimeStamp handleFetchEventStart;
249   TimeStamp handleFetchEventEnd;
250   TimeStamp responseStart;
251   TimeStamp responseEnd;
254 struct ReplacementChannelConfigInit
256   uint32_t redirectFlags;
257   ClassOfService classOfService;
258   bool? privateBrowsing;
259   nsCString? method;
260   nullable nsIReferrerInfo referrerInfo;
261   TimedChannelInfo? timedChannelInfo;
262   nullable RemoteLazyInputStream uploadStream;
263   uint64_t uploadStreamLength;
264   bool uploadStreamHasHeaders;
265   nsCString? contentType;
266   nsCString? contentLength;
269 union IPDLVariantValue
271   bool;
272   uint8_t;   // In practice, uint8_t and uint16_t are likely unneeded,
273   int16_t;   // as signed->unsigned->signed has universal behavior.
274   uint16_t;  // but those conversions are only guaranteed in C++20.
275   int32_t;
276   uint32_t;
277   float;
278   double;
279   nsID;
280   nsString;
281   nsCString;
282   nullable nsIURI;
283   nullable nsIPrincipal;
286 struct IDPLVariant
288   uint32_t type;  // We explicitly store the original nsIVariant type so that
289                   // the conversion back into a nsVariant later is lossless.
290   IPDLVariantValue data;
293 struct IPDLProperty
295   nsString name;
296   nullable nsIVariant value;
299 // Struct with information to show a frame from the parent process.
300 struct ParentShowInfo
302   nsString name;
303   bool fakeShowInfo;
304   bool isTransparent;
305   float dpi;
306   int32_t widgetRounding;
307   double defaultScale;
310 // Struct with information to show an iframe from the process that owns the
311 // frame.
312 struct OwnerShowInfo {
313   // This can be an IntSize rather than a Rect because content processes always
314   // render to a virtual <0, 0> top-left point.
315   ScreenIntSize size;
317   // TODO(emilio): Margin preferences go here.
318   ScrollbarPreference scrollbarPreference;
320   // TODO(emilio): I think we should really be able to figure this out from the
321   // parent process too instead.
322   nsSizeMode sizeMode;
325 struct IPCImage {
326     BigBuffer data;
327     uint32_t stride;
328     SurfaceFormat format;
329     ImageIntSize size;
332 } // namespace dom
333 } // namespace mozilla