Commit Graph

1632 Commits

Author SHA1 Message Date
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
Andrea Marchesini
b0c6c72ad0 Bug 1923501 - Fix WPT workers/shared-worker-options-mismatch.html, r=asuth
https://html.spec.whatwg.org/multipage/workers.html#dom-sharedworker 11.4: "If worker global scope is not null, then check if worker global scope's type and credentials match the options values. If not, queue a task to fire an event named error and abort these steps."

Differential Revision: https://phabricator.services.mozilla.com/D224997
2024-10-08 23:05:04 +00:00
Tamas Szentpeteri
8be45dd280 Backed out changeset 4b1409597101 (bug 1920718) for causing bp bustages on rapl.cpp. 2024-10-08 23:27:18 +03:00
serge-sans-paille
069a97307f Bug 1920718 - Annotate all global variable with runtime initialization as MOZ_RUNINIT r=application-update-reviewers,media-playback-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,gfx-reviewers,aosmond,lina,nalexander,aabh
This annotation is only understood by our clang-tidy plugin. It has no
effect on regular compilation.

Differential Revision: https://phabricator.services.mozilla.com/D223341
2024-10-08 16:49:51 +00:00
Mike Hommey
d832365263 Bug 1922437 - Rename nsIAndroid* classes to nsIGeckoView*. r=geckoview-reviewers,nika,frontend-codestyle-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D224429
2024-10-03 22:21:51 +00:00
Andrea Marchesini
a7281f816e Bug 1681218 - Expose EventSource on ServiceWorkers, r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D224058
2024-10-01 06:24:43 +00:00
smayya
c3d6a495e4 Bug 1914632 - delete the actors during shutdown for worker keepalive requests.r=edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D222437
2024-09-24 17:10:06 +00:00
Butkovits Atila
afadfbae6f Backed out 5 changesets (bug 1906952, bug 1914632, bug 1901761) for causing bustage at RefPtr.h. CLOSED TREE
Backed out changeset 4dadc74e5e51 (bug 1906952)
Backed out changeset 0689a41fae4c (bug 1914632)
Backed out changeset 1f93aaf15cf6 (bug 1914632)
Backed out changeset 37dbae4a6310 (bug 1914632)
Backed out changeset 177540310817 (bug 1901761)
2024-09-24 17:21:15 +03:00
smayya
0b633362f5 Bug 1914632 - delete the actors during shutdown for worker keepalive requests.r=edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D222437
2024-09-24 11:30:22 +00:00
Paul Zuehlcke
d1cf259440 Bug 1915419 - Update test callers deleteDataFromBaseDomain -> deleteDataFromSite. r=anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D220607
2024-09-24 09:17:56 +00:00
Paul Zuehlcke
2571c68a9e Bug 1915419 - Extend deleteDataFromSite to support OriginAttributesPattern filtering. r=anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D220606
2024-09-24 09:17:56 +00:00
Paul Zuehlcke
e73edb5ea2 Bug 1915419 - Refactor deleteDataFromBaseDomain to deleteDataFromSite. r=anti-tracking-reviewers,geckoview-reviewers,owlish,timhuang
- Renames deleteDataFromBaseDomain to deleteDataFromSite.
 - Cleans up terminology for (schemeless site) to better align with standards.
 - deleteDataFromSite requires a schemeless site to be passed in. We will no longer
   implicitly convert the host to a site.
 - Removes the host fallback for SiteDataManager and ForgetAboutSite. The new schemeless site
   helper Services.eTLD.getSchemelessSiteFromHost accounts for this.

Differential Revision: https://phabricator.services.mozilla.com/D220605
2024-09-24 09:17:55 +00:00
Fatih
406c61a75a Bug 1920128: Use service worker's origin attributes instead of nothing. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D222978
2024-09-23 18:19:04 +00:00
Joel Maher
215f1b08c7 Bug 1920244 - Remove serviceworker_e10s references in .toml and mochitest/xpcshell harnesses. r=aryx
Differential Revision: https://phabricator.services.mozilla.com/D223012
2024-09-23 14:21:16 +00:00
Eden Chuang
a009c49f93 Bug 1843001 - Allow fetch() to localhost in Workers while network is offline. r=asuth,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D198374
2024-09-23 09:07:52 +00:00
Norisz Fay
29cf8de752 Backed out 6 changesets (bug 1915419) for causing xpcshell failures on test_bounce_tracking_protection.js
Backed out changeset 65896495cce9 (bug 1915419)
Backed out changeset 042d3bc01bdb (bug 1915419)
Backed out changeset 8185b8989a78 (bug 1915419)
Backed out changeset ec3186533ad3 (bug 1915419)
Backed out changeset 0507ac7bb539 (bug 1915419)
Backed out changeset dfde58cea10c (bug 1915419)
2024-09-20 20:50:27 +03:00
Paul Zuehlcke
ab011ea956 Bug 1915419 - Update test callers deleteDataFromBaseDomain -> deleteDataFromSite. r=anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D220607
2024-09-20 15:46:37 +00:00
Paul Zuehlcke
c425da49b6 Bug 1915419 - Extend deleteDataFromSite to support OriginAttributesPattern filtering. r=anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D220606
2024-09-20 15:46:36 +00:00
Paul Zuehlcke
a3cd88ffdb Bug 1915419 - Refactor deleteDataFromBaseDomain to deleteDataFromSite. r=anti-tracking-reviewers,geckoview-reviewers,owlish,timhuang
- Renames deleteDataFromBaseDomain to deleteDataFromSite.
 - Cleans up terminology for (schemeless site) to better align with standards.
 - deleteDataFromSite requires a schemeless site to be passed in. We will no longer
   implicitly convert the host to a site.
 - Removes the host fallback for SiteDataManager and ForgetAboutSite. The new schemeless site
   helper Services.eTLD.getSchemelessSiteFromHost accounts for this.

Differential Revision: https://phabricator.services.mozilla.com/D220605
2024-09-20 15:46:35 +00:00
Butkovits Atila
e2848bdc49 Backed out 12 changesets (bug 1915419) for causing failures at test_bouncetracking_purge.js. CLOSED TREE
Backed out changeset e5c32a502e0f (bug 1915419)
Backed out changeset 8cbcbb25fc99 (bug 1915419)
Backed out changeset 947379a2f167 (bug 1915419)
Backed out changeset 4cfe3a954ade (bug 1915419)
Backed out changeset 94fba1a2786b (bug 1915419)
Backed out changeset 477b4f7c2760 (bug 1915419)
Backed out changeset ed6c8d9d39d4 (bug 1915419)
Backed out changeset e534c390101c (bug 1915419)
Backed out changeset bc3fe74a8b03 (bug 1915419)
Backed out changeset afefdce605f9 (bug 1915419)
Backed out changeset e58887b90d39 (bug 1915419)
Backed out changeset 114298b7b855 (bug 1915419)
2024-09-18 17:49:45 +03:00
Paul Zuehlcke
2e91f97c4a Bug 1915419 - Update test callers deleteDataFromBaseDomain -> deleteDataFromSite. r=anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D220607
2024-09-18 12:50:38 +00:00
Paul Zuehlcke
fb8d4a4779 Bug 1915419 - Extend deleteDataFromSite to support OriginAttributesPattern filtering. r=anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D220606
2024-09-18 12:50:37 +00:00
Paul Zuehlcke
1694a5c903 Bug 1915419 - Refactor deleteDataFromBaseDomain to deleteDataFromSite. r=anti-tracking-reviewers,geckoview-reviewers,owlish,timhuang
- Renames deleteDataFromBaseDomain to deleteDataFromSite.
 - Cleans up terminology for (schemeless site) to better align with standards.
 - deleteDataFromSite requires a schemeless site to be passed in. We will no longer
   implicitly convert the host to a site.
 - Removes the host fallback for SiteDataManager and ForgetAboutSite. The new schemeless site
   helper Services.eTLD.getSchemelessSiteFromHost accounts for this.

