Bug 1209385 - Add pref to disable crashing hung GMPs. r=jwwang

This commit is contained in:
Chris Pearce 2015-09-30 06:56:20 +13:00
parent 67f15d7f96
commit ffbff031cb
2 changed files with 12 additions and 1 deletions

View File

@ -83,6 +83,7 @@ NS_IMPL_ISUPPORTS_INHERITED(GeckoMediaPluginServiceParent,
static int32_t sMaxAsyncShutdownWaitMs = 0;
static bool sHaveSetTimeoutPrefCache = false;
static bool sKillHungPlugins = true;
GeckoMediaPluginServiceParent::GeckoMediaPluginServiceParent()
: mShuttingDown(false)
@ -98,6 +99,9 @@ GeckoMediaPluginServiceParent::GeckoMediaPluginServiceParent()
Preferences::AddIntVarCache(&sMaxAsyncShutdownWaitMs,
"media.gmp.async-shutdown-timeout",
GMP_DEFAULT_ASYNC_SHUTDONW_TIMEOUT);
Preferences::AddBoolVarCache(&sKillHungPlugins,
"media.gmp.kill-hung-plugins",
true);
}
}
@ -1225,8 +1229,13 @@ void
GeckoMediaPluginServiceParent::CrashPluginNow(uint32_t aPluginId, GMPCrashReason aReason)
{
MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread);
MutexAutoLock lock(mMutex);
if (aReason == kGmpApiTimeout && !sKillHungPlugins) {
LOGD(("%s::%s(%u, %u) but killing hung plugins disabled.",
__CLASS__, __FUNCTION__, aPluginId, aReason));
return;
}
LOGD(("%s::%s(%u, %u)", __CLASS__, __FUNCTION__, aPluginId, aReason));
MutexAutoLock lock(mMutex);
for (const auto& plugin : mPlugins) {
if (plugin->GetPluginId() == aPluginId) {
plugin->Crash(aReason);

View File

@ -304,6 +304,8 @@ pref("media.hardware-video-decoding.enabled", true);
pref("media.decoder.heuristic.dormant.enabled", true);
pref("media.decoder.heuristic.dormant.timeout", 60000);
pref("media.gmp.kill-hung-plugins", true);
#ifdef MOZ_WMF
pref("media.wmf.decoder.thread-count", -1);
#endif