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
|
|
|
|
|
|
|
ContentSecurityPolicy[] securityPolicies;
|
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
|
|
|
};
|
|
|
|
|
2015-03-07 00:33:00 +03:00
|
|
|
union OptionalPrincipalInfo
|
|
|
|
{
|
|
|
|
void_t;
|
|
|
|
PrincipalInfo;
|
|
|
|
};
|
|
|
|
|
2014-07-07 22:13:04 +04:00
|
|
|
} // namespace ipc
|
|
|
|
} // namespace mozilla
|