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/GfxMessageUtils.h";
8 include "mozilla/dom/CSPMessageUtils.h";
9 include "mozilla/dom/DocShellMessageUtils.h";
10 include "mozilla/dom/PermissionMessageUtils.h";
11 include "mozilla/dom/PropertyBagUtils.h";
12 include "mozilla/dom/ReferrerInfoUtils.h";
13 include "mozilla/dom/TabMessageUtils.h";
14 include "mozilla/ipc/URIUtils.h";
15 include "mozilla/layers/LayersMessageUtils.h";
16 include "mozilla/net/ClassOfService.h";
20 include ProtocolTypes;
22 using struct mozilla::void_t from "mozilla/ipc/IPCCore.h";
24 [MoveOnly=data] using struct mozilla::SerializedStructuredCloneBuffer
25 from "mozilla/ipc/SerializedStructuredCloneBuffer.h";
27 using struct mozilla::dom::LoadingSessionHistoryInfo
28 from "mozilla/dom/SessionHistoryEntry.h";
30 using mozilla::net::ClassOfService from "mozilla/net/ClassOfService.h";
33 using mozilla::hal::ScreenOrientation from "mozilla/HalIPCUtils.h";
34 using mozilla::LayoutDeviceIntRect from "Units.h";
35 using mozilla::DesktopIntRect from "Units.h";
36 using mozilla::DesktopToLayoutDeviceScale from "Units.h";
37 using mozilla::CSSToLayoutDeviceScale from "Units.h";
38 using mozilla::CSSRect from "Units.h";
39 using mozilla::CSSSize from "Units.h";
40 using mozilla::ScreenIntSize from "Units.h";
41 using mozilla::LayoutDeviceIntPoint from "Units.h";
42 using nsSizeMode from "nsIWidgetListener.h";
43 using mozilla::ScrollbarPreference from "mozilla/ScrollbarPreferences.h";
44 using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h";
45 [RefCounted] using class nsIPrincipal from "nsIPrincipal.h";
46 using mozilla::dom::MaybeDiscardedBrowsingContext from "mozilla/dom/BrowsingContext.h";
47 [RefCounted] using class nsIURI from "nsIURI.h";
48 [RefCounted] using class nsIContentSecurityPolicy from "nsIContentSecurityPolicy.h";
49 [RefCounted] using class nsIInputStream from "mozilla/ipc/IPCStreamUtils.h";
50 [RefCounted] using class nsIReferrerInfo from "nsIReferrerInfo.h";
51 [RefCounted] using class nsIVariant from "nsIVariant.h";
52 using mozilla::TimeStamp from "mozilla/TimeStamp.h";
53 [RefCounted] using class mozilla::RemoteLazyInputStream from "mozilla/RemoteLazyInputStream.h";
54 [MoveOnly] using class mozilla::ipc::BigBuffer from "mozilla/ipc/BigBuffer.h";
59 struct MessagePortIdentifier
68 * Cross-process representation for postMessage() style payloads where Blobs may
69 * be referenced/"cloned" and (optionally) messageports transferred. Use
70 * StructuredCloneData in your code to convert between this wire representation
71 * and the StructuredCloneData StructuredCloneHolder-subclass.
73 struct ClonedMessageData
75 SerializedStructuredCloneBuffer data;
77 IPCStream[] inputStreams;
78 MessagePortIdentifier[] identifiers;
81 struct ErrorMessageData {
84 union ClonedOrErrorMessageData {
89 struct RefMessageData {
93 union MessageDataType {
100 MessageDataType data;
103 struct ScreenDetails {
104 LayoutDeviceIntRect rect;
105 DesktopIntRect rectDisplayPix;
106 LayoutDeviceIntRect availRect;
107 DesktopIntRect availRectDisplayPix;
110 uint32_t refreshRate; // In Hz, or 0 if not known.
111 DesktopToLayoutDeviceScale contentsScaleFactor;
112 CSSToLayoutDeviceScale defaultCSSScaleFactor;
114 ScreenOrientation orientation;
115 uint16_t orientationAngle;
116 bool isPseudoDisplay;
123 LayoutDeviceIntPoint clientOffset;
124 LayoutDeviceIntPoint chromeOffset;
127 struct FrameScriptInfo
130 bool runInGlobalScope;
133 struct FeaturePolicyInfo
135 nsString[] inheritedDeniedFeatureNames;
136 nsString[] attributeEnabledFeatureNames;
137 nsString declaredString;
138 nullable nsIPrincipal defaultOrigin;
139 nullable nsIPrincipal selfOrigin;
140 nullable nsIPrincipal srcOrigin;
144 * The information required to complete a window creation request.
146 struct CreatedWindowInfo
150 FrameScriptInfo[] frameScripts;
151 uint32_t maxTouchPoints;
152 DimensionInfo dimensions;
156 struct DocShellLoadStateInit
159 nullable nsIURI OriginalURI;
160 nullable nsIURI ResultPrincipalURI;
161 nullable nsIPrincipal TriggeringPrincipal;
162 nullable nsIReferrerInfo ReferrerInfo;
163 nullable nsIPrincipal PrincipalToInherit;
164 nullable nsIPrincipal PartitionedPrincipalToInherit;
165 nullable nsIURI BaseURI;
166 // The Content Security Policy of the load, that is, the CSP of the entity
167 // responsible for causing the load to occur. Most likely this is the CSP
168 // of the document that started the load. In case the entity starting the
169 // load did not use a CSP, then Csp can be null. Please note that this is
170 // also the CSP that will be applied to the load in case the load
171 // encounters a server side redirect.
172 nullable nsIContentSecurityPolicy Csp;
173 nullable nsIInputStream PostDataStream;
174 nullable nsIInputStream HeadersStream;
175 nullable nsIURI UnstrippedURI;
176 uint64_t LoadIdentifier;
181 MaybeDiscardedBrowsingContext SourceBrowsingContext;
182 MaybeDiscardedBrowsingContext TargetBrowsingContext;
184 // The provided remote type of the process responsible for causing the load to
185 // occur. Validated in the parent process.
186 nsCString TriggeringRemoteType;
188 nsString SrcdocData; // useless without sourcedocshell
190 nsCString? OriginalURIString;
192 nsCString? RemoteTypeOverride;
194 LoadingSessionHistoryInfo? loadingSessionHistoryInfo;
198 uint32_t InternalLoadFlags;
200 // The TriggineringSandboxFlags are the SandboxFlags of the entity
201 // responsible for causing the load to occur.
202 uint32_t TriggeringSandboxFlags;
203 int32_t? CancelContentJSEpoch;
205 bool ResultPrincipalURIIsSome;
206 bool KeepResultPrincipalURIIfSet;
208 bool InheritPrincipal;
209 bool PrincipalIsExplicit;
210 bool ForceAllowDataURI;
211 bool IsExemptFromHTTPSOnlyMode;
212 bool OriginalFrameSrc;
213 bool IsFormSubmission;
215 bool HasValidUserGestureActivation;
217 bool IsFromProcessingFrameAttributes;
219 // Fields missing due to lack of need or serialization
220 // nsCOMPtr<nsIDocShell> mSourceDocShell;
221 // bool mIsSrcDocLoad; // useless without sourcedocshell
222 // nsIChannel pendingRedirectedChannel; // sent through other mechanism
224 bool ChannelInitialized;
226 bool TryToReplaceWithSessionHistoryLoad;
231 struct TimedChannelInfo
234 int8_t redirectCount;
235 int8_t internalRedirectCount;
237 TimeStamp channelCreation;
238 TimeStamp redirectStart;
239 TimeStamp redirectEnd;
240 nsString initiatorType;
241 bool allRedirectsSameOrigin;
242 bool allRedirectsPassTimingAllowCheck;
243 bool? timingAllowCheckForPrincipal;
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;
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
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.
283 nullable nsIPrincipal;
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;
296 nullable nsIVariant value;
299 // Struct with information to show a frame from the parent process.
300 struct ParentShowInfo
306 int32_t widgetRounding;
310 // Struct with information to show an iframe from the process that owns the
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.
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.
326 } // namespace mozilla