gecko-dev/xpcom
Kris Maglione 476dc527b7 Bug 1478124: Part 6 - Add helpers for creating/inspecting static modules. r=froydnj
The static XPCOM manifest format makes it easy to define a component in a
single place, without separate contract ID and CID macro definitions in
headers, and variable constants in module files. Without any other changes,
however, those macros are still required in order to create instances of or
retrieve services for the component.

This patch solves that problem by allowing component definitions to include an
explicit component name, and adding helpers for each named component to
Components.h:

  mozilla::components::<Name>::CID() to retrieve its class ID.

  mozilla::components::<Name>::Create() to create a new instance.

  mozilla::components::<Name>::Service() to retrieve its service instance.

These getters have the benefit of doing full compile-time sanity checking,
with no possibilty of using a mistyped contract ID string, or a macro constant
which has gotten out of sync with the component entry.

Moreover, when possible, these getters are optimized to operate on module
entries directly, without going through expensive hash lookups or virtual
calls.

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

--HG--
extra : rebase_source : ab07ef6a7ad8b26cd4e1901d3365beeb8c22ec3b
extra : source : 929fd654c9dfc3222e1972faadea3cc066e51654
2018-12-15 14:17:27 -08:00
..
base Backed out 16 changesets (bug 1478124) for failing android geckoview-junit CLOSED TREE 2019-01-29 10:03:06 +02:00
build Merge mozilla-central to mozilla-inbound 2019-01-29 12:55:03 +02:00
components Bug 1478124: Part 6 - Add helpers for creating/inspecting static modules. r=froydnj 2018-12-15 14:17:27 -08:00
doc
ds Backed out 16 changesets (bug 1478124) for failing android geckoview-junit CLOSED TREE 2019-01-29 10:03:06 +02: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 1513725 - fix xptcall stubs for aarch64 for bool params, r=froydnj 2019-01-22 16:36:34 +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 1520150 - Single InputStreams can serialize themselves as IPCRemoteStreams (pipe) - part 1 - Passing IPC managers around, r=smaug 2019-01-28 10:48:35 +01:00
threads Backed out 16 changesets (bug 1478124) for failing android geckoview-junit CLOSED TREE 2019-01-29 10:03:06 +02: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
xpcom-private.h.in