зеркало из https://github.com/mozilla/gecko-dev.git
Bug 862380 - Pass the entered id in addition to the wrapper action to Policy::deny. r=mrbkap
This commit is contained in:
Родитель
5db61d9da6
Коммит
a76f725f9c
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче