Bug 1386207 - Don't use Chromium platform macros under toolkit/. r=glandium r=jwatt draft
authorJan Beich <jbeich@FreeBSD.org>
Tue, 01 Aug 2017 11:51:03 +0000
changeset 702982 7d33809cdcf02792e3c8e18acbaa72f94a8ae1f9
parent 702981 869e598b07ad05e1b829926024bbebbfcdae1c8b
child 702983 3947bdefb1dac6ac683512fa9e98ab5b691fb7a2
push id90652
push userbmo:jbeich@FreeBSD.org
push dateFri, 24 Nov 2017 04:38:18 +0000
reviewersglandium, jwatt
bugs1386207
milestone59.0a1
Bug 1386207 - Don't use Chromium platform macros under toolkit/. r=glandium r=jwatt MozReview-Commit-ID: F2wiyEE8gTP
toolkit/xre/nsAppRunner.cpp
toolkit/xre/nsEmbedFunctions.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4905,17 +4905,17 @@ XRE_main(int argc, char* argv[], const B
   return result;
 }
 
 nsresult
 XRE_InitCommandLine(int aArgc, char* aArgv[])
 {
   nsresult rv = NS_OK;
 
-#if defined(OS_WIN)
+#if defined(XP_WIN)
   CommandLine::Init(aArgc, aArgv);
 #else
 
   // these leak on error, but that's OK: we'll just exit()
   char** canonArgs = new char*[aArgc];
 
   // get the canonical version of the binary's path
   nsCOMPtr<nsIFile> binFile;
--- a/toolkit/xre/nsEmbedFunctions.cpp
+++ b/toolkit/xre/nsEmbedFunctions.cpp
@@ -314,28 +314,26 @@ AddContentSandboxLevelAnnotation()
 
 namespace {
 
 int GetDebugChildPauseTime() {
   auto pauseStr = PR_GetEnv("MOZ_DEBUG_CHILD_PAUSE");
   if (pauseStr && *pauseStr) {
     int pause = atoi(pauseStr);
     if (pause != 1) { // must be !=1 since =1 enables the default pause time
-#if defined(OS_WIN)
+#if defined(XP_WIN)
       pause *= 1000; // convert to ms
 #endif
       return pause;
     }
   }
-#ifdef OS_POSIX
-  return 30; // seconds
-#elif defined(OS_WIN)
+#if defined(XP_WIN)
   return 10000; // milliseconds
 #else
-  return 0;
+  return 30; // seconds
 #endif
 }
 
 } // namespace
 
 nsresult
 XRE_InitChildProcess(int aArgc,
                      char* aArgv[],
@@ -514,29 +512,29 @@ XRE_InitChildProcess(int aArgc,
 #if MOZ_WIDGET_GTK == 2
   XRE_GlibInit();
 #endif
 #ifdef MOZ_WIDGET_GTK
   // Setting the name here avoids the need to pass this through to gtk_init().
   g_set_prgname(aArgv[0]);
 #endif
 
-#ifdef OS_POSIX
+#if !defined(XP_WIN)
   if (PR_GetEnv("MOZ_DEBUG_CHILD_PROCESS") ||
       PR_GetEnv("MOZ_DEBUG_CHILD_PAUSE")) {
 #if defined(XP_LINUX) && defined(DEBUG)
     if (prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0) != 0) {
       printf_stderr("Could not allow ptrace from any process.\n");
     }
 #endif
     printf_stderr("\n\nCHILDCHILDCHILDCHILD\n  debug me @ %d\n\n",
                   base::GetCurrentProcId());
     sleep(GetDebugChildPauseTime());
   }
-#elif defined(OS_WIN)
+#else
   if (PR_GetEnv("MOZ_DEBUG_CHILD_PROCESS")) {
     NS_DebugBreak(NS_DEBUG_BREAK,
                   "Invoking NS_DebugBreak() to debug child process",
                   nullptr, __FILE__, __LINE__);
   } else if (PR_GetEnv("MOZ_DEBUG_CHILD_PAUSE")) {
     printf_stderr("\n\nCHILDCHILDCHILDCHILD\n  debug me @ %d\n\n",
                   base::GetCurrentProcId());
     ::Sleep(GetDebugChildPauseTime());