Bug 717538 - Enable crash reporter in application.ini with MOZ_CRASHREPORTER instead of MOZILLA_OFFICIAL. r=ted
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 30 Aug 2013 11:10:57 +0900
changeset 157980 8a6ed3ef085ad242cd8b3eaf4c80e49e90b23b9f
parent 157979 bcf2e457c1e19eded56223d4cd2399b2a365bc32
child 157981 86f568d2d467bc1b670047be002aab7d1040bd8c
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs717538
milestone26.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 717538 - Enable crash reporter in application.ini with MOZ_CRASHREPORTER instead of MOZILLA_OFFICIAL. r=ted
build/Makefile.in
build/application.ini
toolkit/crashreporter/nsExceptionHandler.cpp
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -52,18 +52,18 @@ DEFINES += \
   -DMAR_CHANNEL_ID="$(MAR_CHANNEL_ID)" \
   -DACCEPTED_MAR_CHANNEL_IDS="$(ACCEPTED_MAR_CHANNEL_IDS)" \
   $(NULL)
 
 ifdef MOZ_APP_PROFILE
 DEFINES += -DMOZ_APP_PROFILE="$(MOZ_APP_PROFILE)"
 endif
 
-ifdef MOZILLA_OFFICIAL
-DEFINES += -DMOZILLA_OFFICIAL
+ifdef MOZ_CRASHREPORTER
+DEFINES += -DMOZ_CRASHREPORTER
 endif
 
 ifdef MOZ_PROFILE_MIGRATOR
 DEFINES += -DMOZ_PROFILE_MIGRATOR
 endif
 
 ifdef MOZ_EXTENSION_MANAGER
 DEFINES += -DMOZ_EXTENSION_MANAGER
--- a/build/application.ini
+++ b/build/application.ini
@@ -32,13 +32,13 @@ MaxVersion=@GRE_MILESTONE@
 [XRE]
 #ifdef MOZ_PROFILE_MIGRATOR
 EnableProfileMigrator=1
 #endif
 #ifdef MOZ_EXTENSION_MANAGER
 EnableExtensionManager=1
 #endif
 
+#if MOZ_CRASHREPORTER
 [Crash Reporter]
-#if MOZILLA_OFFICIAL
 Enabled=1
+ServerURL=https://crash-reports.mozilla.com/submit?id=@MOZ_APP_ID@&version=@MOZ_APP_VERSION@&buildid=@APP_BUILDID@
 #endif
-ServerURL=https://crash-reports.mozilla.com/submit?id=@MOZ_APP_ID@&version=@MOZ_APP_VERSION@&buildid=@APP_BUILDID@
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -797,19 +797,29 @@ namespace {
 
 
 nsresult SetExceptionHandler(nsIFile* aXREDirectory,
                              bool force/*=false*/)
 {
   if (gExceptionHandler)
     return NS_ERROR_ALREADY_INITIALIZED;
 
+#if defined(MOZ_DEBUG)
+  // In debug builds, disable the crash reporter by default, and allow to
+  // enable it with the MOZ_CRASHREPORTER environment variable.
+  const char *envvar = PR_GetEnv("MOZ_CRASHREPORTER");
+  if ((!envvar || !*envvar) && !force)
+    return NS_OK;
+#else
+  // In non-debug builds, enable the crash reporter by default, and allow
+  // to disable it with the MOZ_CRASHREPORTER_DISABLE environment variable.
   const char *envvar = PR_GetEnv("MOZ_CRASHREPORTER_DISABLE");
   if (envvar && *envvar && !force)
     return NS_OK;
+#endif
 
 #if defined(MOZ_WIDGET_GONK)
   doReport = false;
   headlessClient = true;
 #elif defined(XP_WIN)
   if (XRE_GetWindowsEnvironment() == WindowsEnvironmentType_Desktop) {
     doReport = ShouldReport();
   } else {