mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 21:28:55 +00:00
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:
parent
1c23a3fc0f
commit
1499e16a02
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user