Commit Graph

360 Commits

Author SHA1 Message Date
serge-sans-paille
e54774d573 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-28 08:21:19 +00:00
Alexandru Marc
191ccbe7fe Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
serge-sans-paille
53068cdf31 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 09:06:01 +00:00
Alexandru Marc
83543f20f2 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille
c7a369b29a Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 07:38:30 +00:00
Andrea Marchesini
8ae9152b88 Bug 1193373 - Support Permissions API in Worker Context, r=manuel,webidl,asuth,smaug
This commit exposes the Permissions API to DOM Workers. It achieves this goal
by introducing a thread-safe bridge between `PermissionStatus` and the
`PermissionObserver`: the `PermissionStatusSink` object.

Actors:
- The `PermissionObserver` is a main-thread-only singleton that monitors
  permission change events and propagates the notification to the right sink
  objects.
- The `PermissionStatus` is the DOM object exposed to the global. It's not
  thread-safe.
- The `PermissionStatusSink` is the new bridge introduced by this commit.

The `PermissionStatusSink` lifetime:
- This object is kept alive on the current thread by the `PermissionStatus` and
  on the main thread by the `PermissionObserver`.
- The `PermissionStatus` creates the object on its creation thread. When
  `PermissionStatus` object is released (or disconnected from the owner, it
  disentangles itself from the `PermissionStatusSink`. The disentangle
  operation triggers the un-registration procedure from the
  `PermissionObserver` on the main thread.
- A weak `WorkerRef` is used to monitor the worker's lifetime.

Permission change notification:
- When the  `PermissionObserver` is notified for a permission-change event, it
  notifies all the `PermissionStatusSink`. This happens on the main thread (see
  `MaybeUpdatedByOnMainThread` and `MaybeUpdatedByNotifyOnlyOnMainThread`).
- Using `MozPromise`, the `PermissionStatusSink` computes the permission action
  (`PermissionChangedOnMainThread`) on the main thread, then informs the
  parent `PermissionStatus` object on its creation thread.
- The `PermissionStatus` object converts the action to the DOM
  `PermissionState` and dispatches an event.

Differential Revision: https://phabricator.services.mozilla.com/D224594
2024-10-11 06:53:48 +00:00
Stanca Serban
1ab1a63134 Backed out changeset f5c51fd71f7b (bug 1193373) as requested by dmeehan for causing Bug 1923938. CLOSED TREE 2024-10-10 22:03:50 +03:00
Andrea Marchesini
f16d10b381 Bug 1193373 - Support Permissions API in Worker Context, r=manuel,webidl,asuth,smaug
This commit exposes the Permissions API to DOM Workers. It achieves this goal
by introducing a thread-safe bridge between `PermissionStatus` and the
`PermissionObserver`: the `PermissionStatusSink` object.

Actors:
- The `PermissionObserver` is a main-thread-only singleton that monitors
  permission change events and propagates the notification to the right sink
  objects.
- The `PermissionStatus` is the DOM object exposed to the global. It's not
  thread-safe.
- The `PermissionStatusSink` is the new bridge introduced by this commit.

The `PermissionStatusSink` lifetime:
- This object is kept alive on the current thread by the `PermissionStatus` and
  on the main thread by the `PermissionObserver`.
- The `PermissionStatus` creates the object on its creation thread. When
  `PermissionStatus` object is released (or disconnected from the owner, it
  disentangles itself from the `PermissionStatusSink`. The disentangle
  operation triggers the un-registration procedure from the
  `PermissionObserver` on the main thread.
- A weak `WorkerRef` is used to monitor the worker's lifetime.

Permission change notification:
- When the  `PermissionObserver` is notified for a permission-change event, it
  notifies all the `PermissionStatusSink`. This happens on the main thread (see
  `MaybeUpdatedByOnMainThread` and `MaybeUpdatedByNotifyOnlyOnMainThread`).
- Using `MozPromise`, the `PermissionStatusSink` computes the permission action
  (`PermissionChangedOnMainThread`) on the main thread, then informs the
  parent `PermissionStatus` object on its creation thread.
- The `PermissionStatus` object converts the action to the DOM
  `PermissionState` and dispatches an event.

Differential Revision: https://phabricator.services.mozilla.com/D224594
2024-10-09 19:22:23 +00:00
Butkovits Atila
5478c35c08 Backed out changeset ac223d01dd41 (bug 1193373) for causing wpt failures complaining about persistent-storage. CLOSED TREE 2024-10-09 20:56:26 +03:00
Andrea Marchesini
f158039de6 Bug 1193373 - Support Permissions API in Worker Context, r=manuel,webidl,asuth,smaug
This commit exposes the Permissions API to DOM Workers. It achieves this goal
by introducing a thread-safe bridge between `PermissionStatus` and the
`PermissionObserver`: the `PermissionStatusSink` object.

Actors:
- The `PermissionObserver` is a main-thread-only singleton that monitors
  permission change events and propagates the notification to the right sink
  objects.
- The `PermissionStatus` is the DOM object exposed to the global. It's not
  thread-safe.
- The `PermissionStatusSink` is the new bridge introduced by this commit.

The `PermissionStatusSink` lifetime:
- This object is kept alive on the current thread by the `PermissionStatus` and
  on the main thread by the `PermissionObserver`.
- The `PermissionStatus` creates the object on its creation thread. When
  `PermissionStatus` object is released (or disconnected from the owner, it
  disentangles itself from the `PermissionStatusSink`. The disentangle
  operation triggers the un-registration procedure from the
  `PermissionObserver` on the main thread.
- A weak `WorkerRef` is used to monitor the worker's lifetime.

Permission change notification:
- When the  `PermissionObserver` is notified for a permission-change event, it
  notifies all the `PermissionStatusSink`. This happens on the main thread (see
  `MaybeUpdatedByOnMainThread` and `MaybeUpdatedByNotifyOnlyOnMainThread`).
- Using `MozPromise`, the `PermissionStatusSink` computes the permission action
  (`PermissionChangedOnMainThread`) on the main thread, then informs the
  parent `PermissionStatus` object on its creation thread.
- The `PermissionStatus` object converts the action to the DOM
  `PermissionState` and dispatches an event.

Differential Revision: https://phabricator.services.mozilla.com/D224594
2024-10-09 12:08:44 +00:00
Jan-Ivar Bruaroey
aba8e3ecff Bug 1609427 - Don't report Always Ask as "granted" if the privacy.resistFingerprinting pref is set. r=pbz
Differential Revision: https://phabricator.services.mozilla.com/D217644
2024-08-06 13:53:22 +00:00
Jan-Ivar Bruaroey
24867310e7 Bug 1609427 - Add permissions.media.query.enabled pref defaulting to true in Nightly. r=pbz
Differential Revision: https://phabricator.services.mozilla.com/D217635
2024-08-06 13:53:22 +00:00
Jan-Ivar Bruaroey
ebabe55004 Bug 1609427 - Interpret persisted PROMPT_ACTION (aka Always Ask) as "granted" for camera and mic. r=pbz,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D183065
2024-08-06 13:53:20 +00:00
Jan-Ivar Bruaroey
5f342ae36c Bug 1609427 - Add "camera" and "microphone" to permissions.query(). r=pbz,webidl,mt,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D183064
2024-08-06 13:53:19 +00:00
Benjamin VanderSloot
c9ff993e33 Bug 1901581 - Add autogrant for storage access based on fedCM - r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D216575
2024-07-26 16:53:23 +00:00
Emilio Cobos Álvarez
4ffa6418bb Bug 1904442 - Rename GlobalTeardownObserver::GetOwner to GetOwnerWindow. r=smaug,media-playback-reviewers,dom-storage-reviewers,aosmond,padenot,asuth
Also HasOrHasHadOwner to HasOrHasHadOwnerWindow.

Differential Revision: https://phabricator.services.mozilla.com/D214772
2024-07-01 11:49:59 +00:00
Peter Van der Beken
b4eccf070d Bug 1640839 - Stop generating count of WebIDL enum values, use standard enum traits instead. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D201345
2024-03-02 07:50:25 +00:00
Natalia Csoregi
8c2521e9d5 Backed out 13 changesets (bug 1640839) for causing bustage on Element.cpp CLOSED TREE
Backed out changeset 179ceb82c9e5 (bug 1640839)
Backed out changeset 73f498a821f0 (bug 1640839)
Backed out changeset dc2d3d0e0365 (bug 1640839)
Backed out changeset ddc989ac0509 (bug 1640839)
Backed out changeset e595bb3feea8 (bug 1640839)
Backed out changeset c85aca04e27f (bug 1640839)
Backed out changeset 98e8e3a4047a (bug 1640839)
Backed out changeset 59ef180517db (bug 1640839)
Backed out changeset af2f5e293662 (bug 1640839)
Backed out changeset 89aa6d9dc598 (bug 1640839)
Backed out changeset 67b722a722f9 (bug 1640839)
Backed out changeset 24a9665c6ced (bug 1640839)
Backed out changeset d93f199385e9 (bug 1640839)
2024-03-01 18:23:08 +02:00
Peter Van der Beken
89dde157ad Bug 1640839 - Stop generating count of WebIDL enum values, use standard enum traits instead. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D201345
2024-03-01 14:31:16 +00:00
Kagami Sascha Rosylight
3cb66846d5 Bug 1880096 - Use PermissionSetParameter for parseSetParameter IDL r=webidl,edgar
Differential Revision: https://phabricator.services.mozilla.com/D201738
2024-02-15 12:57:49 +00:00
Kagami Sascha Rosylight
466dba5633 Bug 1876754 - Add Permissions::ParseSetParameters for webdriver r=webdriver-reviewers,webidl,smaug,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D200941
2024-02-12 16:08:03 +00:00
Kagami Sascha Rosylight
7a765ce3b2 Bug 1876322 - Part 3: Use Init instead of having Create for each PermissionStatus r=smaug
The current Create pattern looks like an effort to not have uninited PermissionStatus, but I'm planning to reuse DryCreatePermissionStatus for WebDriver purpose which doesn't need the observer and the query parts, so this works better for that.

Differential Revision: https://phabricator.services.mozilla.com/D199549
2024-01-25 15:26:43 +00:00
Kagami Sascha Rosylight
0f3e34f96f Bug 1876322 - Part 2: Add step comments r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D199548
2024-01-25 15:26:43 +00:00
Kagami Sascha Rosylight
a79745fff2 Bug 1876322 - Part 1: Make MidiPermissionDescriptor::sysex default to false r=webidl,asuth
Differential Revision: https://phabricator.services.mozilla.com/D199547
2024-01-25 15:26:43 +00:00
Vincent Hilla
f0dc3526ed 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
0917a1636c 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
956cdde134 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
094d813e4c Bug 1858494 - Return permission action rather than boolean when fetching the storage access permission from the parent process - r=timhuang,anti-tracking-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D190722
2023-10-12 16:58:22 +00:00
Tom Marble
faa34b0552 Bug 1855296 - convert .ini manifests to .toml: batch 9 dom/[m-s]**/mochitest.ini r=jmaher,media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D189845
2023-10-03 19:35:22 +00:00
Gregory Pappas
dd0ad61e60 Bug 1697151 - Remove permissions.delegation.enabled pref r=pbz
Differential Revision: https://phabricator.services.mozilla.com/D185342
2023-08-11 15:15:54 +00:00
Peter Van der Beken
3f4ffadbe1 Bug 1846277 - Untangle nsGlobalWindow*.h includes. r=dom-core,media-playback-reviewers,sessionstore-reviewers,padenot,farre
Differential Revision: https://phabricator.services.mozilla.com/D184978
2023-08-02 20:41:49 +00:00
Benjamin VanderSloot
bd24eefece Bug 1733556 - Perform Permissions Policy check in navigator.permissions.query for "storage-access" - r=anti-tracking-reviewers,pbz
Differential Revision: https://phabricator.services.mozilla.com/D182374
2023-07-19 14:51:13 +00:00
Benjamin VanderSloot
035109eef7 Bug 1805860 - Add "storage-access" permission to dom::Permissions - r=anti-tracking-reviewers,webidl,saschanaz,pbz,smaug
Differential Revision: https://phabricator.services.mozilla.com/D182246
2023-07-19 14:51:13 +00:00
Benjamin VanderSloot
1ac439a64e Bug 1805860 - Extend dom::PermissionStatus to support storage-access permission - r=anti-tracking-reviewers,pbz
This means:
- Making creation function calls async
- Making GetPrincipal more specific
- Making PermissionState mState protected instead of private and virtualizing UpdateState so children can have custom update logic

Differential Revision: https://phabricator.services.mozilla.com/D182245
2023-07-19 14:51:12 +00:00
Benjamin VanderSloot
0129b6667c Bug 1805860 - Notify PermissionObserver when doubly keyed permissions are updated - r=anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D182243
2023-07-19 14:51:11 +00:00
Benjamin VanderSloot
19ec221a97 Bug 1805860 - Remove navigator.permissions.revoke dead code - r=anti-tracking-reviewers,ipc-reviewers,webidl,saschanaz,mccr8,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D182242
2023-07-19 14:51:11 +00:00
Stanca Serban
9e82c693d0 Backed out 8 changesets (bug 1805860, bug 1733556) for causing bp-nu bustages in StorageAccessAPIHelper.cpp.
Backed out changeset fa21a55ce837 (bug 1733556)
Backed out changeset 6c09379cdb5a (bug 1733556)
Backed out changeset d8c19265b981 (bug 1733556)
Backed out changeset d48d415fca83 (bug 1805860)
Backed out changeset 3acd0ba1dba6 (bug 1805860)
Backed out changeset d2a6174bbb14 (bug 1805860)
Backed out changeset 48558ba49efe (bug 1805860)
Backed out changeset c8693b9449d3 (bug 1805860)
2023-07-18 23:39:08 +03:00
Benjamin VanderSloot
39df0b9d01 Bug 1733556 - Perform Permissions Policy check in navigator.permissions.query for "storage-access" - r=anti-tracking-reviewers,pbz
Differential Revision: https://phabricator.services.mozilla.com/D182374
2023-07-18 19:14:31 +00:00
Benjamin VanderSloot
316b05c4b2 Bug 1805860 - Add "storage-access" permission to dom::Permissions - r=anti-tracking-reviewers,webidl,saschanaz,pbz,smaug
Differential Revision: https://phabricator.services.mozilla.com/D182246
2023-07-18 19:14:31 +00:00
Benjamin VanderSloot
565a2b60ba Bug 1805860 - Extend dom::PermissionStatus to support storage-access permission - r=anti-tracking-reviewers,pbz
This means:
- Making creation function calls async
- Making GetPrincipal more specific
- Making PermissionState mState protected instead of private and virtualizing UpdateState so children can have custom update logic

Differential Revision: https://phabricator.services.mozilla.com/D182245
2023-07-18 19:14:31 +00:00
Benjamin VanderSloot
7b4d1e4af1 Bug 1805860 - Notify PermissionObserver when doubly keyed permissions are updated - r=anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D182243
2023-07-18 19:14:30 +00:00
Benjamin VanderSloot
0530069978 Bug 1805860 - Remove navigator.permissions.revoke dead code - r=anti-tracking-reviewers,ipc-reviewers,webidl,saschanaz,mccr8,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D182242
2023-07-18 19:14:30 +00:00
William Durand
5f3f11820e Bug 1437171 - Add Web MIDI support in navigator.permissions.query(). r=webidl,smaug,pbz
Differential Revision: https://phabricator.services.mozilla.com/D164036
2022-12-15 10:24:17 +00:00
Iulian Moraru
747186542b Backed out changeset 51b2a95943c0 (bug 1437171) for causing wpt failures on all-permissions.html related to query "midi" permission. 2022-12-15 06:10:01 +02:00
William Durand
3da94170fc Bug 1437171 - Add Web MIDI support in navigator.permissions.query(). r=webidl,smaug,pbz
Differential Revision: https://phabricator.services.mozilla.com/D164036
2022-12-14 22:20:37 +00:00
Olli Pettay
93acdfad59 Bug 1777574, automate CC zone handling, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D155084
2022-09-07 11:22:51 +00:00
Mark Banner
783a2f2187 Bug 1788037 - Turn on ESLint rule for prefer-boolean-length-check for dom. r=asuth,karlt
Differential Revision: https://phabricator.services.mozilla.com/D155965
2022-09-02 11:05:17 +00:00
Christian Holler
146a80ecff Bug 1783844 - Remove IPC::Principal type remains from codebase. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D154091
2022-08-10 13:39:11 +00:00
Mark Banner
7428be4a86 Bug 1782008 - Remove now unnecessary .eslintrc.js files. r=webcompat-reviewers,extension-reviewers,media-playback-reviewers,pip-reviewers,denschub,rpl,alwu,mossop
Differential Revision: https://phabricator.services.mozilla.com/D152736
2022-08-03 11:16:20 +00:00
Kagami Sascha Rosylight
eb5642168c Bug 1768189 - Part 24: Apply modernize-concat-nested-namespaces to dom/performance/PerformanceNavigation.h ... r=andi
Depends on D145757

Differential Revision: https://phabricator.services.mozilla.com/D145758
2022-05-09 20:41:12 +00:00