☠☠ backed out by 5de5d3950328 ☠ ☠ | |
author | Peter Van der Beken <peterv@propagandism.org> |
Tue, 27 Nov 2012 10:20:05 +0100 (2012-11-27) | |
changeset 114274 | e73366b088d7ed68e1f395df42519d73dc5003db |
parent 114273 | 49fc6d535c417224d59eb2f2a3302f4e164ac668 |
child 114275 | bf8746658a7203bda1fb0019f6631d4df9c6cb37 |
push id | 18660 |
push user | pvanderbeken@mozilla.com |
push date | Tue, 27 Nov 2012 20:40:27 +0000 (2012-11-27) |
treeherder | mozilla-inbound@0c2011091748 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | bz |
bugs | 814821, 812333 |
milestone | 20.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/XPCQuickStubs.h +++ b/js/xpconnect/src/XPCQuickStubs.h @@ -430,59 +430,53 @@ castNativeFromWrapper(JSContext *cx, nullptr; tearoff = nullptr; } else { *rv = getWrapper(cx, obj, &wrapper, &cur, &tearoff); if (NS_FAILED(*rv)) return nullptr; } - *rv = NS_ERROR_XPC_BAD_CONVERT_JS; - nsISupports *native; if (wrapper) { native = wrapper->GetIdentityObject(); cur = wrapper->GetFlatJSObject(); if (!native || !HasBitInInterfacesBitmap(cur, interfaceBit)) { - return nullptr; + native = nullptr; + } else if (lccx) { + lccx->SetWrapper(wrapper, tearoff); } - } else if (cur) { - if (IS_SLIM_WRAPPER(cur)) { - native = static_cast<nsISupports*>(xpc_GetJSPrivate(cur)); - if (!native || !HasBitInInterfacesBitmap(cur, interfaceBit)) { - return nullptr; - } - } else if (protoDepth >= 0) { - const mozilla::dom::DOMClass* domClass; - mozilla::dom::DOMObjectSlot slot = - mozilla::dom::GetDOMClass(cur, domClass); - native = mozilla::dom::UnwrapDOMObject<nsISupports>(cur, slot); - if (!native || - (uint32_t)domClass->mInterfaceChain[protoDepth] != protoID) { - return nullptr; - } - } else { - return nullptr; + } else if (cur && IS_SLIM_WRAPPER(cur)) { + native = static_cast<nsISupports*>(xpc_GetJSPrivate(cur)); + if (!native || !HasBitInInterfacesBitmap(cur, interfaceBit)) { + native = nullptr; + } else if (lccx) { + lccx->SetWrapper(cur); + } + } else if (cur && protoDepth >= 0) { + const mozilla::dom::DOMClass* domClass; + mozilla::dom::DOMObjectSlot slot = + mozilla::dom::GetDOMClass(cur, domClass); + native = mozilla::dom::UnwrapDOMObject<nsISupports>(cur, slot); + if (native && + (uint32_t)domClass->mInterfaceChain[protoDepth] != protoID) { + native = nullptr; } } else { - return nullptr; + native = nullptr; } - *pRef = nullptr; - *pVal = OBJECT_TO_JSVAL(cur); - - if (lccx) { - if (wrapper) - lccx->SetWrapper(wrapper, tearoff); - else if (IS_SLIM_WRAPPER(cur)) - lccx->SetWrapper(cur); + if (native) { + *pRef = nullptr; + *pVal = OBJECT_TO_JSVAL(cur); + *rv = NS_OK; + } else { + *rv = NS_ERROR_XPC_BAD_CONVERT_JS; } - *rv = NS_OK; - return native; } JSBool xpc_qsUnwrapThisFromCcxImpl(XPCCallContext &ccx, const nsIID &iid, void **ppThis, nsISupports **pThisRef,