mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 888104 - Move nsCxPusher's mScx grabbing code into the common helper method. r=gabor
This function is called by Push and PushNull, so with the added null check this is equivalent. This facilitates the refactoring in the next patch.
This commit is contained in:
parent
37bbfefcec
commit
8536bd9ae6
@ -106,17 +106,18 @@ nsCxPusher::Push(JSContext *cx)
|
|||||||
MOZ_ASSERT(!mPushedSomething, "No double pushing with nsCxPusher::Push()!");
|
MOZ_ASSERT(!mPushedSomething, "No double pushing with nsCxPusher::Push()!");
|
||||||
MOZ_ASSERT(cx);
|
MOZ_ASSERT(cx);
|
||||||
|
|
||||||
// Hold a strong ref to the nsIScriptContext, just in case
|
|
||||||
// XXXbz do we really need to? If we don't get one of these in Pop(), is
|
|
||||||
// that really a problem? Or do we need to do this to effectively root |cx|?
|
|
||||||
mScx = GetScriptContextFromJSContext(cx);
|
|
||||||
|
|
||||||
DoPush(cx);
|
DoPush(cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsCxPusher::DoPush(JSContext* cx)
|
nsCxPusher::DoPush(JSContext* cx)
|
||||||
{
|
{
|
||||||
|
// If we have a cx, hold a strong ref to the nsIScriptContext, just in case.
|
||||||
|
// XXXbz do we really need to? If we don't get one of these in Pop(), is
|
||||||
|
// that really a problem? Or do we need to do this to effectively root |cx|?
|
||||||
|
if (cx)
|
||||||
|
mScx = GetScriptContextFromJSContext(cx);
|
||||||
|
|
||||||
// NB: The GetDynamicScriptContext is historical and might not be sane.
|
// NB: The GetDynamicScriptContext is historical and might not be sane.
|
||||||
if (cx && nsJSUtils::GetDynamicScriptContext(cx) &&
|
if (cx && nsJSUtils::GetDynamicScriptContext(cx) &&
|
||||||
xpc::IsJSContextOnStack(cx))
|
xpc::IsJSContextOnStack(cx))
|
||||||
|
Loading…
Reference in New Issue
Block a user