On 08/10/12 04:14, Boris Zbarsky wrote:
On 10/7/12 4:13 PM, Ehsan Akhgari wrote:
Nice!  Can you please share some info on when you can avoid
inheriting from nsISupports and whether we can make the cycle
collector aware of such objects?

Basically, the rules are as follows:

1)  You need to either not need cycle collection (e.g. because you have
no wrapper cache and no strong ref members) or need to implement the
"native" CC stuff as Andrew described.

2)  Your class must not be the return value of any XPIDL interface,
since those go through xpconnect and xpconnect can only deal with
nsISupports stuff.  The good news is that you can't violate this rule
and still compile unless your patch involves reinterpret_cast to
nsIWhatever, which will hopefully get you a swift r-.  ;)

We'll also have to land the patches from https://bugzilla.mozilla.org/show_bug.cgi?id=799465 (I actually have a patch in that bug that removes nsISupports from an existing class).

Peter

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

Reply via email to