Bug 754202 - Remove NoWaiverWrapper. r=mrbkap

No more principal pushing!
This commit is contained in:
Bobby Holley 2012-06-28 23:47:55 +02:00
Родитель 801fee983d
Коммит 76ff413563
3 изменённых файлов: 3 добавлений и 41 удалений

Просмотреть файл

@ -15,15 +15,7 @@
namespace xpc {
NoWaiverWrapper::NoWaiverWrapper(unsigned flags) : js::CrossCompartmentWrapper(flags)
{
}
NoWaiverWrapper::~NoWaiverWrapper()
{
}
CrossOriginWrapper::CrossOriginWrapper(unsigned flags) : NoWaiverWrapper(flags)
CrossOriginWrapper::CrossOriginWrapper(unsigned flags) : js::CrossCompartmentWrapper(flags)
{
}
@ -70,16 +62,4 @@ CrossOriginWrapper::construct(JSContext *cx, JSObject *wrapper,
WrapperFactory::WaiveXrayAndWrap(cx, rval);
}
bool
NoWaiverWrapper::enter(JSContext *cx, JSObject *wrapper, jsid id, Action act, bool *bp)
{
*bp = true; // always allowed
return true;
}
void
NoWaiverWrapper::leave(JSContext *cx, JSObject *wrapper)
{
}
}

Просмотреть файл

@ -15,18 +15,7 @@
namespace xpc {
class NoWaiverWrapper : public js::CrossCompartmentWrapper {
public:
NoWaiverWrapper(unsigned flags);
virtual ~NoWaiverWrapper();
virtual bool enter(JSContext *cx, JSObject *wrapper, jsid id, Action act, bool *bp) MOZ_OVERRIDE;
virtual void leave(JSContext *cx, JSObject *wrapper) MOZ_OVERRIDE;
static NoWaiverWrapper singleton;
};
class CrossOriginWrapper : public NoWaiverWrapper {
class CrossOriginWrapper : public js::CrossCompartmentWrapper {
public:
CrossOriginWrapper(unsigned flags);
virtual ~CrossOriginWrapper();

Просмотреть файл

@ -31,13 +31,6 @@ namespace xpc {
// we know to not apply an X-ray wrapper.
DirectWrapper WaiveXrayWrapperWrapper(WrapperFactory::WAIVE_XRAY_WRAPPER_FLAG);
// Objects that haven't been explicitly waived, but have been exposed
// to chrome don't want a CrossOriginWrapper, since that deeply-waives
// but need the transparent behavior of a CrossOriginWrapper. The
// NoWaiverWrapper is like a CrossOriginWrapper that can also hand out
// XrayWrappers as return values.
NoWaiverWrapper NoWaiverWrapper::singleton(0);
// When objects for which we waived the X-ray wrapper cross into
// chrome, we wrap them into a special cross-compartment wrapper
// that transitively extends the waiver to all properties we get
@ -341,7 +334,7 @@ WrapperFactory::Rewrap(JSContext *cx, JSObject *obj, JSObject *wrappedProto, JSO
usingXray = true;
wrapper = &Xray::singleton;
} else {
wrapper = &NoWaiverWrapper::singleton;
wrapper = &CrossCompartmentWrapper::singleton;
}
}
}