mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 865222 - Add MOZ_GUARD_OBJECT_NOTIFIER_PARAM to JSAutoCompartment and JSAutoNullableCompartment; r=efaust
This commit is contained in:
parent
9e840f0fdb
commit
f5855dda46
@ -908,19 +908,23 @@ JS_LeaveCompartment(JSContext* cx, JSCompartment* oldCompartment)
|
||||
cx->leaveCompartment(oldCompartment);
|
||||
}
|
||||
|
||||
JSAutoCompartment::JSAutoCompartment(JSContext* cx, JSObject* target)
|
||||
JSAutoCompartment::JSAutoCompartment(JSContext* cx, JSObject* target
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
|
||||
: cx_(cx),
|
||||
oldCompartment_(cx->compartment())
|
||||
{
|
||||
AssertHeapIsIdleOrIterating(cx_);
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
cx_->enterCompartment(target->compartment());
|
||||
}
|
||||
|
||||
JSAutoCompartment::JSAutoCompartment(JSContext* cx, JSScript* target)
|
||||
JSAutoCompartment::JSAutoCompartment(JSContext* cx, JSScript* target
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
|
||||
: cx_(cx),
|
||||
oldCompartment_(cx->compartment())
|
||||
{
|
||||
AssertHeapIsIdleOrIterating(cx_);
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
cx_->enterCompartment(target->compartment());
|
||||
}
|
||||
|
||||
@ -930,11 +934,13 @@ JSAutoCompartment::~JSAutoCompartment()
|
||||
}
|
||||
|
||||
JSAutoNullableCompartment::JSAutoNullableCompartment(JSContext* cx,
|
||||
JSObject* targetOrNull)
|
||||
JSObject* targetOrNull
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
|
||||
: cx_(cx),
|
||||
oldCompartment_(cx->compartment())
|
||||
{
|
||||
AssertHeapIsIdleOrIterating(cx_);
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
if (targetOrNull) {
|
||||
cx_->enterCompartment(targetOrNull->compartment());
|
||||
} else {
|
||||
|
@ -1448,9 +1448,13 @@ class JS_PUBLIC_API(JSAutoCompartment)
|
||||
JSContext* cx_;
|
||||
JSCompartment* oldCompartment_;
|
||||
public:
|
||||
JSAutoCompartment(JSContext* cx, JSObject* target);
|
||||
JSAutoCompartment(JSContext* cx, JSScript* target);
|
||||
JSAutoCompartment(JSContext* cx, JSObject* target
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
|
||||
JSAutoCompartment(JSContext* cx, JSScript* target
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
|
||||
~JSAutoCompartment();
|
||||
|
||||
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
};
|
||||
|
||||
class JS_PUBLIC_API(JSAutoNullableCompartment)
|
||||
@ -1458,8 +1462,11 @@ class JS_PUBLIC_API(JSAutoNullableCompartment)
|
||||
JSContext* cx_;
|
||||
JSCompartment* oldCompartment_;
|
||||
public:
|
||||
explicit JSAutoNullableCompartment(JSContext* cx, JSObject* targetOrNull);
|
||||
explicit JSAutoNullableCompartment(JSContext* cx, JSObject* targetOrNull
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
|
||||
~JSAutoNullableCompartment();
|
||||
|
||||
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
};
|
||||
|
||||
/* NB: This API is infallible; a nullptr return value does not indicate error. */
|
||||
|
Loading…
Reference in New Issue
Block a user