2013-06-22 20:09:19 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set sw=2 ts=8 et tw=80 ft=c: */
|
|
|
|
|
|
|
|
/* 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/. */
|
|
|
|
|
2014-03-11 02:04:28 +04:00
|
|
|
include protocol PHttpChannel;
|
|
|
|
include protocol PFTPChannel;
|
2017-03-14 14:28:58 +03:00
|
|
|
include protocol PChildToParentStream;
|
2016-05-18 01:01:25 +03:00
|
|
|
include BlobTypes;
|
2018-01-23 18:38:52 +03:00
|
|
|
include ClientIPCTypes;
|
2013-06-22 20:09:19 +04:00
|
|
|
include URIParams;
|
2018-01-23 18:38:52 +03:00
|
|
|
include IPCServiceWorkerDescriptor;
|
2016-09-29 01:38:26 +03:00
|
|
|
include IPCStream;
|
2014-09-21 20:40:27 +04:00
|
|
|
include PBackgroundSharedTypes;
|
2019-02-16 01:28:56 +03:00
|
|
|
include DOMTypes;
|
2013-06-22 20:09:19 +04:00
|
|
|
|
2017-01-12 19:38:48 +03:00
|
|
|
using mozilla::OriginAttributes from "mozilla/ipc/BackgroundUtils.h";
|
2013-10-01 23:25:07 +04:00
|
|
|
using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
|
|
|
|
using RequestHeaderTuples from "mozilla/net/PHttpChannelParams.h";
|
|
|
|
using struct nsHttpAtom from "nsHttp.h";
|
2018-02-23 00:35:38 +03:00
|
|
|
using class mozilla::net::nsHttpResponseHead from "nsHttpResponseHead.h";
|
2017-04-10 16:13:21 +03:00
|
|
|
using class mozilla::TimeStamp from "mozilla/TimeStamp.h";
|
2019-02-16 01:02:58 +03:00
|
|
|
using nsILoadInfo::CrossOriginOpenerPolicy from "ipc/IPCMessageUtils.h";
|
2013-06-22 20:09:19 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
2019-03-08 12:00:06 +03:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// CookieSettings IPDL structs
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
struct CookiePermissionData
|
|
|
|
{
|
|
|
|
PrincipalInfo principalInfo;
|
|
|
|
uint32_t cookiePermission;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CookieSettingsArgs
|
|
|
|
{
|
|
|
|
// Copy of the cookie behavior and permissions for the top-level document.
|
|
|
|
uint32_t cookieBehavior;
|
|
|
|
CookiePermissionData[] cookiePermissions;
|
|
|
|
bool isFixed;
|
|
|
|
};
|
|
|
|
|
2019-02-20 13:05:42 +03:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Preferrer alternative data type
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
struct PreferredAlternativeDataTypeParams
|
|
|
|
{
|
|
|
|
nsCString type;
|
|
|
|
nsCString contentType;
|
|
|
|
bool deliverAltData;
|
|
|
|
};
|
|
|
|
|
2015-06-19 01:37:20 +03:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// LoadInfo IPDL structs
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2017-05-25 20:42:00 +03:00
|
|
|
struct RedirectHistoryEntryInfo
|
|
|
|
{
|
|
|
|
PrincipalInfo principalInfo;
|
2019-03-06 17:05:50 +03:00
|
|
|
URIParams? referrerUri;
|
2017-05-25 20:42:00 +03:00
|
|
|
nsCString remoteAddress;
|
|
|
|
};
|
|
|
|
|
2015-06-19 01:37:20 +03:00
|
|
|
struct LoadInfoArgs
|
|
|
|
{
|
2019-03-05 17:41:42 +03:00
|
|
|
PrincipalInfo? requestingPrincipalInfo;
|
2017-05-25 20:42:00 +03:00
|
|
|
PrincipalInfo triggeringPrincipalInfo;
|
2019-03-05 17:41:42 +03:00
|
|
|
PrincipalInfo? principalToInheritInfo;
|
|
|
|
PrincipalInfo? sandboxedLoadingPrincipalInfo;
|
|
|
|
PrincipalInfo? topLevelPrincipalInfo;
|
|
|
|
PrincipalInfo? topLevelStorageAreaPrincipalInfo;
|
2019-03-06 17:05:50 +03:00
|
|
|
URIParams? resultPrincipalURI;
|
2017-05-25 20:42:00 +03:00
|
|
|
uint32_t securityFlags;
|
|
|
|
uint32_t contentPolicyType;
|
|
|
|
uint32_t tainting;
|
|
|
|
bool upgradeInsecureRequests;
|
2018-02-05 18:37:27 +03:00
|
|
|
bool browserUpgradeInsecureRequests;
|
2018-03-04 17:33:33 +03:00
|
|
|
bool browserWouldUpgradeInsecureRequests;
|
2017-05-25 20:42:00 +03:00
|
|
|
bool verifySignedContent;
|
|
|
|
bool enforceSRI;
|
2017-11-08 22:01:41 +03:00
|
|
|
bool forceAllowDataURI;
|
2018-02-18 21:52:52 +03:00
|
|
|
bool allowInsecureRedirectToDataURI;
|
2018-03-29 12:14:35 +03:00
|
|
|
bool skipContentPolicyCheckForWebRequest;
|
2017-05-25 20:42:00 +03:00
|
|
|
bool forceInheritPrincipalDropped;
|
|
|
|
uint64_t innerWindowID;
|
|
|
|
uint64_t outerWindowID;
|
|
|
|
uint64_t parentOuterWindowID;
|
2017-09-07 00:25:23 +03:00
|
|
|
uint64_t topOuterWindowID;
|
2017-05-25 20:42:00 +03:00
|
|
|
uint64_t frameOuterWindowID;
|
2019-01-24 00:06:59 +03:00
|
|
|
uint64_t browsingContextID;
|
2019-02-15 22:49:04 +03:00
|
|
|
uint64_t frameBrowsingContextID;
|
2017-05-25 20:42:00 +03:00
|
|
|
bool initialSecurityCheckDone;
|
|
|
|
bool isInThirdPartyContext;
|
2018-01-23 18:38:51 +03:00
|
|
|
bool isDocshellReload;
|
2018-08-01 07:35:24 +03:00
|
|
|
bool sendCSPViolationEvents;
|
2017-05-25 20:42:00 +03:00
|
|
|
OriginAttributes originAttributes;
|
|
|
|
RedirectHistoryEntryInfo[] redirectChainIncludingInternalRedirects;
|
|
|
|
RedirectHistoryEntryInfo[] redirectChain;
|
2017-10-10 19:54:00 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Ancestor data for use with the WebRequest API.
|
|
|
|
* See nsILoadInfo.idl for details.
|
|
|
|
*/
|
|
|
|
PrincipalInfo[] ancestorPrincipals;
|
|
|
|
uint64_t[] ancestorOuterWindowIDs;
|
|
|
|
|
2018-01-23 18:38:52 +03:00
|
|
|
/**
|
|
|
|
* ClientInfo structure representing the window or worker that triggered
|
2019-03-06 20:57:04 +03:00
|
|
|
* this network request. May be Nothing if its a system internal request.
|
2018-01-23 18:38:52 +03:00
|
|
|
*/
|
2019-03-06 20:57:04 +03:00
|
|
|
IPCClientInfo? clientInfo;
|
2018-01-23 18:38:52 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Non-subresource requests will result in the creation of a window or
|
|
|
|
* worker client. The reserved and initial ClientInfo values represent
|
|
|
|
* this resulting client. An initial ClientInfo represents an initial
|
|
|
|
* about:blank window that will be re-used while a reserved ClientInfo
|
|
|
|
* represents a to-be-newly-created window/worker.
|
|
|
|
*/
|
2019-03-06 20:57:04 +03:00
|
|
|
IPCClientInfo? reservedClientInfo;
|
|
|
|
IPCClientInfo? initialClientInfo;
|
2018-01-23 18:38:52 +03:00
|
|
|
|
2018-01-23 18:38:52 +03:00
|
|
|
/**
|
|
|
|
* Subresource loads may have a controller set based on their owning
|
|
|
|
* window/worker client. We must send this across IPC to support
|
|
|
|
* performing interception in the parent.
|
|
|
|
*/
|
|
|
|
OptionalIPCServiceWorkerDescriptor controller;
|
|
|
|
|
2017-05-25 20:42:00 +03:00
|
|
|
nsCString[] corsUnsafeHeaders;
|
|
|
|
bool forcePreflight;
|
|
|
|
bool isPreflight;
|
2017-11-03 15:23:11 +03:00
|
|
|
bool loadTriggeredFromExternal;
|
2017-11-03 10:37:35 +03:00
|
|
|
bool serviceWorkerTaintingSynthesized;
|
2018-08-31 14:21:17 +03:00
|
|
|
bool documentHasUserInteracted;
|
2018-09-28 22:12:10 +03:00
|
|
|
bool documentHasLoaded;
|
2019-02-13 22:45:29 +03:00
|
|
|
nsString cspNonce;
|
2018-11-21 19:28:20 +03:00
|
|
|
bool isFromProcessingFrameAttributes;
|
2019-02-16 01:02:58 +03:00
|
|
|
CrossOriginOpenerPolicy openerPolicy;
|
2019-03-08 12:00:06 +03:00
|
|
|
|
|
|
|
CookieSettingsArgs cookieSettings;
|
2015-06-19 01:37:20 +03:00
|
|
|
};
|
|
|
|
|
2018-03-06 09:07:00 +03:00
|
|
|
/**
|
|
|
|
* This structure is used to carry selected properties of a LoadInfo
|
|
|
|
* object to child processes to merge LoadInfo changes from the parent
|
|
|
|
* process. We don't want to use LoadInfoArgs for that since it's
|
|
|
|
* too huge and we only care about small subpart of properties anyway.
|
|
|
|
*/
|
|
|
|
struct ParentLoadInfoForwarderArgs
|
|
|
|
{
|
|
|
|
// WebExtextensions' WebRequest API allows extensions to intercept and
|
|
|
|
// redirect a channel to a data URI. This modifications happens in
|
|
|
|
// the parent and needs to be mirrored to the child so that security
|
|
|
|
// checks can pass.
|
|
|
|
bool allowInsecureRedirectToDataURI;
|
|
|
|
|
2018-06-04 19:26:50 +03:00
|
|
|
// The ServiceWorker controller that may be set in the parent when
|
|
|
|
// interception occurs.
|
|
|
|
OptionalIPCServiceWorkerDescriptor controller;
|
|
|
|
|
2018-06-11 22:54:22 +03:00
|
|
|
// The service worker may synthesize a Response with a particular
|
|
|
|
// tainting value.
|
|
|
|
uint32_t tainting;
|
|
|
|
|
|
|
|
// We must also note that the tainting value was explicitly set
|
|
|
|
// by the service worker.
|
|
|
|
bool serviceWorkerTaintingSynthesized;
|
|
|
|
|
2018-08-31 14:21:17 +03:00
|
|
|
bool documentHasUserInteracted;
|
2018-09-28 22:12:10 +03:00
|
|
|
bool documentHasLoaded;
|
2018-08-16 18:29:22 +03:00
|
|
|
|
2019-02-16 01:02:58 +03:00
|
|
|
CrossOriginOpenerPolicy openerPolicy;
|
|
|
|
|
2019-03-08 12:00:06 +03:00
|
|
|
CookieSettingsArgs? cookieSettings;
|
|
|
|
|
2018-03-06 09:07:00 +03:00
|
|
|
// IMPORTANT: when you add new properites here you must also update
|
|
|
|
// LoadInfoToParentLoadInfoForwarder and MergeParentLoadInfoForwarder
|
|
|
|
// in BackgroundUtils.cpp/.h!
|
|
|
|
};
|
|
|
|
|
2018-06-04 19:26:51 +03:00
|
|
|
/**
|
|
|
|
* This structure is used to carry selected properties of a LoadInfo
|
|
|
|
* object to the parent process that might have changed in the child
|
|
|
|
* during a redirect. We don't want to use LoadInfoArgs for that since
|
|
|
|
* it's too huge and we only care about small subpart of properties
|
|
|
|
* anyway.
|
|
|
|
*/
|
|
|
|
struct ChildLoadInfoForwarderArgs
|
|
|
|
{
|
|
|
|
// The reserved and initial ClientInfo values may change during a
|
|
|
|
// redirect if the new channel is cross-origin to the old channel.
|
2019-03-06 20:57:04 +03:00
|
|
|
IPCClientInfo? reservedClientInfo;
|
|
|
|
IPCClientInfo? initialClientInfo;
|
2018-06-04 19:26:51 +03:00
|
|
|
|
|
|
|
// The ServiceWorker controller may be cleared in the child during
|
|
|
|
// a redirect.
|
|
|
|
OptionalIPCServiceWorkerDescriptor controller;
|
|
|
|
};
|
|
|
|
|
2013-06-22 20:09:19 +04:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HTTP IPDL structs
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2015-08-31 23:36:22 +03:00
|
|
|
struct CorsPreflightArgs
|
|
|
|
{
|
|
|
|
nsCString[] unsafeHeaders;
|
|
|
|
};
|
|
|
|
|
|
|
|
union OptionalCorsPreflightArgs
|
|
|
|
{
|
|
|
|
void_t;
|
|
|
|
CorsPreflightArgs;
|
|
|
|
};
|
|
|
|
|
2013-06-22 20:09:19 +04:00
|
|
|
struct HttpChannelOpenArgs
|
|
|
|
{
|
|
|
|
URIParams uri;
|
|
|
|
// - TODO: bug 571161: unclear if any HTTP channel clients ever
|
|
|
|
// set originalURI != uri (about:credits?); also not clear if
|
|
|
|
// chrome channel would ever need to know. Get rid of next arg?
|
2019-03-06 17:05:50 +03:00
|
|
|
URIParams? original;
|
|
|
|
URIParams? doc;
|
|
|
|
URIParams? originalReferrer;
|
2014-11-18 16:46:35 +03:00
|
|
|
uint32_t referrerPolicy;
|
2019-03-06 17:05:50 +03:00
|
|
|
URIParams? apiRedirectTo;
|
|
|
|
URIParams? topWindowURI;
|
2019-02-16 01:28:56 +03:00
|
|
|
nsIPrincipal topWindowPrincipal;
|
2013-06-22 20:09:19 +04:00
|
|
|
uint32_t loadFlags;
|
|
|
|
RequestHeaderTuples requestHeaders;
|
2014-03-18 20:36:18 +04:00
|
|
|
nsCString requestMethod;
|
2019-02-22 21:46:14 +03:00
|
|
|
IPCStream? uploadStream;
|
2013-06-22 20:09:19 +04:00
|
|
|
bool uploadStreamHasHeaders;
|
2017-02-09 12:28:54 +03:00
|
|
|
int16_t priority;
|
2014-12-06 22:26:50 +03:00
|
|
|
uint32_t classOfService;
|
2013-06-22 20:09:19 +04:00
|
|
|
uint8_t redirectionLimit;
|
2014-06-04 20:57:15 +04:00
|
|
|
bool allowSTS;
|
2014-10-28 16:23:00 +03:00
|
|
|
uint32_t thirdPartyFlags;
|
2013-06-22 20:09:19 +04:00
|
|
|
bool resumeAt;
|
|
|
|
uint64_t startPos;
|
|
|
|
nsCString entityID;
|
|
|
|
bool chooseApplicationCache;
|
|
|
|
nsCString appCacheClientID;
|
|
|
|
bool allowSpdy;
|
2015-04-13 19:59:34 +03:00
|
|
|
bool allowAltSvc;
|
2016-12-03 00:49:23 +03:00
|
|
|
bool beConservative;
|
2017-08-16 22:41:16 +03:00
|
|
|
uint32_t tlsFlags;
|
2019-03-04 09:30:00 +03:00
|
|
|
LoadInfoArgs? loadInfo;
|
2019-03-13 21:46:59 +03:00
|
|
|
nsHttpResponseHead? synthesizedResponseHead;
|
2015-08-20 00:50:34 +03:00
|
|
|
nsCString synthesizedSecurityInfoSerialization;
|
2015-05-14 20:05:34 +03:00
|
|
|
uint32_t cacheKey;
|
2017-03-23 17:40:36 +03:00
|
|
|
uint64_t requestContextID;
|
2015-08-31 23:36:22 +03:00
|
|
|
OptionalCorsPreflightArgs preflightArgs;
|
2015-09-11 22:53:27 +03:00
|
|
|
uint32_t initialRwin;
|
2015-12-30 21:47:55 +03:00
|
|
|
bool blockAuthPrompt;
|
2015-12-23 23:20:53 +03:00
|
|
|
bool suspendAfterSynthesizeResponse;
|
2016-01-19 17:28:00 +03:00
|
|
|
bool allowStaleCacheContent;
|
2016-03-16 09:03:57 +03:00
|
|
|
nsCString contentTypeHint;
|
2018-01-24 20:47:15 +03:00
|
|
|
uint32_t corsMode;
|
|
|
|
uint32_t redirectMode;
|
2017-03-24 00:01:21 +03:00
|
|
|
uint64_t channelId;
|
2018-06-12 19:53:54 +03:00
|
|
|
nsString integrityMetadata;
|
2016-12-16 05:42:00 +03:00
|
|
|
uint64_t contentWindowId;
|
2019-02-20 13:05:42 +03:00
|
|
|
PreferredAlternativeDataTypeParams[] preferredAlternativeTypes;
|
2017-03-09 10:55:00 +03:00
|
|
|
uint64_t topLevelOuterContentWindowId;
|
2017-04-10 16:13:21 +03:00
|
|
|
TimeStamp launchServiceWorkerStart;
|
|
|
|
TimeStamp launchServiceWorkerEnd;
|
|
|
|
TimeStamp dispatchFetchEventStart;
|
|
|
|
TimeStamp dispatchFetchEventEnd;
|
|
|
|
TimeStamp handleFetchEventStart;
|
|
|
|
TimeStamp handleFetchEventEnd;
|
2017-08-18 19:36:50 +03:00
|
|
|
bool forceMainDocumentChannel;
|
2018-07-23 05:28:00 +03:00
|
|
|
TimeStamp navigationStartTimeStamp;
|
2013-06-22 20:09:19 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct HttpChannelConnectArgs
|
|
|
|
{
|
2016-06-01 22:29:21 +03:00
|
|
|
uint32_t registrarId;
|
2015-05-28 17:47:35 +03:00
|
|
|
bool shouldIntercept;
|
2013-06-22 20:09:19 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
union HttpChannelCreationArgs
|
|
|
|
{
|
|
|
|
HttpChannelOpenArgs; // For AsyncOpen: the common case.
|
|
|
|
HttpChannelConnectArgs; // Used for redirected-to channels
|
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// FTP IPDL structs
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
struct FTPChannelOpenArgs
|
|
|
|
{
|
2014-09-21 20:40:27 +04:00
|
|
|
URIParams uri;
|
|
|
|
uint64_t startPos;
|
|
|
|
nsCString entityID;
|
2019-02-22 21:46:14 +03:00
|
|
|
IPCStream? uploadStream;
|
2019-03-04 09:30:00 +03:00
|
|
|
LoadInfoArgs? loadInfo;
|
2018-05-21 23:24:25 +03:00
|
|
|
uint32_t loadFlags;
|
2013-06-22 20:09:19 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct FTPChannelConnectArgs
|
|
|
|
{
|
|
|
|
uint32_t channelId;
|
|
|
|
};
|
|
|
|
|
|
|
|
union FTPChannelCreationArgs
|
|
|
|
{
|
|
|
|
FTPChannelOpenArgs; // For AsyncOpen: the common case.
|
|
|
|
FTPChannelConnectArgs; // Used for redirected-to channels
|
|
|
|
};
|
|
|
|
|
2014-10-22 03:40:08 +04:00
|
|
|
struct HttpChannelDiverterArgs
|
|
|
|
{
|
|
|
|
PHttpChannel mChannel;
|
|
|
|
bool mApplyConversion;
|
|
|
|
};
|
|
|
|
|
2014-03-11 02:04:28 +04:00
|
|
|
union ChannelDiverterArgs
|
|
|
|
{
|
2014-10-22 03:40:08 +04:00
|
|
|
HttpChannelDiverterArgs;
|
2014-03-11 02:04:28 +04:00
|
|
|
PFTPChannel;
|
|
|
|
};
|
|
|
|
|
2017-08-03 14:00:41 +03:00
|
|
|
struct CookieStruct
|
|
|
|
{
|
|
|
|
nsCString name;
|
|
|
|
nsCString value;
|
|
|
|
nsCString host;
|
|
|
|
nsCString path;
|
|
|
|
int64_t expiry;
|
|
|
|
int64_t lastAccessed;
|
|
|
|
int64_t creationTime;
|
2017-12-14 22:29:32 +03:00
|
|
|
bool isHttpOnly;
|
2017-08-03 14:00:41 +03:00
|
|
|
bool isSession;
|
|
|
|
bool isSecure;
|
2017-09-24 20:27:04 +03:00
|
|
|
int8_t sameSite;
|
2017-08-03 14:00:41 +03:00
|
|
|
};
|
|
|
|
|
2013-06-22 20:09:19 +04:00
|
|
|
} // namespace ipc
|
|
|
|
} // namespace mozilla
|