Commit Graph

153 Commits

Author SHA1 Message Date
Malte Jürgens
bfc438acee Bug 1919558 - Part 3: Move logic to restore default permission entries into AddInternal in permission manager r=pbz,permissions-reviewers
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
2024-12-04 16:45:02 +00:00
Malte Jürgens
4e48d62856 Bug 1919558 - Part 2: Separate out logic for importing DefaultEntry into own method in permission manager r=pbz,permissions-reviewers
This will allow us to call the same logic for a single default entry.

Differential Revision: https://phabricator.services.mozilla.com/D222653
2024-12-04 16:45:01 +00:00
Malte Jürgens
baf5dbd3e7 Bug 1919558 - Part 1: Convert host to origin before storing it as a DefaultEntry in the permission manager r=pbz,permissions-reviewers
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
2024-12-04 16:45:01 +00:00
Sandor Molnar
264568af9c Backed out 8 changesets (bug 1919558, bug 1816449) for causing mochitest failures @ test_refresh_firefox.py
Backed out changeset a194f41588e9 (bug 1816449)
Backed out changeset 10643d7c7a78 (bug 1919558)
Backed out changeset b346a2a2bfdc (bug 1919558)
Backed out changeset 507f18e7103d (bug 1919558)
Backed out changeset 4d0d9f72bc2a (bug 1919558)
Backed out changeset 65d9270f0991 (bug 1919558)
Backed out changeset fe95b9e6ff13 (bug 1919558)
Backed out changeset ea6ffcb0e334 (bug 1919558)
2024-11-13 18:22:41 +02:00
Malte Jürgens
005d8506f2 Bug 1919558 - Part 6: Add RemotePermissionService to get default permissions from remote settings r=pbz,permissions-reviewers
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
2024-11-13 14:00:09 +00:00
Malte Jürgens
8fbc2bae7f Bug 1919558 - Part 5: Add AddDefaultFromPrincipal method to permission manager r=pbz,permissions-reviewers
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
2024-11-13 14:00:09 +00:00
Malte Jürgens
25a74565ea Bug 1919558 - Part 4: Allow default permissions to be modified through AddInternal in permission manager r=pbz,permissions-reviewers
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
2024-11-13 14:00:08 +00:00
Malte Jürgens
dc4986f63e Bug 1919558 - Part 3: Move logic to restore default permission entries into AddInternal in permission manager r=pbz,permissions-reviewers
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
2024-11-13 14:00:08 +00:00
Malte Jürgens
d6e5c2692c Bug 1919558 - Part 2: Separate out logic for importing DefaultEntry into own method in permission manager r=pbz,permissions-reviewers
This will allow us to call the same logic for a single default entry.

Differential Revision: https://phabricator.services.mozilla.com/D222653
2024-11-13 14:00:07 +00:00
Malte Jürgens
2653d68ae7 Bug 1919558 - Part 1: Convert host to origin before storing it as a DefaultEntry in the permission manager r=pbz,permissions-reviewers
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
2024-11-13 14:00:07 +00:00
Butkovits Atila
c4367fe4d4 Backed out 8 changesets (bug 1919558, bug 1816449) for causing failures at test_open_and_databases.js
Backed out changeset 5f7eab80a48b (bug 1816449)
Backed out changeset 2800d22d0532 (bug 1919558)
Backed out changeset c95f84d96d07 (bug 1919558)
Backed out changeset b61736ed0836 (bug 1919558)
Backed out changeset bc6e1e325e17 (bug 1919558)
Backed out changeset 22967ce2bce2 (bug 1919558)
Backed out changeset cd0a6dffb4e2 (bug 1919558)
Backed out changeset cb5b83cd5d65 (bug 1919558)
2024-11-08 21:20:45 +02:00
Malte Jürgens
ab5870e961 Bug 1919558 - Part 6: Add RemotePermissionService to get default permissions from remote settings r=pbz,permissions-reviewers
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
2024-11-08 15:08:33 +00:00
Malte Jürgens
4d4e67d61f Bug 1919558 - Part 5: Add AddDefaultFromPrincipal method to permission manager r=pbz,permissions-reviewers
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
2024-11-08 15:08:32 +00:00
Malte Jürgens
cef2e4d5b6 Bug 1919558 - Part 4: Allow default permissions to be modified through AddInternal in permission manager r=pbz,permissions-reviewers
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
2024-11-08 15:08:32 +00:00
Malte Jürgens
03bbd34260 Bug 1919558 - Part 3: Move logic to restore default permission entries into AddInternal in permission manager r=pbz,permissions-reviewers
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
2024-11-08 15:08:31 +00:00
Malte Jürgens
67afaa14ca Bug 1919558 - Part 2: Separate out logic for importing DefaultEntry into own method in permission manager r=pbz,permissions-reviewers
This will allow us to call the same logic for a single default entry.

