mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 12:20:56 +00:00

Due to how this type of threadsafe refcounting is implemented, it needs to be implemented using a MFBT-style refcounting base class, somewhat similar to `SupportsWeakPtr`. This patch makes NS_IMPL_{ADDREF,RELEASE}_INHERITED intelligently not add refcount logging for types inheriting from SupportsThreadSafeWeakPtr, as the default behaviour would break due to weak pointer upgrades not calling through `AddRef` or `Release`. In MFBT, the return value of `AddRef` and `Release` on SupportsThreadSafeWeakPtr is changed to be compatible with nsISupports, so that this type can be used to implement nsISupports refcounting. Differential Revision: https://phabricator.services.mozilla.com/D142603