зеркало из https://github.com/mozilla/pjs.git
Bug 754202 - Remove NoWaiverWrapper. r=mrbkap
No more principal pushing!
This commit is contained in:
Родитель
801fee983d
Коммит
76ff413563
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче