On Mon, May 12, 2014 at 9:36 AM, Kyle Huey <m...@kylehuey.com> wrote:

> We should get rid of RefPtr, just like we did the MFBT refcounting classes.
>
> The main thing stopping a mechanical search and replace is that the
> two smart pointers have different semantics around
> already_AddRefed/TemporaryRef :(


Nit: Aren't the TemporaryRef semantics better? Seems like replacing
RefPtr-based stuff's use of RefPtr with nsRefPtr would be be making things
at least slightly worse here.

PSM (security/certverifier/* and security/manager/*) uses RefPtr because
RefPtr is more consistent with ScopedPtr, which PSM uses extensively to
provide RAII wrappers around NSS types in
security/manager/ssl/src/ScopedNSSTypes.h. IIRC, RefPtr's API is also
closer to std::shared_ptr's API, which I think is a plus. IMO, the PSM code
would be less self-consistent/readable if it were switched to use nsRefPtr,
unless we also replaced ScopedPtr with nsAuto???.

Cheers,
Brian
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to