diff --git a/js/xpconnect/src/XPCQuickStubs.cpp b/js/xpconnect/src/XPCQuickStubs.cpp index 4efe1addac0..4d2254ab745 100644 --- a/js/xpconnect/src/XPCQuickStubs.cpp +++ b/js/xpconnect/src/XPCQuickStubs.cpp @@ -149,60 +149,6 @@ castNative(JSContext *cx, return NS_ERROR_XPC_BAD_OP_ON_WN_PROTO; } -nsISupports* -castNativeFromWrapper(JSContext *cx, - JSObject *obj, - uint32_t interfaceBit, - uint32_t protoID, - int32_t protoDepth, - nsISupports **pRef, - MutableHandleValue pVal, - nsresult *rv) -{ - XPCWrappedNative *wrapper; - XPCWrappedNativeTearOff *tearoff; - JSObject *cur; - - if (IS_WN_REFLECTOR(obj)) { - cur = obj; - wrapper = XPCWrappedNative::Get(obj); - tearoff = nullptr; - } else { - *rv = getWrapper(cx, obj, &wrapper, &cur, &tearoff); - if (NS_FAILED(*rv)) - return nullptr; - } - - nsISupports *native; - if (wrapper) { - native = wrapper->GetIdentityObject(); - cur = wrapper->GetFlatJSObject(); - if (!native || !HasBitInInterfacesBitmap(cur, interfaceBit)) { - native = nullptr; - } - } else if (cur && protoDepth >= 0) { - const mozilla::dom::DOMJSClass* domClass = - mozilla::dom::GetDOMClass(cur); - native = mozilla::dom::UnwrapDOMObject(cur); - if (native && - (uint32_t)domClass->mInterfaceChain[protoDepth] != protoID) { - native = nullptr; - } - } else { - native = nullptr; - } - - if (native) { - *pRef = nullptr; - pVal.setObjectOrNull(cur); - *rv = NS_OK; - } else { - *rv = NS_ERROR_XPC_BAD_CONVERT_JS; - } - - return native; -} - nsresult xpc_qsUnwrapArgImpl(JSContext *cx, HandleValue v, diff --git a/js/xpconnect/src/XPCQuickStubs.h b/js/xpconnect/src/XPCQuickStubs.h index 0aad7f8a0b4..3ea26e97472 100644 --- a/js/xpconnect/src/XPCQuickStubs.h +++ b/js/xpconnect/src/XPCQuickStubs.h @@ -28,16 +28,6 @@ castNative(JSContext *cx, nsISupports **ppThisRef, JS::MutableHandleValue vp); -nsISupports* -castNativeFromWrapper(JSContext *cx, - JSObject *obj, - uint32_t interfaceBit, - uint32_t protoID, - int32_t protoDepth, - nsISupports **pRef, - JS::MutableHandleValue pVal, - nsresult *rv); - MOZ_ALWAYS_INLINE JSObject* xpc_qsUnwrapObj(jsval v, nsISupports **ppArgRef, nsresult *rv) { @@ -60,21 +50,4 @@ nsresult xpc_qsUnwrapArgImpl(JSContext *cx, JS::HandleValue v, const nsIID &iid, void **ppArg, nsISupports **ppArgRef, JS::MutableHandleValue vp); -MOZ_ALWAYS_INLINE nsISupports* -castNativeArgFromWrapper(JSContext *cx, - jsval v, - uint32_t bit, - uint32_t protoID, - int32_t protoDepth, - nsISupports **pArgRef, - JS::MutableHandleValue vp, - nsresult *rv) -{ - JSObject *src = xpc_qsUnwrapObj(v, pArgRef, rv); - if (!src) - return nullptr; - - return castNativeFromWrapper(cx, src, bit, protoID, protoDepth, pArgRef, vp, rv); -} - #endif /* xpcquickstubs_h___ */