Differential Revision: https://phabricator.services.mozilla.com/D220605
2024-09-18 12:50:36 +00:00
Norisz Fay
483f669512 Backed out 12 changesets (bug 1915419) for causing clearDataFromBaseDomain related gv-junit failures CLOSED TREE
Backed out changeset 6baf34e653ef (bug 1915419)
Backed out changeset 3015863afd5d (bug 1915419)
Backed out changeset 90558f317a75 (bug 1915419)
Backed out changeset 5f07cb9268dd (bug 1915419)
Backed out changeset aedba16d4af7 (bug 1915419)
Backed out changeset d9a2d5c2ba53 (bug 1915419)
Backed out changeset 4a250c451004 (bug 1915419)
Backed out changeset c6da2e632da6 (bug 1915419)
Backed out changeset 9256540ed21a (bug 1915419)
Backed out changeset 7621d766d6a4 (bug 1915419)
Backed out changeset 16d6589ba330 (bug 1915419)
Backed out changeset b3eebd764439 (bug 1915419)
2024-09-16 18:29:55 +03:00
Paul Zuehlcke
db9670bdff Bug 1915419 - Update test callers deleteDataFromBaseDomain -> deleteDataFromSite. r=anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D220607
2024-09-16 13:25:28 +00:00
Paul Zuehlcke
6fa6e489f2 Bug 1915419 - Extend deleteDataFromSite to support OriginAttributesPattern filtering. r=anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D220606
2024-09-16 13:25:28 +00:00
Paul Zuehlcke
5d8d5551ac Bug 1915419 - Refactor deleteDataFromBaseDomain to deleteDataFromSite. r=anti-tracking-reviewers,geckoview-reviewers,owlish,timhuang
- Renames deleteDataFromBaseDomain to deleteDataFromSite.
 - Cleans up terminology for (schemeless site) to better align with standards.
 - deleteDataFromSite requires a schemeless site to be passed in. We will no longer
   implicitly convert the host to a site.
 - Removes the host fallback for SiteDataManager and ForgetAboutSite. The new schemeless site
   helper Services.eTLD.getSchemelessSiteFromHost accounts for this.

Differential Revision: https://phabricator.services.mozilla.com/D220605
2024-09-16 13:25:27 +00:00
Andrea Marchesini
8dc8885a91 Bug 1918643 - Enable cookieStore API in Nightly builds, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D222102
2024-09-16 12:56:32 +00:00
Florian Quèze
f657343551 Bug 1915228 - Remove expired telemetry scalars serviceworker.registrations and serviceworker.running_max, r=chutten,jesup.
Depends on D220323

Differential Revision: https://phabricator.services.mozilla.com/D220324
2024-08-28 19:44:31 +00:00
Florian Quèze
310eba3ff8 Bug 1915228 - Remove expired telemetry scalars sw.cors_res_for_so_req_count and sw.alternative_body_used_count, r=chutten.
Depends on D220322

Differential Revision: https://phabricator.services.mozilla.com/D220323
2024-08-28 19:44:31 +00:00
Benjamin VanderSloot
8ea1ccd6c8 Bug 1907326 - Fix WPT exceptions after default GeckoView cookieBehavior change to 5. r=bvandersloot,webdriver-reviewers,Sasha
Depends on D216292

Differential Revision: https://phabricator.services.mozilla.com/D217979
2024-08-28 15:11:52 +00:00
Iulian Moraru
0c16dbffa5 Backed out 6 changesets (bug 1907326, bug 1873984, bug 1873986, bug 1899969, bug 1873982) for causing multiple wd assertion failures.
Backed out changeset fa6623f6fbd3 (bug 1873982)
Backed out changeset eba7918d1a27 (bug 1873986)
Backed out changeset 6da85e97c413 (bug 1907326)
Backed out changeset 7781c1ae8573 (bug 1899969)
Backed out changeset 111b1d2a8acd (bug 1873984)
Backed out changeset 6f566eb5a71f (bug 1907326)
2024-08-28 02:37:51 +03:00
Fatih
e0fa604e61 Bug 1885471: Generate randomization key for service workers. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D219918
2024-08-27 19:11:55 +00:00
Benjamin VanderSloot
b5908737cd Bug 1907326 - Fix WPT exceptions after default GeckoView cookieBehavior change to 5. r=bvandersloot,webdriver-reviewers,Sasha
Depends on D216292

