Bug 1365309 - Part 4: Disable the BackgroundHangMonitor in GMP processes, r=froydnj

This involved a change to BackgroundHangMonitor, as it initialized sDisabled
incorrectly to false, instead of true, We need sDisabled initialized to true, as
we cannot assume that it is enabled until BackgroundHangMonitor::Startup() is
called.

MozReview-Commit-ID: 94slLTkNk3C
This commit is contained in:
Michael Layzell 2017-06-16 17:31:49 -04:00
Родитель 403cfbc0a1
Коммит a7a732298b
2 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -44,8 +44,6 @@ GMPProcessChild::Init(int aArgc, char* aArgv[])
#error Not implemented
#endif
BackgroundHangMonitor::Startup();
return mPlugin.Init(pluginFilename,
ParentPid(),
IOThreadChild::message_loop(),
@ -55,7 +53,6 @@ GMPProcessChild::Init(int aArgc, char* aArgv[])
void
GMPProcessChild::CleanUp()
{
BackgroundHangMonitor::Shutdown();
}
} // namespace gmp

Просмотреть файл

@ -240,7 +240,7 @@ public:
StaticRefPtr<BackgroundHangManager> BackgroundHangManager::sInstance;
bool BackgroundHangManager::sDisabled = false;
bool BackgroundHangManager::sDisabled = true;
MOZ_THREAD_LOCAL(BackgroundHangThread*) BackgroundHangThread::sTlsKey;
bool BackgroundHangThread::sTlsKeyInitialized;
@ -720,6 +720,10 @@ BackgroundHangMonitor::Startup()
#ifdef MOZ_ENABLE_BACKGROUND_HANG_MONITOR
MOZ_ASSERT(!BackgroundHangManager::sInstance, "Already initialized");
// Enable the BackgroundHangManager by setting sDisabled to false in Startup.
MOZ_ASSERT(BackgroundHangManager::sDisabled);
BackgroundHangManager::sDisabled = false;
if (!strcmp(NS_STRINGIFY(MOZ_UPDATE_CHANNEL), "beta")) {
if (XRE_IsParentProcess()) { // cached ClientID hasn't been read yet
BackgroundHangThread::Startup();