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;
|
2014-04-03 15:08:34 +04:00
|
|
|
include protocol PRtspChannel;
|
2016-09-29 01:38:26 +03:00
|
|
|
include protocol PSendStream;
|
2016-05-18 01:01:25 +03:00
|
|
|
include BlobTypes;
|
2013-06-22 20:09:19 +04:00
|
|
|
include URIParams;
|
2016-09-29 01:38:26 +03:00
|
|
|
include IPCStream;
|
2013-06-22 20:09:19 +04:00
|
|
|
include InputStreamParams;
|
2014-09-21 20:40:27 +04:00
|
|
|
include PBackgroundSharedTypes;
|
2013-06-22 20:09:19 +04:00
|
|
|
|
2015-11-03 04:50:54 +03:00
|
|
|
using mozilla::NeckoOriginAttributes 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";
|
2013-06-22 20:09:19 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
2015-06-19 01:37:20 +03:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// LoadInfo IPDL structs
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
struct LoadInfoArgs
|
|
|
|
{
|
2016-04-14 02:30:16 +03:00
|
|
|
OptionalPrincipalInfo requestingPrincipalInfo;
|
|
|
|
PrincipalInfo triggeringPrincipalInfo;
|
2016-11-08 09:23:12 +03:00
|
|
|
OptionalPrincipalInfo principalToInheritInfo;
|
2016-04-14 02:30:16 +03:00
|
|
|
uint32_t securityFlags;
|
|
|
|
uint32_t contentPolicyType;
|
|
|
|
uint32_t tainting;
|
|
|
|
bool upgradeInsecureRequests;
|
|
|
|
bool verifySignedContent;
|
|
|
|
bool enforceSRI;
|
2016-07-18 09:35:13 +03:00
|
|
|
bool forceInheritPrincipalDropped;
|
2016-04-14 02:30:16 +03:00
|
|
|
uint64_t innerWindowID;
|
|
|
|
uint64_t outerWindowID;
|
|
|
|
uint64_t parentOuterWindowID;
|
2016-06-27 03:42:00 +03:00
|
|
|
uint64_t frameOuterWindowID;
|
2016-04-14 02:30:16 +03:00
|
|
|
bool enforceSecurity;
|
|
|
|
bool initialSecurityCheckDone;
|
|
|
|
bool isInThirdPartyContext;
|
2015-11-03 04:50:54 +03:00
|
|
|
NeckoOriginAttributes originAttributes;
|
2016-04-14 02:30:16 +03:00
|
|
|
PrincipalInfo[] redirectChainIncludingInternalRedirects;
|
|
|
|
PrincipalInfo[] redirectChain;
|
|
|
|
nsCString[] corsUnsafeHeaders;
|
|
|
|
bool forcePreflight;
|
|
|
|
bool isPreflight;
|
Bug 1246540 - HSTS Priming Proof of Concept. r=ckerschb, r=mayhemer, r=jld, r=smaug, r=dkeeler, r=jmaher, p=ally
HSTS priming changes the order of mixed-content blocking and HSTS
upgrades, and adds a priming request to check if a mixed-content load is
accesible over HTTPS and the server supports upgrading via the
Strict-Transport-Security header.
Every call site that uses AsyncOpen2 passes through the mixed-content
blocker, and has a LoadInfo. If the mixed-content blocker marks the load as
needing HSTS priming, nsHttpChannel will build and send an HSTS priming
request on the same URI with the scheme upgraded to HTTPS. If the server
allows the upgrade, then channel performs an internal redirect to the HTTPS URI,
otherwise use the result of mixed-content blocker to allow or block the
load.
nsISiteSecurityService adds an optional boolean out parameter to
determine if the HSTS state is already cached for negative assertions.
If the host has been probed within the previous 24 hours, no HSTS
priming check will be sent.
MozReview-Commit-ID: ES1JruCtDdX
--HG--
extra : rebase_source : 2ac6c93c49f2862fc0b9e595eb0598cd1ea4bedf
2016-09-27 18:27:00 +03:00
|
|
|
bool forceHSTSPriming;
|
|
|
|
bool mixedContentWouldBlock;
|
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;
|
|
|
|
uint16_t priority;
|
2014-12-06 22:26:50 +03:00
|
|
|
uint32_t classOfService;
|
2013-06-22 20:09:19 +04:00
|
|
|
uint8_t redirectionLimit;
|
|
|
|
bool allowPipelining;
|
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;
|
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;
|
2016-04-21 17:59:17 +03:00
|
|
|
nsCString 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;
|
2016-06-01 22:29:21 +03:00
|
|
|
nsCString channelId;
|
2016-04-11 06:17:02 +03:00
|
|
|
nsCString preferredAlternativeType;
|
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;
|
2013-06-22 20:09:19 +04:00
|
|
|
OptionalInputStreamParams 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;
|
|
|
|
};
|
|
|
|
|
2014-04-03 15:08:34 +04:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// RTSP IPDL structs
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
struct RtspChannelConnectArgs
|
|
|
|
{
|
|
|
|
URIParams uri;
|
|
|
|
uint32_t channelId;
|
|
|
|
};
|
|
|
|
|
2013-06-22 20:09:19 +04:00
|
|
|
} // namespace ipc
|
|
|
|
} // namespace mozilla
|