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 145075 8a6ed3ef085ad242cd8b3eaf4c80e49e90b23b9f
parent 145074 bcf2e457c1e19eded56223d4cd2399b2a365bc32
child 145076 86f568d2d467bc1b670047be002aab7d1040bd8c
push id2464
push userryanvm@gmail.com
push dateFri, 30 Aug 2013 17:41:44 +0000
treeherderfx-team@87d25d64fbb4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs717538
milestone26.0a1
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 {