Open Bug 1270687 Opened 10 years ago Updated 3 days ago

Replace all naked 'new's of reference-counted classes with calls to MakeAndAddRef<T>

Categories

(Core :: MFBT, defect)

defect

Tracking

()

People

(Reporter: nika, Unassigned)

References

(Depends on 2 open bugs, Blocks 1 open bug)

Details

This is needed to be able to do nice things such as the change in bug 1270638.
Let's discuss this on m.d.platform first, shall we?
See Also: → 1681733
Severity: normal → S3

Note, classes with private constructors require a bit of special handling & special consideration here - see bug 1186012 comment 2.

Also note for folks working on conversions in the spirit of this bug: along with MakeAndAddRef<T> in this bug's title, we now also have MakeRefPtr<T> (added in bug 1354642, after this bug here was filed), which arguably a bit easier to read and is just as good for many use cases.

It has the same benefit of instantly AddRef'ing. The only difference is the return type (RefPtr vs already_AddRefed), and in many cases it doesn't really matter which one we're returning.

Depends on: 2037761
Depends on: 2037754
Depends on: 2037700
You need to log in before you can comment on or make changes to this bug.