gecko-dev/xpcom/docs
Andrew McCreight ba8af7f4fa Bug 1792920, part 4 - Add special handling for MozExternalRefCountType to XPIDL. r=nika
In XPIDL, the return type of AddRef and Release are nsrefcnt, which
is defined as unsigned long. The first problem is that nsrefcnt is
defined in XPIDL as unsigned long, but in C++ as uintptr_t. The second
problem is that the actual return type of these methods in C++ is
MozExternalRefCountType.

This patch fixes the return type of these methods in XPIDL. However,
due to MSCOM compatibility requirements this type is not expressible
in XPIDL, so I added it as a new builtin type to XPIDL. In C++, it
defers to the typedef and for Rust it uses u32 directly. I tried
using the new Rust typedef I defined in refptr.rs, but it seemed like
it was being used in places that didn't have refptr.rs available.

I also deleted the incorrect definition of nsrefcnt in XPIDL. It is
not used anywhere else in XPIDL files, and my previous patches removed
all uses of this type definition from Rust.

Note that this patch does not really change nsISupports.h,
because this part of the file is ignored via an #if 0. However, this
patch does clear the way for further work to start using the auto
generated nsISupports.h instead of nsISupportsBase.h.

Differential Revision: https://phabricator.services.mozilla.com/D159323
2022-10-17 16:09:21 +00:00
..
collections.rst
hashtables_detailed.rst Bug 1758753 - Migrate XPCOM hashtable documentation from MDN to Firefox Source Docs. r=nika 2022-03-17 14:23:27 +00:00
hashtables.rst Bug 1758753 - Migrate XPCOM hashtable documentation from MDN to Firefox Source Docs. r=nika 2022-03-17 14:23:27 +00:00
huntingleaks.rst
index.rst Bug 1776103 - Clean up DMD docs. r=xpcom-reviewers,nika DONTBUILD 2022-06-29 21:41:04 +00:00
logging.rst
refptr.rst Bug 1788137 - doc(xpcom): Improve the wording r=nrishel DONTBUILD 2022-09-14 06:16:23 +00:00
stringguide.rst
thread-safety.rst Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato 2022-08-03 16:39:41 +00:00
writing-xpcom-interface.rst Bug 1788671 - Document how to add Services to eslint. r=Standard8 DONTBUILD 2022-10-07 18:11:17 +00:00
xpidl.rst Bug 1792920, part 4 - Add special handling for MozExternalRefCountType to XPIDL. r=nika 2022-10-17 16:09:21 +00:00