mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1209385 - Add pref to disable crashing hung GMPs. r=jwwang
This commit is contained in:
parent
67f15d7f96
commit
ffbff031cb
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user