Bug 1019191 part 13. Remove the now-unused castNativeArgFromWrapper and castNativeFromWrapper functions. r=peterv

This commit is contained in:
Boris Zbarsky 2014-10-22 11:40:49 -04:00
parent 5de2f9ca3e
commit 3e71ea9acc
2 changed files with 0 additions and 81 deletions

View File

@ -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<nsISupports>(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,

View File

@ -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___ */