2014-02-25 01:09:03 +04:00
|
|
|
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
|
2012-08-02 10:02:29 +04:00
|
|
|
/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2018-02-23 01:03:01 +03:00
|
|
|
include "mozilla/GfxMessageUtils.h";
|
2019-08-02 04:00:32 +03:00
|
|
|
include "mozilla/dom/DocShellMessageUtils.h";
|
2018-02-23 01:03:01 +03:00
|
|
|
include "mozilla/layers/LayersMessageUtils.h";
|
|
|
|
|
2017-04-24 13:09:40 +03:00
|
|
|
include IPCBlob;
|
2017-04-05 20:02:57 +03:00
|
|
|
include IPCStream;
|
2016-05-18 01:01:25 +03:00
|
|
|
include ProtocolTypes;
|
2012-08-02 10:02:29 +04:00
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
using struct mozilla::void_t
|
|
|
|
from "ipc/IPCMessageUtils.h";
|
|
|
|
|
|
|
|
using struct mozilla::SerializedStructuredCloneBuffer
|
|
|
|
from "ipc/IPCMessageUtils.h";
|
2012-08-02 10:02:29 +04:00
|
|
|
|
2017-03-09 14:30:26 +03:00
|
|
|
using LayoutDeviceIntRect from "Units.h";
|
|
|
|
using DesktopIntRect from "Units.h";
|
|
|
|
using DesktopToLayoutDeviceScale from "Units.h";
|
|
|
|
using CSSToLayoutDeviceScale from "Units.h";
|
2017-06-07 21:36:46 +03:00
|
|
|
using CSSRect from "Units.h";
|
|
|
|
using CSSSize from "Units.h";
|
|
|
|
using mozilla::LayoutDeviceIntPoint from "Units.h";
|
2018-08-29 23:54:56 +03:00
|
|
|
using hal::ScreenOrientation from "mozilla/HalScreenConfiguration.h";
|
2018-04-10 18:53:44 +03:00
|
|
|
using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h";
|
2018-08-30 01:21:25 +03:00
|
|
|
using refcounted class nsIPrincipal from "mozilla/dom/PermissionMessageUtils.h";
|
2019-02-14 00:02:55 +03:00
|
|
|
using refcounted class mozilla::dom::BrowsingContext from "mozilla/dom/BrowsingContext.h";
|
2018-12-20 01:22:09 +03:00
|
|
|
using refcounted class nsIURI from "mozilla/ipc/URIUtils.h";
|
2019-02-21 18:00:32 +03:00
|
|
|
using refcounted class nsIContentSecurityPolicy from "mozilla/dom/CSPMessageUtils.h";
|
2019-08-06 10:59:18 +03:00
|
|
|
using refcounted class nsIInputStream from "mozilla/ipc/IPCStreamUtils.h";
|
2019-03-15 08:11:43 +03:00
|
|
|
using refcounted class nsIReferrerInfo from "mozilla/dom/ReferrerInfoUtils.h";
|
2019-08-06 07:04:58 +03:00
|
|
|
using class mozilla::TimeStamp from "mozilla/TimeStamp.h";
|
2017-03-09 14:30:26 +03:00
|
|
|
|
2012-08-02 10:02:29 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2016-02-01 00:48:00 +03:00
|
|
|
struct MessagePortIdentifier
|
|
|
|
{
|
|
|
|
nsID uuid;
|
|
|
|
nsID destinationUuid;
|
|
|
|
uint32_t sequenceId;
|
|
|
|
bool neutered;
|
|
|
|
};
|
|
|
|
|
2016-11-07 16:38:02 +03:00
|
|
|
/**
|
|
|
|
* Cross-process representation for postMessage() style payloads where Blobs may
|
|
|
|
* be referenced/"cloned" and (optionally) messageports transferred. Use
|
|
|
|
* StructuredCloneData in your code to convert between this wire representation
|
|
|
|
* and the StructuredCloneData StructuredCloneHolder-subclass.
|
|
|
|
*/
|
2012-08-02 10:02:29 +04:00
|
|
|
struct ClonedMessageData
|
|
|
|
{
|
|
|
|
SerializedStructuredCloneBuffer data;
|
2017-04-24 13:09:40 +03:00
|
|
|
IPCBlob[] blobs;
|
2017-04-05 20:02:57 +03:00
|
|
|
IPCStream[] inputStreams;
|
2016-02-01 00:48:00 +03:00
|
|
|
MessagePortIdentifier[] identfiers;
|
2012-08-02 10:02:29 +04:00
|
|
|
};
|
|
|
|
|
2015-04-08 21:48:11 +03:00
|
|
|
union IPCDataTransferData
|
|
|
|
{
|
2015-04-16 22:38:12 +03:00
|
|
|
nsString; // text
|
2016-06-15 19:57:46 +03:00
|
|
|
Shmem; // images using Shmem
|
2017-04-24 13:16:50 +03:00
|
|
|
IPCBlob; // files
|
2015-04-16 22:38:12 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct IPCDataTransferImage
|
|
|
|
{
|
|
|
|
uint32_t width;
|
|
|
|
uint32_t height;
|
|
|
|
uint32_t stride;
|
2018-04-10 18:53:44 +03:00
|
|
|
SurfaceFormat format;
|
2015-04-08 21:48:11 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct IPCDataTransferItem
|
|
|
|
{
|
|
|
|
nsCString flavor;
|
2015-04-16 22:38:12 +03:00
|
|
|
// The image details are only used when transferring images.
|
|
|
|
IPCDataTransferImage imageDetails;
|
2015-04-08 21:48:11 +03:00
|
|
|
IPCDataTransferData data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IPCDataTransfer
|
|
|
|
{
|
|
|
|
IPCDataTransferItem[] items;
|
|
|
|
};
|
|
|
|
|
2017-03-09 14:30:26 +03:00
|
|
|
struct ScreenDetails {
|
|
|
|
LayoutDeviceIntRect rect;
|
|
|
|
DesktopIntRect rectDisplayPix;
|
|
|
|
LayoutDeviceIntRect availRect;
|
|
|
|
DesktopIntRect availRectDisplayPix;
|
|
|
|
int32_t pixelDepth;
|
|
|
|
int32_t colorDepth;
|
|
|
|
DesktopToLayoutDeviceScale contentsScaleFactor;
|
|
|
|
CSSToLayoutDeviceScale defaultCSSScaleFactor;
|
2017-06-06 13:09:34 +03:00
|
|
|
float dpi;
|
2017-03-09 14:30:26 +03:00
|
|
|
};
|
|
|
|
|
2017-06-07 21:36:46 +03:00
|
|
|
struct DimensionInfo
|
|
|
|
{
|
|
|
|
CSSRect rect;
|
|
|
|
CSSSize size;
|
2018-08-29 23:54:56 +03:00
|
|
|
ScreenOrientation orientation;
|
2017-06-07 21:36:46 +03:00
|
|
|
LayoutDeviceIntPoint clientOffset;
|
2017-11-22 22:21:37 +03:00
|
|
|
LayoutDeviceIntPoint chromeOffset;
|
2017-06-07 21:36:46 +03:00
|
|
|
};
|
|
|
|
|
2017-06-15 20:28:11 +03:00
|
|
|
struct FrameScriptInfo
|
|
|
|
{
|
|
|
|
nsString url;
|
|
|
|
bool runInGlobalScope;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The information required to complete a window creation request.
|
|
|
|
*/
|
|
|
|
struct CreatedWindowInfo
|
|
|
|
{
|
|
|
|
nsresult rv;
|
|
|
|
bool windowOpened;
|
|
|
|
FrameScriptInfo[] frameScripts;
|
|
|
|
nsCString urlToLoad;
|
|
|
|
uint32_t maxTouchPoints;
|
|
|
|
DimensionInfo dimensions;
|
2018-07-19 21:05:35 +03:00
|
|
|
bool hasSiblings;
|
2017-06-15 20:28:11 +03:00
|
|
|
};
|
|
|
|
|
2018-03-20 22:07:41 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* PerformanceInfo is used to pass performance info stored
|
2018-11-20 01:51:12 +03:00
|
|
|
* in WorkerPrivate and DocGroup instances, as well as
|
|
|
|
* memory-related information.
|
2018-03-20 22:07:41 +03:00
|
|
|
*
|
2018-07-10 10:58:48 +03:00
|
|
|
* Each (host, pid, windowId) is unique to a given DocGroup or
|
2018-03-20 22:07:41 +03:00
|
|
|
* Worker, and we collect the number of dispatches per Dispatch
|
2018-11-20 01:51:12 +03:00
|
|
|
* category and total execution duration as well as the current
|
|
|
|
* Zone JS Heap usage.
|
|
|
|
*
|
|
|
|
* This IPDL struct reflects the data collected in Performance counters,
|
|
|
|
* in addition of some memory usage information.
|
2018-03-20 22:07:41 +03:00
|
|
|
*
|
|
|
|
* see xpcom/threads/PerformanceCounter.h
|
|
|
|
*/
|
2018-11-20 01:51:12 +03:00
|
|
|
|
|
|
|
struct MediaMemoryInfo {
|
|
|
|
uint64_t audioSize;
|
|
|
|
uint64_t videoSize;
|
|
|
|
uint64_t resourcesSize;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PerformanceMemoryInfo {
|
|
|
|
MediaMemoryInfo media;
|
|
|
|
uint64_t domDom;
|
|
|
|
uint64_t domStyle;
|
|
|
|
uint64_t domOther;
|
|
|
|
uint64_t GCHeapUsage;
|
|
|
|
};
|
|
|
|
|
2018-03-20 22:07:41 +03:00
|
|
|
struct CategoryDispatch
|
|
|
|
{
|
|
|
|
// DispatchCategory value
|
|
|
|
uint16_t category;
|
|
|
|
// Number of dispatch
|
|
|
|
uint16_t count;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PerformanceInfo
|
|
|
|
{
|
|
|
|
// Host of the document, if any
|
|
|
|
nsCString host;
|
|
|
|
// process id
|
2018-04-04 14:36:25 +03:00
|
|
|
uint32_t pid;
|
2018-03-20 22:07:41 +03:00
|
|
|
// window id
|
2018-07-10 10:58:48 +03:00
|
|
|
uint64_t windowId;
|
2018-03-20 22:07:41 +03:00
|
|
|
// Execution time in microseconds
|
|
|
|
uint64_t duration;
|
2018-07-27 12:44:22 +03:00
|
|
|
// Counter ID (unique across processes)
|
|
|
|
uint64_t counterId;
|
2018-03-20 22:07:41 +03:00
|
|
|
// True if the data is collected in a worker
|
2018-07-10 10:58:48 +03:00
|
|
|
bool isWorker;
|
|
|
|
// True if the document window is the top window
|
|
|
|
bool isTopLevel;
|
2018-11-20 01:51:12 +03:00
|
|
|
// Memory
|
|
|
|
PerformanceMemoryInfo memory;
|
2018-03-20 22:07:41 +03:00
|
|
|
// Counters per category. For workers, a single entry
|
|
|
|
CategoryDispatch[] items;
|
|
|
|
};
|
|
|
|
|
2018-12-20 01:22:09 +03:00
|
|
|
|
2018-08-30 01:21:25 +03:00
|
|
|
struct WindowGlobalInit
|
|
|
|
{
|
|
|
|
nsIPrincipal principal;
|
2019-04-09 14:58:35 +03:00
|
|
|
nsIURI documentURI;
|
2019-02-14 00:02:55 +03:00
|
|
|
BrowsingContext browsingContext;
|
2018-10-20 23:04:00 +03:00
|
|
|
uint64_t innerWindowId;
|
|
|
|
uint64_t outerWindowId;
|
2018-08-30 01:21:25 +03:00
|
|
|
};
|
|
|
|
|
2018-12-20 01:22:09 +03:00
|
|
|
struct DocShellLoadStateInit
|
|
|
|
{
|
|
|
|
nsIURI URI;
|
|
|
|
nsIURI OriginalURI;
|
|
|
|
nsIURI ResultPrincipalURI;
|
|
|
|
bool ResultPrincipalURIIsSome;
|
|
|
|
nsIPrincipal TriggeringPrincipal;
|
2019-03-15 08:11:43 +03:00
|
|
|
nsIReferrerInfo ReferrerInfo;
|
2018-12-20 01:22:09 +03:00
|
|
|
bool KeepResultPrincipalURIIfSet;
|
|
|
|
bool LoadReplace;
|
|
|
|
bool InheritPrincipal;
|
|
|
|
bool PrincipalIsExplicit;
|
|
|
|
nsIPrincipal PrincipalToInherit;
|
|
|
|
bool ForceAllowDataURI;
|
|
|
|
bool OriginalFrameSrc;
|
2019-07-30 22:45:36 +03:00
|
|
|
bool IsFormSubmission;
|
2018-12-20 01:22:09 +03:00
|
|
|
uint32_t LoadType;
|
|
|
|
nsString Target;
|
|
|
|
nsIURI BaseURI;
|
|
|
|
uint32_t LoadFlags;
|
|
|
|
bool FirstParty;
|
|
|
|
nsCString TypeHint;
|
|
|
|
nsString FileName;
|
|
|
|
bool IsFromProcessingFrameAttributes;
|
2019-02-21 18:00:32 +03:00
|
|
|
// The Content Security Policy of the load, that is, the CSP of the entity
|
|
|
|
// responsible for causing the load to occur. Most likely this is the CSP
|
|
|
|
// of the document that started the load. In case the entity starting the
|
|
|
|
// load did not use a CSP, then Csp can be null. Please note that this is
|
|
|
|
// also the CSP that will be applied to the load in case the load
|
|
|
|
// encounters a server side redirect.
|
|
|
|
nsIContentSecurityPolicy Csp;
|
2019-08-06 10:59:18 +03:00
|
|
|
|
|
|
|
nsIInputStream PostDataStream;
|
|
|
|
nsIInputStream HeadersStream;
|
|
|
|
|
2018-12-20 01:22:09 +03:00
|
|
|
// Fields missing due to lack of need or serialization
|
|
|
|
// nsCOMPtr<nsISHEntry> mSHEntry;
|
|
|
|
// nsCOMPtr<nsIDocShell> mSourceDocShell;
|
|
|
|
// bool mIsSrcDocLoad; // useless without sourcedocshell
|
|
|
|
// nsString mSrcdocData; // useless without sourcedocshell
|
2019-01-24 00:07:08 +03:00
|
|
|
// nsIChannel pendingRedirectedChannel; // sent through other mechanism
|
2018-12-20 01:22:09 +03:00
|
|
|
};
|
|
|
|
|
2019-08-06 07:04:58 +03:00
|
|
|
struct TimedChannelInfo
|
|
|
|
{
|
|
|
|
bool timingEnabled;
|
|
|
|
int8_t redirectCount;
|
|
|
|
int8_t internalRedirectCount;
|
|
|
|
TimeStamp asyncOpen;
|
|
|
|
TimeStamp channelCreation;
|
|
|
|
TimeStamp redirectStart;
|
|
|
|
TimeStamp redirectEnd;
|
|
|
|
nsString initiatorType;
|
|
|
|
bool allRedirectsSameOrigin;
|
|
|
|
bool allRedirectsPassTimingAllowCheck;
|
|
|
|
bool? timingAllowCheckForPrincipal;
|
|
|
|
TimeStamp launchServiceWorkerStart;
|
|
|
|
TimeStamp launchServiceWorkerEnd;
|
|
|
|
TimeStamp dispatchFetchEventStart;
|
|
|
|
TimeStamp dispatchFetchEventEnd;
|
|
|
|
TimeStamp handleFetchEventStart;
|
|
|
|
TimeStamp handleFetchEventEnd;
|
|
|
|
TimeStamp responseStart;
|
|
|
|
TimeStamp responseEnd;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ReplacementChannelConfigInit
|
|
|
|
{
|
|
|
|
uint32_t loadFlags;
|
|
|
|
uint32_t redirectFlags;
|
|
|
|
uint32_t classOfService;
|
|
|
|
bool? privateBrowsing;
|
|
|
|
nsCString? method;
|
|
|
|
nsIReferrerInfo referrerInfo;
|
|
|
|
TimedChannelInfo? timedChannel;
|
|
|
|
};
|
|
|
|
|
2012-08-02 10:02:29 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|