Closed Bug 1857431 Opened 1 year ago Closed 1 year ago

Use xpc::InitGlobalObjectOptions more

Categories

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

task

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: tschuster, Assigned: tschuster)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sp3])

Attachments

(3 files)

We already use xpc::InitGlobalObjectOptions in two places to set-up some common RealmOption options. However we have a lot more places that create realms (globals) that could probably benefit from using this shared helper.

I don't really like having all these boolean parameters, but I don't have a good solution for it right now. One partial idea I had was to pass the ShouldResistFingerprinting function as a pointer to reduce the amount of code duplication and number of parameters?

This introduces two slight changes of behavior:

  • Workers with a system principal are now always treated as secure context, without looking at the mIsSecureContext flag.
  • We now also discard sources for all types of workers with a system principal

Depends on D190281

Pushed by tschuster@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a123f5f76df9 Move InitGlobalObjectOptions to xpcpublic.h. r=mccr8 https://hg.mozilla.org/integration/autoland/rev/851710cba0db Add aSecureContext to xpc::InitGlobalObjectOptions. r=mccr8,smaug https://hg.mozilla.org/integration/autoland/rev/71a693e4a4d9 Use xpc::InitGlobalObjectOptions for Workers. r=dom-worker-reviewers,smaug https://hg.mozilla.org/integration/autoland/rev/99a4d6fcfc2f apply code formatting via Lando
Whiteboard: [sp3]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: