Closed Bug 1790081 Opened 2 years ago Closed 2 years ago

Make XPCVariant into a normal script holder class

Categories

(Core :: XPConnect, task, P3)

task

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(1 file)

There's no reason I can see for XPCVariant (or more specifically its script object holding subclass XPCTraceableVariant) to use the weird XPCRootSetElem infrastructure. This begins to root an object when it is created, and stops rooting it when it is destroyed. I have a patch to fold XPCTraceableVariant into XPCVariant, and also make it a normal CCed script holder class.

The traverse method no longer traverses the JS val, because that will
now be automatically traced by the CC using the trace method.

The purple methods are unused.

I marked a few methods that regular callers shouldn't use protected.

I'm doing a try push but this at least passed the plain XPConnect Mochitests.

It is possible that the other XPCRootSetElem, nsXPCWrappedJS, could be converted in the same way, but it is a bit weird, and I'm looking at ripping out a lot of the weirdness, so I'm going to leave it alone for now.

Blocks: 1790102
Pushed by amccreight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/51b479eabece Make XPCVariant into a normal script holder class. r=smaug
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: