Bug 1228437 - Add BHR stats from e10s child process. r=nchen

This commit is contained in:
Vladan Djeric 2015-12-26 19:34:11 -05:00
Родитель 7e889ff52e
Коммит 8a014a7505
2 изменённых файлов: 15 добавлений и 8 удалений

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

@ -532,12 +532,16 @@ NS_InitXPCOM2(nsIServiceManager** aResult,
sExitManager = new AtExitManager();
}
if (!MessageLoop::current()) {
MessageLoop* messageLoop = MessageLoop::current();
if (!messageLoop) {
sMessageLoop = new MessageLoopForUI(MessageLoop::TYPE_MOZILLA_UI);
sMessageLoop->set_thread_name("Gecko");
// Set experimental values for main thread hangs:
// 128ms for transient hangs and 8192ms for permanent hangs
sMessageLoop->set_hang_timeouts(128, 8192);
} else if (messageLoop->type() == MessageLoop::TYPE_MOZILLA_CHILD) {
messageLoop->set_thread_name("Gecko_Child");
messageLoop->set_hang_timeouts(128, 8192);
}
if (XRE_IsParentProcess() &&

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

@ -109,8 +109,12 @@ Crash()
#endif
#ifdef MOZ_CRASHREPORTER
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Hang"),
NS_LITERAL_CSTRING("1"));
// If you change this, you must also deal with the threadsafety of AnnotateCrashReport in
// non-chrome processes!
if (GeckoProcessType_Default == XRE_GetProcessType()) {
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Hang"),
NS_LITERAL_CSTRING("1"));
}
#endif
NS_RUNTIMEABORT("HangMonitor triggered");
@ -256,10 +260,8 @@ ThreadMain(void*)
void
Startup()
{
// The hang detector only runs in chrome processes. If you change this,
// you must also deal with the threadsafety of AnnotateCrashReport in
// non-chrome processes!
if (GeckoProcessType_Default != XRE_GetProcessType()) {
if (GeckoProcessType_Default != XRE_GetProcessType() &&
GeckoProcessType_Content != XRE_GetProcessType()) {
return;
}
@ -293,7 +295,8 @@ Startup()
void
Shutdown()
{
if (GeckoProcessType_Default != XRE_GetProcessType()) {
if (GeckoProcessType_Default != XRE_GetProcessType() &&
GeckoProcessType_Content != XRE_GetProcessType()) {
return;
}