mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 887334 - Remove AutoSwitchCompartment. r=luke
This thing is...yikes.
This commit is contained in:
parent
8b65d18c25
commit
ea06c3d7e0
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user