mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1228437 - Add BHR stats from e10s child process. B2G fix by Ting-Yu Chou. r=nchen
This commit is contained in:
parent
95ef275799
commit
92baa0f0e7
@ -521,12 +521,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() &&
|
||||
|
@ -23,6 +23,10 @@
|
||||
#include "nsExceptionHandler.h"
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_NUWA_PROCESS
|
||||
#include "ipc/Nuwa.h"
|
||||
#endif
|
||||
|
||||
#ifdef XP_WIN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
@ -109,8 +113,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");
|
||||
@ -176,6 +184,12 @@ ThreadMain(void*)
|
||||
{
|
||||
PR_SetCurrentThreadName("Hang Monitor");
|
||||
|
||||
#ifdef MOZ_NUWA_PROCESS
|
||||
if (IsNuwaProcess()) {
|
||||
NuwaMarkCurrentThread(nullptr, nullptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
MonitorAutoLock lock(*gMonitor);
|
||||
|
||||
// In order to avoid issues with the hang monitor incorrectly triggering
|
||||
@ -256,10 +270,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 +305,8 @@ Startup()
|
||||
void
|
||||
Shutdown()
|
||||
{
|
||||
if (GeckoProcessType_Default != XRE_GetProcessType()) {
|
||||
if (GeckoProcessType_Default != XRE_GetProcessType() &&
|
||||
GeckoProcessType_Content != XRE_GetProcessType()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user