This makes sure default permissions are always restored when a previously
overriding user permission gets deleted with AddInternal.
Differential Revision: https://phabricator.services.mozilla.com/D222652
This just simplifies the code for later use and should not change any behaviour
beside the following:
If `permissions.manager.defaultsUrl` is customized and contains a legacy `host`
entry, removes the history lookup to determine known origins for a given host.
Instead, only entries for http:// and https:// on the default ports will be
added. This is because with the changes in this patch,
`UpgradeHostToOriginAndInsert` is moved off the main thread, and a history
lookup is only allowed on the main thread.
Also rename `mDefaultEntries` to `mDefaultEntriesForImport` to better reflect
what this array is actually for: Storing the defaults so that they can be
(re-)imported into the permission manager, and not being the primary location
where the default permissions are stored.
Differential Revision: https://phabricator.services.mozilla.com/D222654
This is adding the RemotePermissionService xpcom js service for the purpose of
importing default permission manager entries from remote settings. This service
will be initialized by the permission manager after it has read all its
permissions from disk and is fully initialized.
When being initialized, the service will at first get all the current default
remote permissions from the remote settings client, and add them as default
permissions through the `AddDefaultFromPrincipal` method added in D222650. An
event listener is then also set up to keep the default entries in the permission
manager in sync with remote settings.
All of this is guarded behind a whitelist in the the `ALLOWED_PERMISSION_VALUES`
variable, ensuring only specific permission types and values can be imported
through this mechanism.
Differential Revision: https://phabricator.services.mozilla.com/D222649
This method will later be used to import default permissions from remote
settings through the remote permission manager.
Differential Revision: https://phabricator.services.mozilla.com/D222650
Allow default permissions to be deleted by adding a new permission with same
origin and type, and value UNKNOWN_ACTION, analogous to how normal permissions
currently already get deleted. This can then later be used by the remote
permission service (D222649) to remove default permissions it previously added
if they have been removed in remote settings.
Also add brackets to make clang-tidy happy.
Differential Revision: https://phabricator.services.mozilla.com/D222651
This makes sure default permissions are always restored when a previously
overriding user permission gets deleted with AddInternal.
Differential Revision: https://phabricator.services.mozilla.com/D222652
This just simplifies the code for later use and should not change any behaviour
beside the following:
If `permissions.manager.defaultsUrl` is customized and contains a legacy `host`
entry, removes the history lookup to determine known origins for a given host.
Instead, only entries for http:// and https:// on the default ports will be
added. This is because with the changes in this patch,
`UpgradeHostToOriginAndInsert` is moved off the main thread, and a history
lookup is only allowed on the main thread.
Also rename `mDefaultEntries` to `mDefaultEntriesForImport` to better reflect
what this array is actually for: Storing the defaults so that they can be
(re-)imported into the permission manager, and not being the primary location
where the default permissions are stored.
Differential Revision: https://phabricator.services.mozilla.com/D222654
This is adding the RemotePermissionService xpcom js service for the purpose of
importing default permission manager entries from remote settings. This service
will be initialized by the permission manager after it has read all its
permissions from disk and is fully initialized.
When being initialized, the service will at first get all the current default
remote permissions from the remote settings client, and add them as default
permissions through the `AddDefaultFromPrincipal` method added in D222650. An
event listener is then also set up to keep the default entries in the permission
manager in sync with remote settings.
All of this is guarded behind a whitelist in the the `ALLOWED_PERMISSION_VALUES`
variable, ensuring only specific permission types and values can be imported
through this mechanism.
Differential Revision: https://phabricator.services.mozilla.com/D222649
This method will later be used to import default permissions from remote
settings through the remote permission manager.
Differential Revision: https://phabricator.services.mozilla.com/D222650
Allow default permissions to be deleted by adding a new permission with same
origin and type, and value UNKNOWN_ACTION, analogous to how normal permissions
currently already get deleted. This can then later be used by the remote
permission service (D222649) to remove default permissions it previously added
if they have been removed in remote settings.
Also add brackets to make clang-tidy happy.
Differential Revision: https://phabricator.services.mozilla.com/D222651
This makes sure default permissions are always restored when a previously
overriding user permission gets deleted with AddInternal.
Differential Revision: https://phabricator.services.mozilla.com/D222652
This just simplifies the code for later use and should not change any behaviour
beside the following:
If `permissions.manager.defaultsUrl` is customized and contains a legacy `host`
entry, removes the history lookup to determine known origins for a given host.
Instead, only entries for http:// and https:// on the default ports will be
added. This is because with the changes in this patch,
`UpgradeHostToOriginAndInsert` is moved off the main thread, and a history
lookup is only allowed on the main thread.
Also rename `mDefaultEntries` to `mDefaultEntriesForImport` to better reflect
what this array is actually for: Storing the defaults so that they can be
(re-)imported into the permission manager, and not being the primary location
where the default permissions are stored.
Differential Revision: https://phabricator.services.mozilla.com/D222654
This is adding the RemotePermissionService xpcom js service for the purpose of
importing default permission manager entries from remote settings. This service
will be initialized by the permission manager after it has read all its
permissions from disk and is fully initialized.
When being initialized, the service will at first get all the current default
remote permissions from the remote settings client, and add them as default
permissions through the `AddDefaultFromPrincipal` method added in D222650. An
event listener is then also set up to keep the default entries in the permission
manager in sync with remote settings.
All of this is guarded behind a whitelist in the the `ALLOWED_PERMISSION_VALUES`
variable, ensuring only specific permission types and values can be imported
through this mechanism.
Differential Revision: https://phabricator.services.mozilla.com/D222649
This method will later be used to import default permissions from remote
settings through the remote permission manager.
Differential Revision: https://phabricator.services.mozilla.com/D222650
Allow default permissions to be deleted by adding a new permission with same
origin and type, and value UNKNOWN_ACTION, analogous to how normal permissions
currently already get deleted. This can then later be used by the remote
permission service (D222649) to remove default permissions it previously added
if they have been removed in remote settings.
Also add brackets to make clang-tidy happy.
Differential Revision: https://phabricator.services.mozilla.com/D222651
This makes sure default permissions are always restored when a previously
overriding user permission gets deleted with AddInternal.
Differential Revision: https://phabricator.services.mozilla.com/D222652
This just simplifies the code for later use and should not change any behaviour
beside the following:
If `permissions.manager.defaultsUrl` is customized and contains a legacy `host`
entry, removes the history lookup to determine known origins for a given host.
Instead, only entries for http:// and https:// on the default ports will be
added. This is because with the changes in this patch,
`UpgradeHostToOriginAndInsert` is moved off the main thread, and a history
lookup is only allowed on the main thread.
Also rename `mDefaultEntries` to `mDefaultEntriesForImport` to better reflect
what this array is actually for: Storing the defaults so that they can be
(re-)imported into the permission manager, and not being the primary location
where the default permissions are stored.
Differential Revision: https://phabricator.services.mozilla.com/D222654
without this, permissions set in the main process that are site-scoped on origins with non-null ports are not pushed out to the content process.
Differential Revision: https://phabricator.services.mozilla.com/D186984
without this, permissions set in the main process that are site-scoped on origins with non-null ports are not pushed out to the content process.
Differential Revision: https://phabricator.services.mozilla.com/D186984
without this, permissions set in the main process that are site-scoped on origins with non-null ports are not pushed out to the content process.
Differential Revision: https://phabricator.services.mozilla.com/D186984