Bug 532751 - Notify the nsNPAPIPlugin and the related nsNPAPIPluginInstances when a plugin crashes so that reloading will create a new plugin process, r=josh
This commit is contained in:
@@ -69,6 +69,7 @@ PluginModuleParent::PluginModuleParent(const char* aFilePath)
|
||||
: mSubprocess(new PluginProcessParent(aFilePath))
|
||||
, mShutdown(false)
|
||||
, mNPNIface(NULL)
|
||||
, mPlugin(NULL)
|
||||
{
|
||||
NS_ASSERTION(mSubprocess, "Out of memory!");
|
||||
|
||||
@@ -97,9 +98,16 @@ PluginModuleParent::ActorDestroy(ActorDestroyReason why)
|
||||
{
|
||||
switch (why) {
|
||||
case AbnormalShutdown:
|
||||
// TODObsmedberg: notify the plugin host to forget this plugin module
|
||||
// and instantiate us again.
|
||||
// FALL THROUGH
|
||||
mShutdown = true;
|
||||
// Defer the PluginCrashed method so that we don't re-enter
|
||||
// and potentially modify the actor child list while enumerating it.
|
||||
if (mPlugin) {
|
||||
nsCOMPtr<nsIRunnable> r =
|
||||
new nsRunnableMethod<nsNPAPIPlugin>(
|
||||
mPlugin, &nsNPAPIPlugin::PluginCrashed);
|
||||
NS_DispatchToMainThread(r);
|
||||
}
|
||||
break;
|
||||
|
||||
case NormalShutdown:
|
||||
mShutdown = true;
|
||||
|
||||
Reference in New Issue
Block a user