Differential Revision: https://phabricator.services.mozilla.com/D217979
2024-08-27 19:11:33 +00:00
Norisz Fay
1679bdbe56 Backed out 6 changesets (bug 1873986, bug 1907326, bug 1873984, bug 1899969, bug 1873982) for causing mochitest failure on test_https_synth_fetch_from_cached_sw.html
Backed out changeset c21d648be7d8 (bug 1873982)
Backed out changeset 2085dd0f17aa (bug 1873986)
Backed out changeset c16a498708f2 (bug 1907326)
Backed out changeset 710052f24e76 (bug 1899969)
Backed out changeset 49c60fc62f3f (bug 1873984)
Backed out changeset 34d80bc1d5a0 (bug 1907326)
2024-08-27 19:42:06 +03:00
Benjamin VanderSloot
2cb1d05b3a Bug 1907326 - Fix WPT exceptions after default GeckoView cookieBehavior change to 5. r=bvandersloot,webdriver-reviewers,Sasha
Depends on D216292

Differential Revision: https://phabricator.services.mozilla.com/D217979
2024-08-27 14:52:07 +00:00
Stanca Serban
44d0b6c8bd Backed out 6 changesets (bug 1873982, bug 1873984, bug 1907326, bug 1873986, bug 1899969) for causing multiple failures. CLOSED TREE
Backed out changeset 6f62ee42e191 (bug 1873982)
Backed out changeset 49abb24e8d16 (bug 1873986)
Backed out changeset c291a4fdda58 (bug 1907326)
Backed out changeset 9eea8ecac9fd (bug 1899969)
Backed out changeset 520ee18d5bd3 (bug 1873984)
Backed out changeset 72f2e86ed2fe (bug 1907326)
2024-08-27 00:08:08 +03:00
Benjamin VanderSloot
6fb07d64cb Bug 1907326 - Fix WPT exceptions after default GeckoView cookieBehavior change to 5. r=bvandersloot
Depends on D216292

Differential Revision: https://phabricator.services.mozilla.com/D217979
2024-08-26 18:52:45 +00:00
Peter Van der Beken
839abe8af7 Bug 1900930 - Add WouldReportJSException() calls. r=dom-core,farre,necko-reviewers,kershaw
TypedArray::Create will put exceptions on the ErrorResult, so signal that we're
dealing with them in various callsites.

Differential Revision: https://phabricator.services.mozilla.com/D214794
2024-08-21 08:43:09 +00:00
Ryan Hunt
c05fbba37f Bug 1913482 - wasm: Mark JSTag as exposed in release. r=yury,webidl,saschanaz
We are now shipping exnref, so the JSTag interface is now
exposed.

Depends on D219539

Differential Revision: https://phabricator.services.mozilla.com/D219540
2024-08-20 14:11:25 +00:00
Florian Quèze
4d5f30b3fe Bug 1913624 - Remove expired telemetry histogram SERVICE_WORKER_UPDATED, r=chutten.
Depends on D219445

Differential Revision: https://phabricator.services.mozilla.com/D219446
2024-08-20 10:26:53 +00:00
Florian Quèze
86f7136fa6 Bug 1913624 - Remove expired telemetry histogram SERVICE_WORKER_CONTROLLED_DOCUMENTS, r=chutten.
Depends on D219444

Differential Revision: https://phabricator.services.mozilla.com/D219445
2024-08-20 10:26:53 +00:00
Iulian Moraru
901d4d853f Backed out changeset 87f698d4fb8e (bug 1843001) for causing mochitest-plain failures on test_offline_localhost_fetch.html. CLOSED TREE 2024-08-15 12:11:13 +03:00
Eden Chuang
84e9738a88 Bug 1843001 - Allow fetch() to localhost in Workers while network is offline. r=asuth,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D198374
2024-08-15 08:08:05 +00:00
Jan Varga
8abf89672b Bug 1866217 - Change nsIQuotaManagerService::GetUsageForPrincipal to support getting origin usage only by inspecting disk; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D195365
2024-08-13 10:40:08 +00:00
Daniel Minor
085595ab3a Bug 1896390 - Ship iterator helpers; r=mgaudet,webidl,emilio
Differential Revision: https://phabricator.services.mozilla.com/D217744
2024-08-07 03:47:53 +00:00