| Feature.cpp |
|
1719 |
98 % |
|
| Feature.h |
|
1248 |
- |
|
| fuzztest |
|
|
- |
|
| moz.build |
|
919 |
- |
|
| PermissionsPolicy.cpp |
|
14317 |
95 % |
|
| PermissionsPolicy.h |
PermissionsPolicy
~~~~~~~~~~~~~
Each document and each HTMLIFrameElement have a PermissionsPolicy object
which is used to allow or deny features in their contexts.
PermissionsPolicy is composed by a set of directives configured by the
'Permissions-Policy' HTTP Header and the 'allow' attribute in
HTMLIFrameElements. Both header and attribute are parsed by the
PermissionsPolicyParser, which returns an array of Feature objects. Each
Feature object has a feature name and one of these policies:
- eNone - the feature is fully disabled.
- eAll - the feature is allowed.
- eAllowList - the feature is allowed for a list of origins.
An interesting element of PermissionsPolicy is the inheritance: each context
inherits the permissions-policy directives from the parent context, if it
exists.
When a context inherits a policy for feature X, it only knows if that feature
is allowed or denied (it ignores the list of allowed origins for instance).
This information is stored in an array of inherited feature strings because
we care only to know when they are denied.
PermissionsPolicy can be reset if the 'allow' or 'src' attributes
change in HTMLIFrameElements. 'src' attribute is important to compute
correcly the features via PermissionsPolicy 'src' keyword.
When PermissionsPolicy must decide if feature X is allowed or denied
for the current origin, it checks if the parent context denied that feature.
If not, it checks if there is a Feature object for that
feature named X and if the origin is allowed or not.
From a C++ point of view, use PermissionsPolicyUtils to obtain the list of
features and to check if they are allowed in the current context.
dom.security.permissionsPolicy.header.enabled pref can be used to disable the
HTTP header support.
|
8769 |
100 % |
|
| PermissionsPolicyParser.cpp |
static |
8016 |
85 % |
|
| PermissionsPolicyParser.h |
|
1250 |
- |
|
| PermissionsPolicyUtils.cpp |
IMPORTANT: Do not change this list without review from a DOM peer _AND_ a
DOM Security peer!
|
9468 |
96 % |
|
| PermissionsPolicyUtils.h |
|
2756 |
- |
|
| <1% | test |
|
|
100 % |
|