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;
|
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";
|
2015-04-18 01:59:10 +03:00
|
|
|
using class nsHttpResponseHead from "nsHttpResponseHead.h";
|
2017-04-10 16:13:21 +03:00
|
|
|
using class mozilla::TimeStamp from "mozilla/TimeStamp.h";
|
2013-06-22 20:09:19 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
2015-06-19 01:37:20 +03:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// LoadInfo IPDL structs
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2017-05-25 20:42:00 +03:00
|
|
|
struct RedirectHistoryEntryInfo
|
|
|
|
{
|
|
|
|
PrincipalInfo principalInfo;
|
|
|
|
OptionalURIParams referrerUri;
|
|
|
|
nsCString remoteAddress;
|
|
|
|
};
|
|
|
|
|
2015-06-19 01:37:20 +03:00
|
|
|
struct LoadInfoArgs
|
|
|
|
{
|
2017-05-25 20:42:00 +03:00
|
|
|
OptionalPrincipalInfo requestingPrincipalInfo;
|
|
|
|
PrincipalInfo triggeringPrincipalInfo;
|
|
|
|
OptionalPrincipalInfo principalToInheritInfo;
|
|
|
|
OptionalPrincipalInfo sandboxedLoadingPrincipalInfo;
|
2017-05-30 19:07:59 +03:00
|
|
|
OptionalURIParams 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;
|
2017-05-25 20:42:00 +03:00
|
|
|
bool verifySignedContent;
|
|
|
|
bool enforceSRI;
|
2018-02-01 16:07:01 +03:00
|
|
|
bool allowDocumentToBeAgnosticToCSP;
|
2017-11-08 22:01:41 +03:00
|
|
|
bool forceAllowDataURI;
|
2018-02-18 21:52:52 +03:00
|
|
|
bool allowInsecureRedirectToDataURI;
|
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;
|
|
|
|
bool enforceSecurity;
|
|
|
|
bool initialSecurityCheckDone;
|
|
|
|
bool isInThirdPartyContext;
|
2018-01-23 18:38:51 +03:00
|
|
|
bool isDocshellReload;
|
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
|
|
|
|
* this network request. May be void_t if its a system internal request.
|
|
|
|
*/
|
|
|
|
OptionalIPCClientInfo clientInfo;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
OptionalIPCClientInfo reservedClientInfo;
|
|
|
|
OptionalIPCClientInfo initialClientInfo;
|
|
|
|
|
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;
|
2015-06-19 01:37:20 +03:00
|
|
|
};
|
|
|
|
|
2015-07-14 08:43:13 +03:00
|
|
|
/**
|
|
|
|
* Not every channel necessarily has a loadInfo attached.
|
|
|
|
*/
|
|
|
|
union OptionalLoadInfoArgs
|
|
|
|
{
|
|
|
|
void_t;
|
|
|
|
LoadInfoArgs;
|
|
|
|
};
|
|
|
|
|
2013-06-22 20:09:19 +04:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HTTP IPDL structs
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2015-04-18 01:59:10 +03:00
|
|
|
union OptionalHttpResponseHead
|
|
|
|
{
|
|
|
|
void_t;
|
|
|
|
nsHttpResponseHead;
|
|
|
|
};
|
|
|
|
|
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?
|
|
|
|
OptionalURIParams original;
|
|
|
|
OptionalURIParams doc;
|
|
|
|
OptionalURIParams referrer;
|
2014-11-18 16:46:35 +03:00
|
|
|
uint32_t referrerPolicy;
|
2013-06-22 20:09:19 +04:00
|
|
|
OptionalURIParams apiRedirectTo;
|
2014-10-30 03:22:22 +03:00
|
|
|
OptionalURIParams topWindowURI;
|
2013-06-22 20:09:19 +04:00
|
|
|
uint32_t loadFlags;
|
|
|
|
RequestHeaderTuples requestHeaders;
|
2014-03-18 20:36:18 +04:00
|
|
|
nsCString requestMethod;
|
2016-09-29 01:38:26 +03:00
|
|
|
OptionalIPCStream 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;
|
2015-07-14 08:43:13 +03:00
|
|
|
OptionalLoadInfoArgs loadInfo;
|
2015-04-18 01:59:10 +03:00
|
|
|
OptionalHttpResponseHead 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;
|
2016-12-16 05:42:00 +03:00
|
|
|
uint64_t contentWindowId;
|
2016-04-11 06:17:02 +03:00
|
|
|
nsCString preferredAlternativeType;
|
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;
|
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;
|
2017-03-09 16:09:31 +03:00
|
|
|
OptionalIPCStream uploadStream;
|
2015-07-14 08:43:13 +03:00
|
|
|
OptionalLoadInfoArgs loadInfo;
|
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
|