As a leftover from the multithreaded runtime era JSPRINCIPALS_(HOLD|DROP) still use atomic operations when updating JSPrincipals::refcount. We should remove that. Also it would be nice to remove the unused JSContext *cx parameter that often requires to pass that cx through many layers of API.
Created attachment 595181 [details] [diff] [review] v1 The patch drops atomic operations around JSPrincipals::refcount and removes the cx parameter from JSPRINCIPALS_(HOLD|DROP). That removal is propagated to the callers when possible.
Assignee: general → igor
Attachment #595181 - Flags: review?(mrbkap)
Is this safe given the comments near the end of bug 143559? nsPrincipal uses atomic increment/decrement on the JSPrincipals, and could race with main-thread code per that bug, right?
(In reply to Boris Zbarsky (:bz) from comment #2) > Is this safe given the comments near the end of bug 143559? nsPrincipal > uses atomic increment/decrement on the JSPrincipals, and could race with > main-thread code per that bug, right? You are absolutely right - the principals must continue to use atomic refcounter mutators. So I mutate the bug to be about eliminating unnecessary cx parameter from principals-related methods. That allows to eliminate few useless compartment enter() calls.
Summary: remove multithreaded support from JSPrincipals → remove cx argument from principals-related callbacks
This was addressed in the bug 730221.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Depends on: 730221
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.