Differential Revision: https://phabricator.services.mozilla.com/D222653
2024-11-08 15:08:31 +00:00
Malte Jürgens
c98108dc2c Bug 1919558 - Part 1: Convert host to origin before storing it as a DefaultEntry in the permission manager r=pbz,permissions-reviewers
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
2024-11-08 15:08:31 +00:00
Norisz Fay
b6201c0222 Backed out 8 changesets (bug 1816449, bug 1919558) for causing xpcshell and mochitest failures
Backed out changeset 69d226857a48 (bug 1816449)
Backed out changeset da7afd485891 (bug 1919558)
Backed out changeset 1bedb67e8801 (bug 1919558)
Backed out changeset 361ef2b4da96 (bug 1919558)
Backed out changeset ae8f8083b580 (bug 1919558)
Backed out changeset 8930087e61a2 (bug 1919558)
Backed out changeset da39116b6d9e (bug 1919558)
Backed out changeset a200e5113a25 (bug 1919558)
2024-11-05 13:44:46 +02:00
Malte Jürgens
e90cd4ab92 Bug 1919558 - Part 6: Add RemotePermissionService to get default permissions from remote settings r=pbz,permissions-reviewers
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
2024-11-05 10:17:43 +00:00
Malte Jürgens
83f02b25dd Bug 1919558 - Part 5: Add AddDefaultFromPrincipal method to permission manager r=pbz,permissions-reviewers
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
2024-11-05 10:17:42 +00:00
Malte Jürgens
a9f138549d Bug 1919558 - Part 4: Allow default permissions to be modified through AddInternal in permission manager r=pbz,permissions-reviewers
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
2024-11-05 10:17:42 +00:00
Malte Jürgens
3e04951bf6 Bug 1919558 - Part 3: Move logic to restore default permission entries into AddInternal in permission manager r=pbz,permissions-reviewers
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
2024-11-05 10:17:41 +00:00
Malte Jürgens
8f9d85d3b4 Bug 1919558 - Part 2: Separate out logic for importing DefaultEntry into own method in permission manager r=pbz,permissions-reviewers
This will allow us to call the same logic for a single default entry.

Differential Revision: https://phabricator.services.mozilla.com/D222653
2024-11-05 10:17:41 +00:00
Malte Jürgens
b06d16f4c3 Bug 1919558 - Part 1: Convert host to origin before storing it as a DefaultEntry in the permission manager r=pbz,permissions-reviewers
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
2024-11-05 10:17:41 +00:00
Jan-Ivar Bruaroey
98d2685eea Bug 1904632 - validate permissions.default.* prefs r=pbz,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D216856
2024-07-22 14:42:46 +00:00
William Wen
6aad46ac21 Bug 1658094 - Add new cleaner for "cookie" permissions. r=pbz
Differential Revision: https://phabricator.services.mozilla.com/D212057
2024-06-24 15:14:45 +00:00
Timur Valeev
7310bf301c Bug 1881694 - Remove unused method PermissionManager::LegacyTestPermissionFromURI. r=pbz
Differential Revision: https://phabricator.services.mozilla.com/D213918
2024-06-18 11:18:42 +00:00
Paul Zuehlcke
09e9574855 Bug 1899292 - Call EnsureReadCompleted before computing permission type index. r=permissions-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D211854
2024-05-28 15:26:04 +00:00
Harshit Sohaney
1e60c930a9 Bug 1881797 - (part 3) Testing for storage permission clearing in the new clear history dialog. r=pbz,settings-reviewers,mconley
Differential Revision: https://phabricator.services.mozilla.com/D204919
2024-04-09 15:39:32 +00:00
Artur Iunusov
7626d7af20 Bug 1770944 - Remove other references to inBrowserElement, r=cookie-reviewers,valentin,janv,decoder
Depends on D183230

Differential Revision: https://phabricator.services.mozilla.com/D189490
2024-03-07 13:04:23 +00:00
Artur Iunusov
25198547c3 Bug 1770944 - Remove isInIsolatedMozBrowserElement. r=smaug,necko-reviewers,kershaw,valentin
Depends on D183229

Differential Revision: https://phabricator.services.mozilla.com/D183230
2024-03-07 13:04:22 +00:00
Narcis Beleuzu
197b39f007 Backed out 16 changesets (bug 1770944) as req by asuth.
Backed out changeset 61af32f40777 (bug 1770944)
Backed out changeset 4ff0c45db93b (bug 1770944)
Backed out changeset 8a217eff7bcd (bug 1770944)
Backed out changeset 6435f48c96bf (bug 1770944)
Backed out changeset 0d2432765ca0 (bug 1770944)
Backed out changeset 58e02566db85 (bug 1770944)
Backed out changeset 0a8c4c2460ee (bug 1770944)
Backed out changeset 9416bafd9982 (bug 1770944)
Backed out changeset 79de4f83fe2e (bug 1770944)
Backed out changeset 63ac518aceb0 (bug 1770944)
Backed out changeset 14952f872b77 (bug 1770944)
Backed out changeset f65e0967ad75 (bug 1770944)
Backed out changeset bd53c42038f7 (bug 1770944)
Backed out changeset 36c378ba8212 (bug 1770944)
Backed out changeset 9ba54ab06348 (bug 1770944)
Backed out changeset fb5a54b3cbe9 (bug 1770944)
2024-02-23 21:11:08 +02:00
Artur Iunusov
7db9c11413 Bug 1770944 - Remove other references to inBrowserElement, r=cookie-reviewers,valentin,janv,decoder
Depends on D183230

Differential Revision: https://phabricator.services.mozilla.com/D189490
2024-02-22 10:13:15 +00:00
Artur Iunusov
312e9e22ae Bug 1770944 - Remove isInIsolatedMozBrowserElement. r=smaug,necko-reviewers,kershaw,valentin
Depends on D183229

Differential Revision: https://phabricator.services.mozilla.com/D183230
2024-02-22 10:13:14 +00:00
Sandor Molnar
6699491437 Backed out 16 changesets (bug 1770944) for causing asan failures @ dom/base/InProcessBrowserChildMessageManager.cpp
Backed out changeset b73885731e73 (bug 1770944)
Backed out changeset 23d0dc98eb51 (bug 1770944)
Backed out changeset 15661e24d8e1 (bug 1770944)
Backed out changeset 97aa839dc200 (bug 1770944)
Backed out changeset 0d4318bf3239 (bug 1770944)
Backed out changeset be28bb62e9f3 (bug 1770944)
Backed out changeset 708b2671410e (bug 1770944)
Backed out changeset 0a138f3b56b9 (bug 1770944)
Backed out changeset 3a149ef794c2 (bug 1770944)
Backed out changeset 4b6ae7dd0e69 (bug 1770944)
Backed out changeset e3960ad85182 (bug 1770944)
Backed out changeset 9ea253525227 (bug 1770944)
Backed out changeset 1828b66c2f7c (bug 1770944)
Backed out changeset 55b0886f9025 (bug 1770944)
Backed out changeset a4197071d10a (bug 1770944)
Backed out changeset 9b18524f541e (bug 1770944)
2024-02-20 20:34:55 +02:00
Artur Iunusov
c21b2319dc Bug 1770944 - Remove other references to inBrowserElement, r=cookie-reviewers,valentin,janv,decoder
Depends on D183230

Differential Revision: https://phabricator.services.mozilla.com/D189490
2024-02-20 16:53:24 +00:00
Artur Iunusov
f08648c991 Bug 1770944 - Remove isInIsolatedMozBrowserElement. r=smaug,necko-reviewers,kershaw,valentin
Depends on D183229

Differential Revision: https://phabricator.services.mozilla.com/D183230
2024-02-20 16:53:23 +00:00
dylan
da54f4561f Bug 1742554 - removed instances of ftp. r=necko-reviewers,dom-storage-reviewers,kershaw,valentin,janv
Differential Revision: https://phabricator.services.mozilla.com/D197368
2024-01-16 16:11:00 +00:00
Vincent Hilla
b9feab1142 Bug 1589554 - Part 3: Screen Wake Lock permission integration. r=webidl,dom-core,smaug,pbz,edgar
Depends on D189509

