зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1019191 part 13. Remove the now-unused castNativeArgFromWrapper and castNativeFromWrapper functions. r=peterv
This commit is contained in:
Родитель
66f049ef9f
Коммит
db949c14df
|
@ -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,
|
||||
|
|
|
@ -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___ */
|
||||
|
|
Загрузка…
Ссылка в новой задаче