diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 9798f69f43c..2b78d23ea92 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -1683,7 +1683,7 @@ private: }; static void -DoStopPlugin(nsPluginInstanceOwner *aInstanceOwner, PRBool aIsDelayedAlready) +DoStopPlugin(nsPluginInstanceOwner *aInstanceOwner, PRBool aDelayedStop) { nsCOMPtr inst; aInstanceOwner->GetInstance(*getter_AddRefs(inst)); @@ -1720,7 +1720,7 @@ DoStopPlugin(nsPluginInstanceOwner *aInstanceOwner, PRBool aIsDelayedAlready) else inst->SetWindow(nsnull); - if (!aIsDelayedAlready) { + if (aDelayedStop) { nsCOMPtr evt = new nsStopPluginRunnable(aInstanceOwner); NS_DispatchToCurrentThread(evt); @@ -1737,7 +1737,7 @@ DoStopPlugin(nsPluginInstanceOwner *aInstanceOwner, PRBool aIsDelayedAlready) else inst->SetWindow(nsnull); - if (!aIsDelayedAlready) { + if (aDelayedStop) { nsCOMPtr evt = new nsStopPluginRunnable(aInstanceOwner); NS_DispatchToCurrentThread(evt); @@ -1763,7 +1763,7 @@ DoStopPlugin(nsPluginInstanceOwner *aInstanceOwner, PRBool aIsDelayedAlready) NS_IMETHODIMP nsStopPluginRunnable::Run() { - DoStopPlugin(mInstanceOwner, PR_TRUE); + DoStopPlugin(mInstanceOwner, PR_FALSE); return NS_OK; } @@ -1813,21 +1813,7 @@ nsObjectFrame::StopPluginInternal(PRBool aDelayedStop) // touch it! owner->PrepareToStop(aDelayedStop); -#ifdef XP_WIN - // We only deal with delayed stopping of plugins on Win32 for now, - // as that's the only platform where we need to (AFAIK) and it's - // unclear how safe widget parenting is on other platforms. - if (aDelayedStop) { - // nsStopPluginRunnable will hold a strong reference to owner - // (mInstanceOwner), and thus keep it alive as long as it needs - // it. - nsCOMPtr evt = new nsStopPluginRunnable(owner); - NS_DispatchToCurrentThread(evt); - } else -#endif - { - DoStopPlugin(owner, PR_FALSE); - } + DoStopPlugin(owner, aDelayedStop); // Break relationship between frame and plugin instance owner owner->SetOwner(nsnull);