Differential Revision: https://phabricator.services.mozilla.com/D189510
2023-12-05 23:58:06 +00:00
Cosmin Sabou
3401b2bd41 Backed out 7 changesets (bug 1589554) for causing non-unified bustages on WakeLockJS.cpp.
Backed out changeset a0db8be67659 (bug 1589554)
Backed out changeset 76a3c248813f (bug 1589554)
Backed out changeset f1500173aa53 (bug 1589554)
Backed out changeset e02e11c3d977 (bug 1589554)
Backed out changeset 202c4f5c642b (bug 1589554)
Backed out changeset 82e03a404c2f (bug 1589554)
Backed out changeset b55991835aec (bug 1589554)
2023-12-05 19:12:31 +02:00
Vincent Hilla
22033a525a Bug 1589554 - Part 3: Screen Wake Lock permission integration. r=webidl,dom-core,smaug,pbz,edgar
Depends on D189509

Differential Revision: https://phabricator.services.mozilla.com/D189510
2023-12-05 15:37:06 +00:00
Benjamin VanderSloot
d8ca4f5cea Bug 1848783, part 6 - Revoke has storage access when the permission is revoked - r=anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D187287
2023-09-21 01:48:49 +00:00
Benjamin VanderSloot
96a8a80dd8 Bug 1848783, part 3 - Add the site (sans port) to the permission keys of a content process - r=anti-tracking-reviewers,timhuang
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
2023-09-21 01:48:48 +00:00
Iulian Moraru
498b92b571 Backed out 9 changesets (bug 1848783, bug 1837168, bug 1835920) for causing multiple failures. CLOSED TREE
Backed out changeset ab1717421318 (bug 1848783)
Backed out changeset de5e1715c877 (bug 1848783)
Backed out changeset 1f64106e6667 (bug 1848783)
Backed out changeset e082ba20bbb2 (bug 1848783)
Backed out changeset cb56c5d713bf (bug 1848783)
Backed out changeset 735161c251e4 (bug 1848783)
Backed out changeset 3d1468ac6e84 (bug 1848783)
Backed out changeset 9ff5b92032cb (bug 1837168)
Backed out changeset 15cfb0c4f048 (bug 1835920)
2023-09-20 22:29:41 +03:00
Benjamin VanderSloot
eeb8f98769 Bug 1848783, part 6 - Revoke has storage access when the permission is revoked - r=anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D187287
2023-09-20 16:14:40 +00:00
Benjamin VanderSloot
2b2c7f882b Bug 1848783, part 3 - Add the site (sans port) to the permission keys of a content process - r=anti-tracking-reviewers,timhuang
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
2023-09-20 16:14:39 +00:00
Cosmin Sabou
805246368b Backed out 9 changesets (bug 1837168, bug 1835920, bug 1848783) for causing storage-access-api wpt failures. CLOSED TREE
Backed out changeset 3fd66f8f5d65 (bug 1848783)
Backed out changeset a96afb6d05d6 (bug 1848783)
Backed out changeset 117132b000ac (bug 1848783)
Backed out changeset 3a14281b7d72 (bug 1848783)
Backed out changeset 7dc5f794364d (bug 1848783)
Backed out changeset 84ca25a557a6 (bug 1848783)
Backed out changeset 8bb89cf9587e (bug 1848783)
Backed out changeset 15a005bef445 (bug 1837168)
Backed out changeset a97bc1fd6637 (bug 1835920)
2023-09-20 04:41:18 +03:00
Benjamin VanderSloot
a373fb28e1 Bug 1848783, part 6 - Revoke has storage access when the permission is revoked - r=anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D187287
2023-09-19 21:03:08 +00:00
Benjamin VanderSloot
0c8071bfc7 Bug 1848783, part 3 - Add the site (sans port) to the permission keys of a content process - r=anti-tracking-reviewers,timhuang
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
2023-09-19 21:03:07 +00:00
Narcis Beleuzu
cf8743b301 Backed out 9 changesets (bug 1835920, bug 1848783, bug 1837168) for assertion failure on PermissionManager.cpp . CLOSED TREE
Backed out changeset 589241e4e1f6 (bug 1848783)
Backed out changeset 7446d643420d (bug 1848783)
Backed out changeset 1b5a505a9bc6 (bug 1848783)
Backed out changeset bfd4df9014d7 (bug 1848783)
Backed out changeset 01f053bbdb97 (bug 1848783)
Backed out changeset e1b829bfb8d1 (bug 1848783)
Backed out changeset f17d58a27f3c (bug 1848783)
Backed out changeset d21bdbf5baf1 (bug 1837168)
Backed out changeset a2d17b5958b8 (bug 1835920)
2023-09-19 16:15:26 +03:00