2014-07-07 22:13:04 +04:00
|
|
|
/* 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/. */
|
|
|
|
|
2017-01-12 19:38:48 +03:00
|
|
|
using mozilla::OriginAttributes from "mozilla/ipc/BackgroundUtils.h";
|
2015-03-07 00:33:00 +03:00
|
|
|
using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
|
|
|
|
|
2014-07-07 22:13:04 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace ipc {
|
|
|
|
|
2018-04-11 22:52:47 +03:00
|
|
|
struct ContentSecurityPolicy
|
|
|
|
{
|
|
|
|
nsString policy;
|
|
|
|
bool reportOnlyFlag;
|
|
|
|
bool deliveredViaMetaTagFlag;
|
|
|
|
};
|
|
|
|
|
2014-07-07 22:13:04 +04:00
|
|
|
struct ContentPrincipalInfo
|
|
|
|
{
|
2017-01-12 19:38:48 +03:00
|
|
|
OriginAttributes attrs;
|
2017-03-20 18:03:45 +03:00
|
|
|
|
2017-03-29 09:26:30 +03:00
|
|
|
// Origin is not simply a part of the spec. Based on the scheme of the URI
|
|
|
|
// spec, we generate different kind of origins: for instance any file: URL
|
|
|
|
// shares the same origin, about: URLs have the full spec as origin and so
|
|
|
|
// on.
|
|
|
|
// Another important reason why we have this attribute is that
|
|
|
|
// ContentPrincipalInfo is used out of the main-thread. Having this value
|
|
|
|
// here allows us to retrive the origin without creating a full nsIPrincipal.
|
2017-11-15 13:19:26 +03:00
|
|
|
nsCString originNoSuffix;
|
2017-03-20 18:03:45 +03:00
|
|
|
|
2014-07-07 22:13:04 +04:00
|
|
|
nsCString spec;
|
2018-04-11 22:52:47 +03:00
|
|
|
|
2019-02-28 19:50:28 +03:00
|
|
|
nsCString? domain;
|
|
|
|
|
2019-02-08 23:01:50 +03:00
|
|
|
// Like originNoSuffix, baseDomain is used out of the main-thread.
|
|
|
|
nsCString baseDomain;
|
2014-07-07 22:13:04 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct SystemPrincipalInfo
|
|
|
|
{ };
|
|
|
|
|
|
|
|
struct NullPrincipalInfo
|
2016-04-21 11:30:03 +03:00
|
|
|
{
|
2017-01-12 19:38:48 +03:00
|
|
|
OriginAttributes attrs;
|
2016-11-30 17:13:27 +03:00
|
|
|
nsCString spec;
|
2016-04-21 11:30:03 +03:00
|
|
|
};
|
2014-07-07 22:13:04 +04:00
|
|
|
|
2015-04-07 01:44:04 +03:00
|
|
|
struct ExpandedPrincipalInfo
|
|
|
|
{
|
2017-01-12 19:38:48 +03:00
|
|
|
OriginAttributes attrs;
|
2018-10-31 20:56:43 +03:00
|
|
|
PrincipalInfo[] allowlist;
|
2015-04-07 01:44:04 +03:00
|
|
|
};
|
|
|
|
|
2014-07-07 22:13:04 +04:00
|
|
|
union PrincipalInfo
|
|
|
|
{
|
|
|
|
ContentPrincipalInfo;
|
|
|
|
SystemPrincipalInfo;
|
|
|
|
NullPrincipalInfo;
|
2015-04-07 01:44:04 +03:00
|
|
|
ExpandedPrincipalInfo;
|
2014-07-07 22:13:04 +04:00
|
|
|
};
|
|
|
|
|
2019-05-22 02:14:27 +03:00
|
|
|
struct CSPInfo
|
|
|
|
{
|
2020-04-11 01:14:16 +03:00
|
|
|
ContentSecurityPolicy[] policyInfos;
|
2019-05-22 02:14:27 +03:00
|
|
|
PrincipalInfo requestPrincipalInfo;
|
|
|
|
nsCString selfURISpec;
|
|
|
|
nsString referrer;
|
|
|
|
uint64_t innerWindowID;
|
2019-09-17 02:47:19 +03:00
|
|
|
bool skipAllowInlineStyleCheck;
|
2019-05-22 02:14:27 +03:00
|
|
|
};
|
|
|
|
|
2014-07-07 22:13:04 +04:00
|
|
|
} // namespace ipc
|
|
|
|
} // namespace mozilla
|