зеркало из https://github.com/mozilla/pjs.git
b=429592 disable hang monitor during GLib main loop poll f?bsmedberg r?roc
--HG-- extra : rebase_source : 6cc701723aa63e1ad2168dcdf7f8a3832c57ad5a
This commit is contained in:
Родитель
159337e252
Коммит
28deda5ac9
|
@ -45,6 +45,7 @@
|
|||
#include "nsWindow.h"
|
||||
#include "prlog.h"
|
||||
#include "prenv.h"
|
||||
#include "mozilla/HangMonitor.h"
|
||||
|
||||
#define NOTIFY_TOKEN 0xFA
|
||||
|
||||
|
@ -55,6 +56,18 @@ PRLogModuleInfo *gWidgetDragLog = nsnull;
|
|||
PRLogModuleInfo *gWidgetDrawLog = nsnull;
|
||||
#endif
|
||||
|
||||
static GPollFunc sPollFunc;
|
||||
|
||||
// Wrapper function to disable hang monitoring while waiting in poll().
|
||||
static gint
|
||||
PollWrapper(GPollFD *ufds, guint nfsd, gint timeout_)
|
||||
{
|
||||
mozilla::HangMonitor::Suspend();
|
||||
gint result = (*sPollFunc)(ufds, nfsd, timeout_);
|
||||
mozilla::HangMonitor::NotifyActivity();
|
||||
return result;
|
||||
}
|
||||
|
||||
/*static*/ gboolean
|
||||
nsAppShell::EventProcessorCallback(GIOChannel *source,
|
||||
GIOCondition condition,
|
||||
|
@ -94,6 +107,11 @@ nsAppShell::Init()
|
|||
gWidgetDrawLog = PR_NewLogModule("WidgetDraw");
|
||||
#endif
|
||||
|
||||
if (!sPollFunc) {
|
||||
sPollFunc = g_main_context_get_poll_func(NULL);
|
||||
g_main_context_set_poll_func(NULL, &PollWrapper);
|
||||
}
|
||||
|
||||
GIOChannel *ioc;
|
||||
|
||||
if (PR_GetEnv("MOZ_DEBUG_PAINTS"))
|
||||
|
|
Загрузка…
Ссылка в новой задаче