--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/desktop/firefox/patches/firefox-55-terminator.patch Tue Apr 25 00:30:07 2017 -0700
@@ -0,0 +1,54 @@
+https://bugzilla.mozilla.org/show_bug.cgi?id=1232285
+https://bugzilla.mozilla.org/show_bug.cgi?id=1252382
+
+And a fix to 1232285, which introduced division of crashAfterMS
+by PR_MillisecondsToInterval(1000). crashAfterMS has to be divided
+by 1000 to get number of seconds.
+
+--- a/toolkit/components/terminator/nsTerminator.cpp
++++ b/toolkit/components/terminator/nsTerminator.cpp
[email protected]@ -33,6 +33,12 @@
+ #include "nsExceptionHandler.h"
+ #endif
+
++#if defined(XP_WIN)
++#include <windows.h>
++#else
++#include <unistd.h>
++#endif
++
+ #include "mozilla/ArrayUtils.h"
+ #include "mozilla/Attributes.h"
+ #include "mozilla/DebugOnly.h"
[email protected]@ -53,9 +59,6 @@
+ // forcefully.
+ #define ADDITIONAL_WAIT_BEFORE_CRASH_MS 3000
+
+-// One second, in ticks.
+-#define TICK_DURATION 1000
+-
+ namespace mozilla {
+
+ namespace {
[email protected]@ -141,7 +144,11 @@
+ // we have lost at most one second, which is much
+ // more reasonable.
+ //
+- PR_Sleep(TICK_DURATION);
++#if defined(XP_WIN)
++ Sleep(1000 /* ms */);
++#else
++ usleep(1000000 /* usec */);
++#endif
+
+ if (gHeartbeat++ < timeToLive) {
+ continue;
[email protected]@ -378,7 +385,7 @@
+ }
+
+ UniquePtr<Options> options(new Options());
+- options->crashAfterTicks = crashAfterMS / TICK_DURATION;
++ options->crashAfterTicks = crashAfterMS / 1000;
+
+ DebugOnly<PRThread*> watchdogThread = CreateSystemThread(RunWatchdog,
+ options.release());