Fixing bug 301476. Make XPCNativeWrapper's checkAccess hook always forward to the wrapper's checkAccess hook, if it's got one. r=shaver@mozilla.org, sr=brendan@mozilla.org

This commit is contained in:
jst%mozilla.jstenback.com 2005-08-16 20:08:39 +00:00
parent 1c23a3fc0f
commit 1499e16a02

View File

@ -859,10 +859,17 @@ XPC_NW_CheckAccess(JSContext *cx, JSObject *obj, jsval id,
return JS_FALSE;
}
// Do our own thing...
XPC_NW_BYPASS_TEST(cx, obj, checkAccess, (cx, obj, id, mode, vp));
XPCWrappedNative *wrappedNative =
XPCNativeWrapper::GetWrappedNative(cx, obj);
if (!wrappedNative) {
return JS_TRUE;
}
return JS_TRUE;
JSObject *wrapperJSObject = wrappedNative->GetFlatJSObject();
JSClass *clazz = JS_GET_CLASS(cx, wrapperJSObject);
return !clazz->checkAccess ||
clazz->checkAccess(cx, wrapperJSObject, id, mode, vp);
}
JS_STATIC_DLL_CALLBACK(JSBool)