mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 749173 - Remove AutoPreserveCompartment. r=luke
This commit is contained in:
parent
3187513a54
commit
d5c12cf9a1
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user