Closed Bug 1851854 Opened 2 years ago Closed 2 years ago

Worklets should read from Preferences for JS ContextOptions

Categories

(Core :: DOM: Core & HTML, task)

task

Tracking

()

RESOLVED FIXED
119 Branch
Tracking Status
firefox-esr115 119+ fixed
firefox119 --- fixed

People

(Reporter: rhunt, Assigned: jandem)

References

Details

Attachments

(1 file)

See bug 1851468. It looks like WorkletThread does not use xpc::SetPrefableContextOptions or equivalent when creating a JSContext. This means that JS/wasm features cannot be changed via preference for worklets.

Component: DOM: Workers → DOM: Core & HTML

Currently bug 1851468 switches exceptions feature to Default. It will be nice to revert it back with this patch.

SetPrefableContextOptions currently has to be called on the main thread, so store
the options in StartModuleLoadRunnable and copy them on the worklet thread.

This doesn't update the options when the prefs are changed, but we've been moving
to read-on-startup for prefs so we probably don't need that.

Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
See Also: → 1852327
Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c68020261812 Use SetPrefableContextOptions for worklet JS ContextOptions. r=mccr8
Type: defect → task
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch

Comment on attachment 9352198 [details]
Bug 1851854 - Use SetPrefableContextOptions for worklet JS ContextOptions. r?mccr8!

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: It's a small and safe patch that fixes some of our JS prefs to also apply to worklets. For example, if someone disables WebAssembly, without this patch we'd still have it enabled for worklets, and this is a footgun.
  • User impact if declined: See above. Some prefs not applying to worklets.
  • Fix Landed on Version: 119
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky):
Attachment #9352198 - Flags: approval-mozilla-esr115?

Comment on attachment 9352198 [details]
Bug 1851854 - Use SetPrefableContextOptions for worklet JS ContextOptions. r?mccr8!

I assume we'd want to get this to Beta for 118 also?

Attachment #9352198 - Flags: approval-mozilla-beta?

To clarify:

  • Bug 1851468 fixed a regression introduced in Firefox 117 for the Wasm exception handling feature.
  • The patch in this bug fixes the more general (and older) worklet issue of (some) JS prefs not being applied to worklet threads.

Comment on attachment 9352198 [details]
Bug 1851854 - Use SetPrefableContextOptions for worklet JS ContextOptions. r?mccr8!

Removing the beta uplift approval given the context given by Jan.

Attachment #9352198 - Flags: approval-mozilla-beta?

Comment on attachment 9352198 [details]
Bug 1851854 - Use SetPrefableContextOptions for worklet JS ContextOptions. r?mccr8!

Approved for 115.4esr

Attachment #9352198 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: