Bug 749173 - Remove AutoPreserveCompartment. r=luke

This commit is contained in:
Bobby Holley 2012-05-06 13:09:49 +02:00
parent 3187513a54
commit d5c12cf9a1
3 changed files with 0 additions and 26 deletions

View File

@ -243,19 +243,6 @@ JS_DefineFunctionsWithHelp(JSContext *cx, JSObject *obj, const JSFunctionSpecWit
return true;
}
AutoPreserveCompartment::AutoPreserveCompartment(JSContext *cx
JS_GUARD_OBJECT_NOTIFIER_PARAM_NO_INIT)
: cx(cx), oldCompartment(cx->compartment)
{
JS_GUARD_OBJECT_NOTIFIER_INIT;
}
AutoPreserveCompartment::~AutoPreserveCompartment()
{
/* The old compartment may have been destroyed, so we can't use cx->setCompartment. */
cx->compartment = oldCompartment;
}
AutoSwitchCompartment::AutoSwitchCompartment(JSContext *cx, JSCompartment *newCompartment
JS_GUARD_OBJECT_NOTIFIER_PARAM_NO_INIT)
: cx(cx), oldCompartment(cx->compartment)

View File

@ -227,16 +227,6 @@ DumpHeapComplete(JSRuntime *rt, FILE *fp);
#endif
class JS_FRIEND_API(AutoPreserveCompartment) {
private:
JSContext *cx;
JSCompartment *oldCompartment;
public:
AutoPreserveCompartment(JSContext *cx JS_GUARD_OBJECT_NOTIFIER_PARAM);
~AutoPreserveCompartment();
JS_DECL_USE_GUARD_OBJECT_NOTIFIER
};
class JS_FRIEND_API(AutoSwitchCompartment) {
private:
JSContext *cx;

View File

@ -657,9 +657,6 @@ mozJSComponentLoader::GlobalForLocation(nsILocalFile *aComponentFile,
JS_AbortIfWrongThread(JS_GetRuntime(cx));
// preserve caller's compartment
js::AutoPreserveCompartment pc(cx);
nsCOMPtr<nsIXPCScriptable> backstagePass;
rv = mRuntimeService->GetBackstagePass(getter_AddRefs(backstagePass));
NS_ENSURE_SUCCESS(rv, rv);