Bug 1324330 (part 2) - Make XPC_MAP_FLAGS non-optional when using xpc_map_end.h. r=mccr8.

I'd like to remove XPC_MAP_WANT_* altogether and use XPC_MAP_FLAGS for all the
nsIXPCScriptable flag setting, but I haven't worked out how to handle the
method definitions in xpc_map_end.h yet. In the meantime, it seems good to make
the flag setting more consistent and explicit.

In particular, the three "Module" classes have "#define XPC_MAP_WANT_CALL" and
"#define XPC_MAP_FLAGS nsIXPCScriptable::WANT_CALL" which both have the same
effect. The patch removes the latter, to make them consistent with other
classes.

--HG--
extra : rebase_source : 3119e895809bb14e63f61e4e440c84e16cc4c5f9
This commit is contained in:
Nicholas Nethercote 2016-12-23 08:30:22 +11:00
Родитель dd6856ca4d
Коммит 47b78b17ae
5 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -15,6 +15,10 @@
#error "Must #define XPC_MAP_QUOTED_CLASSNAME before #including xpc_map_end.h"
#endif
#ifndef XPC_MAP_FLAGS
#error "Must #define XPC_MAP_FLAGS before #including xpc_map_end.h"
#endif
#include "js/Id.h"
/**************************************************************/
@ -181,6 +185,4 @@ NS_IMETHODIMP XPC_MAP_CLASSNAME::PostCreatePrototype(JSContext* cx, JSObject* pr
#undef XPC_MAP_WANT_HASINSTANCE
#endif
#ifdef XPC_MAP_FLAGS
#undef XPC_MAP_FLAGS
#endif

Просмотреть файл

@ -3544,6 +3544,7 @@ NS_IMPL_CI_INTERFACE_GETTER(nsXPCComponents, nsIXPCComponents)
#define XPC_MAP_CLASSNAME ComponentsSH
#define XPC_MAP_QUOTED_CLASSNAME "nsXPCComponents"
#define XPC_MAP_WANT_PRECREATE
#define XPC_MAP_FLAGS 0
#include "xpc_map_end.h" /* This will #undef the above */
NS_IMETHODIMP

Просмотреть файл

@ -58,7 +58,7 @@ Module::~Module() = default;
#define XPC_MAP_CLASSNAME Module
#define XPC_MAP_QUOTED_CLASSNAME "Module"
#define XPC_MAP_WANT_CALL
#define XPC_MAP_FLAGS nsIXPCScriptable::WANT_CALL
#define XPC_MAP_FLAGS 0
#include "xpc_map_end.h"
static bool

Просмотреть файл

@ -33,7 +33,7 @@ Module::~Module() = default;
#define XPC_MAP_CLASSNAME Module
#define XPC_MAP_QUOTED_CLASSNAME "Module"
#define XPC_MAP_WANT_CALL
#define XPC_MAP_FLAGS nsIXPCScriptable::WANT_CALL
#define XPC_MAP_FLAGS 0
#include "xpc_map_end.h"
static bool

Просмотреть файл

@ -31,7 +31,7 @@ Module::~Module() = default;
#define XPC_MAP_CLASSNAME Module
#define XPC_MAP_QUOTED_CLASSNAME "Module"
#define XPC_MAP_WANT_CALL
#define XPC_MAP_FLAGS nsIXPCScriptable::WANT_CALL
#define XPC_MAP_FLAGS 0
#include "xpc_map_end.h"
NS_IMETHODIMP