Closed Bug 1582039 Opened 2 months ago Closed 2 months ago

Clean up JSContext::runningWithTrustedPrincipals

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: jandem, Assigned: jandem)

Details

Attachments

(1 file)

It currently returns true if runtime->trustedPrincipals() == nullptr which doesn't seem right.

I think we can simplify by expressing in terms of realm->isSystem() because isSystem is derived from the runtime's trustedPrincipals too.

This is a bit simpler and faster and avoids returning true when
rt->trustedPrincipals is nullptr.

Attachment #9093521 - Attachment description: Bug 1582039 - Use realm->isSystem() in JSContext::runningWithTrustedPrincipals. r?luke! → Bug 1582039 - Use realm->isSystem() in JSContext::runningWithTrustedPrincipals(). r?luke!
Attachment #9093521 - Attachment description: Bug 1582039 - Use realm->isSystem() in JSContext::runningWithTrustedPrincipals(). r?luke! → Bug 1582039 - Use realm->isSystem() in JSContext::runningWithTrustedPrincipals() and rename to JSContext::runningSystemCode(). r?luke!
Priority: -- → P1
Attachment #9093521 - Attachment description: Bug 1582039 - Use realm->isSystem() in JSContext::runningWithTrustedPrincipals() and rename to JSContext::runningSystemCode(). r?luke! → Bug 1582039 - Make JSContext::runningWithTrustedPrincipals() return false if trustedPrincipals() is nullptr. r?luke!
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6fb6e6cf5d94
Make JSContext::runningWithTrustedPrincipals() return false if trustedPrincipals() is nullptr. r=luke
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.