mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 968335 - Use an AutoCxPusher directly in Auto{Entry,Incumbent}Global. r=bz
This will let us ask whether the AutoCxPusher is stack-top.
This commit is contained in:
parent
4b4c66f595
commit
e8d850c291
@ -177,7 +177,7 @@ AutoEntryScript::AutoEntryScript(nsIGlobalObject* aGlobalObject,
|
||||
}
|
||||
}
|
||||
if (aIsMainThread) {
|
||||
mCxPusher.Push(aCx);
|
||||
mCxPusher.construct(aCx);
|
||||
}
|
||||
mAc.construct(aCx, aGlobalObject->GetGlobalJSObject());
|
||||
mStack.Push(&mEntry);
|
||||
@ -207,7 +207,8 @@ AutoSystemCaller::AutoSystemCaller(bool aIsMainThread)
|
||||
: mStack(ScriptSettingsStack::Ref())
|
||||
{
|
||||
if (aIsMainThread) {
|
||||
mCxPusher.PushNull();
|
||||
mCxPusher.construct(static_cast<JSContext*>(nullptr),
|
||||
/* aAllowNull = */ true);
|
||||
}
|
||||
mStack.PushSystem();
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ public:
|
||||
private:
|
||||
dom::ScriptSettingsStack& mStack;
|
||||
dom::ScriptSettingsStackEntry mEntry;
|
||||
nsCxPusher mCxPusher;
|
||||
mozilla::Maybe<AutoCxPusher> mCxPusher;
|
||||
mozilla::Maybe<JSAutoCompartment> mAc; // This can de-Maybe-fy when mCxPusher
|
||||
// goes away.
|
||||
};
|
||||
@ -111,7 +111,7 @@ public:
|
||||
~AutoSystemCaller();
|
||||
private:
|
||||
dom::ScriptSettingsStack& mStack;
|
||||
nsCxPusher mCxPusher;
|
||||
mozilla::Maybe<AutoCxPusher> mCxPusher;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
Loading…
Reference in New Issue
Block a user