Bug 887334 - Remove AutoSwitchCompartment. r=luke

This thing is...yikes.
This commit is contained in:
Bobby Holley 2013-07-17 11:53:50 -07:00
parent 8b65d18c25
commit ea06c3d7e0
2 changed files with 0 additions and 35 deletions

View File

@ -314,28 +314,6 @@ js_ObjectClassName(JSContext *cx, HandleObject obj)
return JSObject::className(cx, obj);
}
AutoSwitchCompartment::AutoSwitchCompartment(JSContext *cx, JSCompartment *newCompartment
MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
: cx(cx), oldCompartment(cx->compartment())
{
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
cx->setCompartment(newCompartment);
}
AutoSwitchCompartment::AutoSwitchCompartment(JSContext *cx, HandleObject target
MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
: cx(cx), oldCompartment(cx->compartment())
{
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
cx->setCompartment(target->compartment());
}
AutoSwitchCompartment::~AutoSwitchCompartment()
{
/* The old compartment may have been destroyed, so we can't use cx->setCompartment. */
cx->setCompartment(oldCompartment);
}
JS_FRIEND_API(JS::Zone *)
js::GetCompartmentZone(JSCompartment *comp)
{

View File

@ -237,19 +237,6 @@ typedef bool
extern JS_FRIEND_API(void)
DumpHeapComplete(JSRuntime *rt, FILE *fp);
class JS_FRIEND_API(AutoSwitchCompartment) {
private:
JSContext *cx;
JSCompartment *oldCompartment;
public:
AutoSwitchCompartment(JSContext *cx, JSCompartment *newCompartment
MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
AutoSwitchCompartment(JSContext *cx, JS::HandleObject target
MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
~AutoSwitchCompartment();
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};
#ifdef OLD_GETTER_SETTER_METHODS
JS_FRIEND_API(JSBool) obj_defineGetter(JSContext *cx, unsigned argc, js::Value *vp);
JS_FRIEND_API(JSBool) obj_defineSetter(JSContext *cx, unsigned argc, js::Value *vp);