Backed out 2 changesets (bug 1837907) for causing xpcshell failures in marSuccessPartialWhileBackgroundTaskRunning.js CLOSED TREE

Backed out changeset 1035a42c6a86 (bug 1837907)
Backed out changeset f7551ea88778 (bug 1837907)
This commit is contained in:
Cristian Tuns 2023-11-29 07:56:52 -05:00
Родитель ce041a43b4
Коммит 3d54211109
3 изменённых файлов: 3 добавлений и 63 удалений

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

@ -431,10 +431,6 @@ int main(int argc, char* argv[], char* envp[]) {
mozilla::CreateAndStorePreXULSkeletonUI(GetModuleHandle(nullptr), argc, argv);
#endif
#if defined(XP_UNIX)
setenv("MOZ_ENABLE_APPSHELL_SIG_HANDLER", "1", true);
#endif
nsresult rv = InitXPCOMGlue(LibLoadingStrategy::ReadAhead);
if (NS_FAILED(rv)) {
return 255;

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

@ -45,7 +45,6 @@ using mozilla::widget::ScreenHelperGTK;
using mozilla::widget::ScreenManager;
#define NOTIFY_TOKEN 0xFA
#define QUIT_TOKEN 0xFB
LazyLogModule gWidgetLog("Widget");
LazyLogModule gWidgetDragLog("WidgetDrag");
@ -57,8 +56,6 @@ LazyLogModule gClipboardLog("WidgetClipboard");
static GPollFunc sPollFunc;
nsAppShell* sAppShell = nullptr;
// Wrapper function to disable hang monitoring while waiting in poll().
static gint PollWrapper(GPollFD* aUfds, guint aNfsd, gint aTimeout) {
if (aTimeout == 0) {
@ -145,17 +142,9 @@ gboolean nsAppShell::EventProcessorCallback(GIOChannel* source,
unsigned char c;
Unused << read(self->mPipeFDs[0], &c, 1);
switch (c) {
case NOTIFY_TOKEN:
self->NativeEventCallback();
break;
case QUIT_TOKEN:
self->Exit();
break;
default:
NS_ASSERTION(false, "wrong token");
break;
}
NS_ASSERTION(c == (unsigned char)NOTIFY_TOKEN, "wrong token");
self->NativeEventCallback();
return TRUE;
}
@ -323,39 +312,6 @@ void nsAppShell::StopDBusListening() {
}
#endif
void nsAppShell::TermSignalHandler(int signo) {
if (signo != SIGTERM) {
NS_WARNING("Wrong signal!");
return;
}
sAppShell->ScheduleQuitEvent();
}
void nsAppShell::InstallTermSignalHandler() {
if (!PR_GetEnv("MOZ_ENABLE_APPSHELL_SIG_HANDLER")) {
return;
}
unsetenv("MOZ_ENABLE_APPSHELL_SIG_HANDLER");
if (!XRE_IsParentProcess() || PR_GetEnv("MOZ_DISABLE_SIG_HANDLER")) {
return;
}
struct sigaction act = {}, oldact;
act.sa_handler = TermSignalHandler;
sigfillset(&act.sa_mask);
if (NS_WARN_IF(sigaction(SIGTERM, nullptr, &oldact) != 0)) {
return;
}
if (oldact.sa_handler != SIG_DFL) {
NS_WARNING("SIGTERM signal handler is already set?");
}
sigaction(SIGTERM, &act, nullptr);
sAppShell = this;
}
nsresult nsAppShell::Init() {
mozilla::hal::Init();
@ -455,8 +411,6 @@ nsresult nsAppShell::Init() {
mTag = g_source_attach(source, nullptr);
g_source_unref(source);
InstallTermSignalHandler();
return nsBaseAppShell::Init();
failed:
close(mPipeFDs[0]);
@ -483,11 +437,6 @@ void nsAppShell::ScheduleNativeEventCallback() {
Unused << write(mPipeFDs[1], buf, 1);
}
void nsAppShell::ScheduleQuitEvent() {
unsigned char buf[] = {QUIT_TOKEN};
Unused << write(mPipeFDs[1], buf, 1);
}
bool nsAppShell::ProcessNextNativeEvent(bool mayWait) {
if (mSuspendNativeCount) {
return false;

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

@ -49,11 +49,6 @@ class nsAppShell : public nsBaseAppShell {
static gboolean EventProcessorCallback(GIOChannel* source,
GIOCondition condition, gpointer data);
void InstallTermSignalHandler();
static void TermSignalHandler(int signo);
void ScheduleQuitEvent();
int mPipeFDs[2] = {0, 0};
unsigned mTag = 0;