StrongOrRawPtr should accept a RefPtr
Categories
(Core :: DOM: Bindings (WebIDL), defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox72 | --- | fixed |
People
(Reporter: sg, Assigned: sg)
Details
Attachments
(1 file)
StrongOrRawPtr
only accepts a raw pointer or the deprecated already_AddRefed<>&&
. It should also accept RefPtr<>&&
directly to not force classes implementing the binding to use already_AddRefed
.
Assignee | ||
Comment 1•6 years ago
|
||
![]() |
||
Comment 2•6 years ago
|
||
The patch is fine as far as it goes, bug could you point me to where already_AddRefed
got deprecated? The last discussion I see on that is in 2016 (on mozilla.dev.platform), and the conclusion seemed to be that using RefPtr
by value in places where we currently use already_AddRefed
lost us valuable assertions about expected behavior and introduced threadsafety concerns. Has something changed since then?
Assignee | ||
Comment 3•6 years ago
|
||
I was following https://bugzilla.mozilla.org/show_bug.cgi?id=1349379. It's what the summary of the bug says. In conclusion, maybe "deprecated" does not properly describe this, but "deprecated except for specific uses that remain legitimate" is what I understand from that.
![]() |
||
Comment 4•6 years ago
|
||
Ah, I see. The summary there doesn't really cover the situation, yeah.
Returning RefPtr is slightly footgunny right now, but I guess for the specific cases where StrongOrRawPtr is used it's not really a problem. We just need to watch out for people overusing RefPtr return values where they're not really needed or appropriate...
Comment 6•6 years ago
|
||
bugherder |
Description
•