Make nsXPCWrappedJS into a regular script holder class
Categories
(Core :: XPConnect, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox106 | --- | fixed |
People
(Reporter: mccr8, Assigned: mccr8)
References
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
I looked into this, and despite the weirdness of nsXPCWrappedJS, it doesn't look hard to turn this into a regular script holder class. This also lets me get rid of XPCRootSetElem.
The existing code changes whether the object is in the root set when IsSubjectToFinalization() changes due to the refcount. I think it makes more sense to just make it always be in the root set (via HoldJSObjects) and then instead conditionally trace the JS object if !IsSubjectToFinalization()
holds. This means the root set is bigger because it includes WJS subject to finalization, but that seems trivial.
Assignee | ||
Comment 1•2 years ago
|
||
The main difference here is that WJS now are in the root set (as JS holders) for
their entire lifetime, instead of being added or removed as their refcount
changes. Instead, the trace method simply doesn't trace the JS object if
it is subject to finalization.
This lets me get rid of XPCRootSetElem, which now has no users.
Comment 3•2 years ago
|
||
bugherder |
Description
•