Bug 1139860 - Fix xpcshell content process timeout crashes (r=jimm)

This commit is contained in:
Bill McCloskey 2015-09-08 17:12:27 -07:00
parent b565dea114
commit f25a5541e1

View File

@ -2189,7 +2189,7 @@ ContentParent::StartForceKillTimer()
return;
}
int32_t timeoutSecs = Preferences::GetInt("dom.ipc.tabs.shutdownTimeoutSecs", 0);
int32_t timeoutSecs = Preferences::GetInt("dom.ipc.tabs.shutdownTimeoutSecs", 5);
if (timeoutSecs > 0) {
mForceKillTimer = do_CreateInstance("@mozilla.org/timer;1");
MOZ_ASSERT(mForceKillTimer);
@ -3471,6 +3471,14 @@ ContentParent::DeallocPRemoteSpellcheckEngineParent(PRemoteSpellcheckEngineParen
/* static */ void
ContentParent::ForceKillTimerCallback(nsITimer* aTimer, void* aClosure)
{
#ifdef ENABLE_TESTS
// We don't want to time out the content process during XPCShell tests. This
// is the easiest way to ensure that.
if (PR_GetEnv("XPCSHELL_TEST_PROFILE_DIR")) {
return;
}
#endif
auto self = static_cast<ContentParent*>(aClosure);
self->KillHard("ShutDownKill");
}