mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 834732 - Move cx pushing into nsPluginProtoChainInstallRunner. r=mrbkap
This gets rid of the last use of REQUIRE_SCRIPT_CONTEXT. \o/
This commit is contained in:
parent
f71f3899d1
commit
39acf0afd1
@ -2576,6 +2576,8 @@ nsObjectLoadingContent::NotifyContentObjectWrapper()
|
||||
return;
|
||||
|
||||
JSContext *cx = scx->GetNativeContext();
|
||||
nsCxPusher pusher;
|
||||
pusher.Push(cx, nsCxPusher::ASSERT_SCRIPT_CONTEXT);
|
||||
|
||||
nsCOMPtr<nsIXPConnectWrappedNative> wrapper;
|
||||
nsContentUtils::XPConnect()->
|
||||
|
@ -8510,17 +8510,10 @@ public:
|
||||
|
||||
NS_IMETHOD Run()
|
||||
{
|
||||
JSContext* cx = nullptr;
|
||||
if (mContext) {
|
||||
cx = mContext->GetNativeContext();
|
||||
} else {
|
||||
nsCOMPtr<nsIThreadJSContextStack> stack =
|
||||
do_GetService("@mozilla.org/js/xpc/ContextStack;1");
|
||||
NS_ENSURE_TRUE(stack, NS_OK);
|
||||
|
||||
cx = stack->GetSafeJSContext();
|
||||
NS_ENSURE_TRUE(cx, NS_OK);
|
||||
}
|
||||
nsCxPusher pusher;
|
||||
JSContext* cx = mContext ? mContext->GetNativeContext()
|
||||
: nsContentUtils::GetSafeJSContext();
|
||||
pusher.Push(cx, nsCxPusher::ALWAYS_PUSH);
|
||||
|
||||
JSObject* obj = nullptr;
|
||||
mWrapper->GetJSObject(&obj);
|
||||
@ -8544,11 +8537,7 @@ nsHTMLPluginObjElementSH::SetupProtoChain(nsIXPConnectWrappedNative *wrapper,
|
||||
{
|
||||
NS_ASSERTION(nsContentUtils::IsSafeToRunScript(),
|
||||
"Shouldn't have gotten in here");
|
||||
|
||||
nsCxPusher cxPusher;
|
||||
if (!cxPusher.Push(cx, nsCxPusher::REQUIRE_SCRIPT_CONTEXT)) {
|
||||
return NS_OK;
|
||||
}
|
||||
MOZ_ASSERT(cx == nsContentUtils::GetCurrentJSContext());
|
||||
|
||||
JSAutoRequest ar(cx);
|
||||
JSAutoCompartment ac(cx, obj);
|
||||
|
Loading…
Reference in New Issue
Block a user