author | Andrew McCreight <continuation@gmail.com> |
Tue, 09 May 2017 15:34:02 -0700 | |
changeset 358500 | 2dc612bec44b88be0bf484a0e0b3901ada89481e |
parent 358499 | 424daa127a04c8295dee7ca320417ad8f79dfcbc |
child 358501 | 1b51aa9afd06b56998da103ae853db5cac04ad8f |
push id | 31827 |
push user | cbook@mozilla.com |
push date | Tue, 16 May 2017 10:34:19 +0000 |
treeherder | mozilla-central@49365d675cbb [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | mrbkap |
bugs | 1363555 |
milestone | 55.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/js/xpconnect/src/XPCCallContext.cpp +++ b/js/xpconnect/src/XPCCallContext.cpp @@ -10,17 +10,20 @@ #include "jswrapper.h" #include "jsfriendapi.h" #include "nsContentUtils.h" using namespace mozilla; using namespace xpc; using namespace JS; -#define IS_TEAROFF_CLASS(clazz) ((clazz) == &XPC_WN_Tearoff_JSClass) +static inline bool IsTearoffClass(const js::Class* clazz) +{ + return clazz == &XPC_WN_Tearoff_JSClass; +} XPCCallContext::XPCCallContext(JSContext* cx, HandleObject obj /* = nullptr */, HandleObject funobj /* = nullptr */, HandleId name /* = JSID_VOID */, unsigned argc /* = NO_ARGS */, Value* argv /* = nullptr */, Value* rval /* = nullptr */) @@ -59,17 +62,17 @@ XPCCallContext::XPCCallContext(JSContext if (!unwrapped) { JS_ReportErrorASCII(mJSContext, "Permission denied to call method on |this|"); mState = INIT_FAILED; return; } const js::Class* clasp = js::GetObjectClass(unwrapped); if (IS_WN_CLASS(clasp)) { mWrapper = XPCWrappedNative::Get(unwrapped); - } else if (IS_TEAROFF_CLASS(clasp)) { + } else if (IsTearoffClass(clasp)) { mTearOff = (XPCWrappedNativeTearOff*)js::GetObjectPrivate(unwrapped); mWrapper = XPCWrappedNative::Get( &js::GetReservedSlot(unwrapped, XPC_WN_TEAROFF_FLAT_OBJECT_SLOT).toObject()); } if (mWrapper && !mTearOff) { mScriptable = mWrapper->GetScriptable(); }