mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 862380 - Pass the entered id in addition to the wrapper action to Policy::deny. r=mrbkap
This commit is contained in:
parent
34633b64df
commit
04fe393f0c
@ -39,7 +39,7 @@ struct Opaque : public Policy {
|
||||
static bool check(JSContext *cx, JSObject *wrapper, jsid id, js::Wrapper::Action act) {
|
||||
return act == js::Wrapper::CALL;
|
||||
}
|
||||
static bool deny(js::Wrapper::Action act) {
|
||||
static bool deny(js::Wrapper::Action act, JSHandleId id) {
|
||||
return false;
|
||||
}
|
||||
static bool allowNativeCall(JSContext *cx, JS::IsAcceptableThis test, JS::NativeImpl impl)
|
||||
@ -54,7 +54,7 @@ struct GentlyOpaque : public Policy {
|
||||
static bool check(JSContext *cx, JSObject *wrapper, jsid id, js::Wrapper::Action act) {
|
||||
return false;
|
||||
}
|
||||
static bool deny(js::Wrapper::Action act) {
|
||||
static bool deny(js::Wrapper::Action act, JSHandleId id) {
|
||||
return true;
|
||||
}
|
||||
static bool allowNativeCall(JSContext *cx, JS::IsAcceptableThis test, JS::NativeImpl impl)
|
||||
@ -74,7 +74,7 @@ struct CrossOriginAccessiblePropertiesOnly : public Policy {
|
||||
static bool check(JSContext *cx, JSObject *wrapper, jsid id, js::Wrapper::Action act) {
|
||||
return AccessCheck::isCrossOriginAccessPermitted(cx, wrapper, id, act);
|
||||
}
|
||||
static bool deny(js::Wrapper::Action act) {
|
||||
static bool deny(js::Wrapper::Action act, JSHandleId id) {
|
||||
return false;
|
||||
}
|
||||
static bool allowNativeCall(JSContext *cx, JS::IsAcceptableThis test, JS::NativeImpl impl)
|
||||
@ -88,7 +88,7 @@ struct CrossOriginAccessiblePropertiesOnly : public Policy {
|
||||
struct ExposedPropertiesOnly : public Policy {
|
||||
static bool check(JSContext *cx, JSObject *wrapper, jsid id, js::Wrapper::Action act);
|
||||
|
||||
static bool deny(js::Wrapper::Action act) {
|
||||
static bool deny(js::Wrapper::Action act, JSHandleId id) {
|
||||
// Fail silently for GETs.
|
||||
return act == js::Wrapper::GET;
|
||||
}
|
||||
@ -99,7 +99,7 @@ struct ExposedPropertiesOnly : public Policy {
|
||||
struct ComponentsObjectPolicy : public Policy {
|
||||
static bool check(JSContext *cx, JSObject *wrapper, jsid id, js::Wrapper::Action act);
|
||||
|
||||
static bool deny(js::Wrapper::Action act) {
|
||||
static bool deny(js::Wrapper::Action act, JSHandleId id) {
|
||||
return false;
|
||||
}
|
||||
static bool allowNativeCall(JSContext *cx, JS::IsAcceptableThis test, JS::NativeImpl impl) {
|
||||
|
@ -183,7 +183,7 @@ FilteringWrapper<Base, Policy>::enter(JSContext *cx, HandleObject wrapper,
|
||||
return true;
|
||||
}
|
||||
if (!Policy::check(cx, wrapper, id, act)) {
|
||||
*bp = JS_IsExceptionPending(cx) ? false : Policy::deny(act);
|
||||
*bp = JS_IsExceptionPending(cx) ? false : Policy::deny(act, id);
|
||||
return false;
|
||||
}
|
||||
*bp = true;
|
||||
|
Loading…
Reference in New Issue
Block a user