Bug 1419959 - Unbreak build on Tier3 platforms after bug 1402519. r=gsvelto draft
authorJan Beich <jbeich@FreeBSD.org>
Fri, 24 Nov 2017 02:31:42 +0000
changeset 703180 1e313b480a7340e707a7879d9c6373b57001e263
parent 703179 f2e36fbb90fad27c034105709a4cbbaef9bd58c8
child 741688 c449b4471c249509118139a988fb9e269512b42a
push id90730
push userbmo:jbeich@FreeBSD.org
push dateFri, 24 Nov 2017 12:48:31 +0000
reviewersgsvelto
bugs1419959, 1402519
milestone59.0a1
Bug 1419959 - Unbreak build on Tier3 platforms after bug 1402519. r=gsvelto MozReview-Commit-ID: 8NNtuRkfbJe
toolkit/crashreporter/nsDummyExceptionHandler.cpp
toolkit/crashreporter/nsExceptionHandler.h
toolkit/xre/nsEmbedFunctions.cpp
--- a/toolkit/crashreporter/nsDummyExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsDummyExceptionHandler.cpp
@@ -307,37 +307,37 @@ InitChildProcessTmpDir(nsIFile* aDirOver
 
 #if defined(XP_WIN)
 bool
 SetRemoteExceptionHandler(const nsACString& crashPipe)
 {
   return false;
 }
 
-#elif defined(XP_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+#elif defined(XP_MACOSX)
+
+bool
+SetRemoteExceptionHandler(const nsACString& crashPipe)
+{
+  return false;
+}
+
+#else
 
 bool
 CreateNotificationPipeForChild(int* childCrashFd, int* childCrashRemapFd)
 {
   return false;
 }
 
 bool
 SetRemoteExceptionHandler()
 {
   return false;
 }
-
-#elif defined(XP_MACOSX)
-
-bool
-SetRemoteExceptionHandler(const nsACString& crashPipe)
-{
-  return false;
-}
 #endif  // XP_WIN
 
 bool
 TakeMinidumpForChild(uint32_t childPid, nsIFile** dump, uint32_t* aSequence)
 {
   return false;
 }
 
--- a/toolkit/crashreporter/nsExceptionHandler.h
+++ b/toolkit/crashreporter/nsExceptionHandler.h
@@ -262,17 +262,17 @@ public:
 void InjectCrashReporterIntoProcess(DWORD processID, InjectorCrashCallback* cb);
 void UnregisterInjectorCallback(DWORD processID);
 #endif
 
 // Child-side API
 bool SetRemoteExceptionHandler(const nsACString& crashPipe);
 void InitChildProcessTmpDir(nsIFile* aDirOverride = nullptr);
 
-#  elif defined(XP_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+#  else
 // Parent-side API for children
 
 // Set the outparams for crash reporter server's fd (|childCrashFd|)
 // and the magic fd number it should be remapped to
 // (|childCrashRemapFd|) before exec() in the child process.
 // |SetRemoteExceptionHandler()| in the child process expects to find
 // the server at |childCrashRemapFd|.  Return true iff successful.
 //
--- a/toolkit/xre/nsEmbedFunctions.cpp
+++ b/toolkit/xre/nsEmbedFunctions.cpp
@@ -278,20 +278,18 @@ XRE_TakeMinidumpForChild(uint32_t aChild
   return CrashReporter::TakeMinidumpForChild(aChildPid, aDump, aSequence);
 }
 
 bool
 XRE_SetRemoteExceptionHandler(const char* aPipe/*= 0*/)
 {
 #if defined(XP_WIN) || defined(XP_MACOSX)
   return CrashReporter::SetRemoteExceptionHandler(nsDependentCString(aPipe));
-#elif defined(OS_LINUX)
+#else
   return CrashReporter::SetRemoteExceptionHandler();
-#else
-#  error "OOP crash reporter unsupported on this platform"
 #endif
 }
 
 #if defined(XP_WIN)
 void
 SetTaskbarGroupId(const nsString& aId)
 {
     if (FAILED(SetCurrentProcessExplicitAppUserModelID(aId.get()))) {
@@ -488,26 +486,24 @@ XRE_InitChildProcess(int aArgc,
     // on windows and mac, |crashReporterArg| is the named pipe on which the
     // server is listening for requests, or "-" if crash reporting is
     // disabled.
     if (0 != strcmp("-", crashReporterArg) &&
         !XRE_SetRemoteExceptionHandler(crashReporterArg)) {
       // Bug 684322 will add better visibility into this condition
       NS_WARNING("Could not setup crash reporting\n");
     }
-#elif defined(OS_LINUX)
+#else
     // on POSIX, |crashReporterArg| is "true" if crash reporting is
     // enabled, false otherwise
     if (0 != strcmp("false", crashReporterArg) &&
         !XRE_SetRemoteExceptionHandler(nullptr)) {
       // Bug 684322 will add better visibility into this condition
       NS_WARNING("Could not setup crash reporting\n");
     }
-#else
-#  error "OOP crash reporting unsupported on this platform"
 #endif
   }
 
   // For Init/Shutdown thread name annotations in the crash reporter.
   CrashReporter::InitThreadAnnotationRAII annotation;
 
   gArgv = aArgv;
   gArgc = aArgc;