On 12/20/2013 10:55 AM, Neil wrote:
Brian Smith wrote:

In PSM, we created some scoped pointer wrapper types around NSS data
structures (ScopedNSSTypes.h), which are based on the MFBT scoped
pointers. And, consequently, PSM has standardized on MFBT smart
pointers throughout the module (there should be nsRefPtr in PSM, only
RefPtr, for example). Yet, most code in Gecko is based on the
nsCOMPtr-like smart pointers (nsAutoPtr, nsRefPtr). I don't know how
big of a deal this is, but this is the type of thing that would need
to be resolved to have a consistent style throughout Gecko.

I thought that it was pretty clear which smart pointer to use:
nsCOMPtr - interfaces
nsRefPtr - concrete types that inherit from nsISupports
RefPtr - everything else (i.e. no QueryInterface)

That makes it quite clear it isn't clear:

nsCOMPtr - interfaces
nsRefPtr - concrete types
RefPtr - code imported from WebKit

HTH
Ms2ger

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

Reply via email to