gecko-dev/xpcom
Boris Zbarsky 7e5a37a024 Bug 1521907 part 3. Start using CheckedUnwrapStatic/Dynamic in bindings. r=peterv
The basic idea for the changes around UnwrapObjectInternal and its callers
(UnwrapObject, UNWRAP_OBJECT, etc) is to add a parameter to the guts of the
object-unwrapping code in bindings which can be either a JSContext* or nullptr
(statically typed).  Then we test which type it is and do either a
CheckedUnwrapDynamic or CheckedUnwrapStatic.  Since the type is known at
compile time, there is no actual runtime check; the compiler just emits a call
to the right thing directly (verified by examining the assembly output on
Linux).

The rest of the changes are mostly propagating through that template parameter,
adding static asserts to make sure people don't accidentally pass nullptr while
trying to unwrap to a type that might be a WindowProxy or Location, etc.

There are also some changes to places that were calling CheckedUnwrap directly
to use either the static or dynamic version, as needed.

Differential Revision: https://phabricator.services.mozilla.com/D17883

--HG--
extra : moz-landing-system : lando
2019-02-02 03:23:49 +00:00
..
base Bug 1523851 - Remove the dynamic_cast<void*> test. r=froydnj 2019-01-30 14:25:33 +00:00
build Merge mozilla-central to mozilla-inbound 2019-01-29 12:55:03 +02:00
components Backed out 16 changesets (bug 1478124) for failing android geckoview-junit CLOSED TREE 2019-01-29 10:03:06 +02:00
doc
ds Bug 1523948 - avoid bounds checks in nsTArray binary search methods; r=erahm 2019-01-30 17:26:27 -05:00
glue Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
idl-parser Bug 662341. Add support for [notxpcom] annotations on xpidl attributes. r=nika 2018-11-15 05:07:20 +00:00
io Backed out 16 changesets (bug 1478124) for failing android geckoview-junit CLOSED TREE 2019-01-29 10:03:06 +02:00
libxpt/xptcall
reflect Bug 1521907 part 3. Start using CheckedUnwrapStatic/Dynamic in bindings. r=peterv 2019-02-02 03:23:49 +00:00
rust Bug 1515351 - Update encoding_rs to 0.8.14. r=m_kato 2019-01-10 09:42:39 +00:00
string Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
system Bug 1517636: Add launcher process state to about:support; r=Felipe,flod 2019-01-16 00:22:19 +00:00
tests Bug 1518283 - prohibit blank lines at the beginning and end of blocks (eslint padded-blocks) r=mossop,Standard8 2019-01-30 17:26:25 +00:00
threads Bug 1329794 - Remove verbose thread shutdown warning. r=Nika 2019-01-31 14:56:04 -08:00
windbgdlg Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
xpidl Bug 1459721 - part 7 - remove dist_idl install manifest; r=chmanchester 2018-05-15 10:05:23 -04:00
moz.build Bug 1489340 - Remove xpcom/typelib r=froydnj 2018-09-07 13:55:38 +00:00
xpcom-config.h.in Bug 1523851 - Remove the dynamic_cast<void*> test. r=froydnj 2019-01-30 14:25:33 +00:00
xpcom-private.h.in