Bug 1384220 - remove --with-crashreporter-enable-percent configure option; r=ted.mielczarek
authorNathan Froyd <froydnj@mozilla.com>
Wed, 26 Jul 2017 11:16:43 -0400
changeset 371311 d02f1a40367af02dbc7500158c0c975f67c80c79
parent 371310 67a4ed32996b2d4fa3366715212e29f4f9a7c337
child 371312 865e18f01ece0838ea9767f200a52df68154b62e
push id32241
push usercbook@mozilla.com
push dateThu, 27 Jul 2017 08:57:54 +0000
treeherdermozilla-central@e5693cea1ec9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1384220
milestone56.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 1384220 - remove --with-crashreporter-enable-percent configure option; r=ted.mielczarek This option was added ~decade ago; AFAICT from bug archaeology, the option was added to prevent our servers from being overwhelmed. Somewhere over the years, however, we obtained more capable servers and the option disappeared from mozconfigs. It seems moderately unlikely that we'll have a need for this option again, and we could reintroduce this patch very easily in any event. Let's go ahead and remove it.
build/moz.configure/old.configure
old-configure.in
toolkit/crashreporter/client/crashreporter.cpp
toolkit/crashreporter/client/crashreporter.h
toolkit/crashreporter/client/crashreporter_linux.cpp
toolkit/crashreporter/client/crashreporter_osx.mm
toolkit/crashreporter/client/crashreporter_win.cpp
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -245,17 +245,16 @@ def old_configure_options(*options):
     '--with-android-distribution-directory',
     '--with-android-max-sdk',
     '--with-android-min-sdk',
     '--with-android-sdk',
     '--with-app-basename',
     '--with-app-name',
     '--with-arch',
     '--with-branding',
-    '--with-crashreporter-enable-percent',
     '--with-cross-lib',
     '--with-debug-label',
     '--with-default-mozilla-five-home',
     '--with-distribution-id',
     '--with-doc-include-dirs',
     '--with-doc-input-dirs',
     '--with-doc-output-dir',
     '--with-float-abi',
--- a/old-configure.in
+++ b/old-configure.in
@@ -3107,27 +3107,16 @@ if test -n "$MOZ_CRASHREPORTER"; then
   if test "$OS_ARCH" = "WINNT"; then
     if test -z "$HAVE_64BIT_BUILD" -a -n "$COMPILE_ENVIRONMENT"; then
       MOZ_CRASHREPORTER_INJECTOR=1
       AC_DEFINE(MOZ_CRASHREPORTER_INJECTOR)
     fi
   fi
 fi
 
-MOZ_ARG_WITH_STRING(crashreporter-enable-percent,
-[  --with-crashreporter-enable-percent=NN
-                          Enable sending crash reports by default on NN% of users. (default=100)],
-[ val=`echo $withval | sed 's/[^0-9]//g'`
-    MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"])
-
-if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then
-   MOZ_CRASHREPORTER_ENABLE_PERCENT=100
-fi
-AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT)
-
 dnl ========================================================
 dnl = libjpeg-turbo configuration
 dnl ========================================================
 MOZ_LIBJPEG_TURBO=
 LIBJPEG_TURBO_USE_YASM=
 if test -z "$MOZ_SYSTEM_JPEG"; then
     MOZ_LIBJPEG_TURBO=1
 fi
--- a/toolkit/crashreporter/client/crashreporter.cpp
+++ b/toolkit/crashreporter/client/crashreporter.cpp
@@ -434,22 +434,16 @@ void SendCompleted(bool success, const s
       UIPruneSavedDumps(directory);
       WriteSubmissionEvent(Failed, "");
     }
   } else {
     WriteSubmissionEvent(Failed, "");
   }
 }
 
-bool ShouldEnableSending()
-{
-  srand(time(0));
-  return ((rand() % 100) < MOZ_CRASHREPORTER_ENABLE_PERCENT);
-}
-
 static string ComputeDumpHash() {
 #ifdef XP_LINUX
   // On Linux we rely on the system-provided libcurl which uses nss so we have
   // to also use the system-provided nss instead of the ones we have bundled.
   const char* libnssNames[] = {
     "libnss3.so",
 #ifndef HAVE_64BIT_BUILD
     // 32-bit versions on 64-bit hosts
--- a/toolkit/crashreporter/client/crashreporter.h
+++ b/toolkit/crashreporter/client/crashreporter.h
@@ -110,17 +110,16 @@ namespace CrashReporter {
                     StringTable& strings,
                     bool escape);
   bool WriteStringsToFile(const std::string& path,
                           const std::string& header,
                           StringTable& strings,
                           bool escape);
   void LogMessage(const std::string& message);
   void DeleteDump();
-  bool ShouldEnableSending();
 
   // Telemetry ping
   bool SendCrashPing(StringTable& strings, const std::string& hash,
                      std::string& pingUuid, const std::string& pingDir);
 
   static const unsigned int kSaveCount = 10;
 }
 
--- a/toolkit/crashreporter/client/crashreporter_linux.cpp
+++ b/toolkit/crashreporter/client/crashreporter_linux.cpp
@@ -53,21 +53,19 @@ static void LoadSettings()
       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gEmailMeCheck),
                                    settings["EmailMe"][0] != '0');
     }
     if (settings.find("IncludeURL") != settings.end() &&
         gIncludeURLCheck != 0) {
       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gIncludeURLCheck),
                                    settings["IncludeURL"][0] != '0');
     }
-    bool enabled;
+    bool enabled = true;
     if (settings.find("SubmitReport") != settings.end())
       enabled = settings["SubmitReport"][0] != '0';
-    else
-      enabled = ShouldEnableSending();
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gSubmitReportCheck),
                                  enabled);
   }
 }
 
 void SaveSettings()
 {
   /*
--- a/toolkit/crashreporter/client/crashreporter_osx.mm
+++ b/toolkit/crashreporter/client/crashreporter_osx.mm
@@ -164,24 +164,22 @@ static bool RestartApplication()
   }
 
   // resize some buttons horizontally and possibly some controls vertically
   [self doInitialResizing];
 
   // load default state of submit checkbox
   // we don't just do this via IB because we want the default to be
   // off a certain percentage of the time
-  BOOL submitChecked = NO;
+  BOOL submitChecked = YES;
   NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
   if (nil != [userDefaults objectForKey:@"submitReport"]) {
-    submitChecked =  [userDefaults boolForKey:@"submitReport"];
+    submitChecked = [userDefaults boolForKey:@"submitReport"];
   }
   else {
-    // use compile-time specified enable percentage
-    submitChecked = ShouldEnableSending();
     [userDefaults setBool:submitChecked forKey:@"submitReport"];
   }
   [mSubmitReportButton setState:(submitChecked ? NSOnState : NSOffState)];
   
   [self updateSubmit];
   [self updateURL];
   [self updateEmail];
 
--- a/toolkit/crashreporter/client/crashreporter_win.cpp
+++ b/toolkit/crashreporter/client/crashreporter_win.cpp
@@ -907,17 +907,17 @@ static BOOL CALLBACK CrashReporterDialog
     GetRelativeRect(hwnd, hwndDlg, &rect);
     long maxdiff = ResizeControl(hwnd, rect, Str(ST_CHECKSUBMIT), false,
                                 gCheckboxPadding);
     SetDlgItemText(hwndDlg, IDC_SUBMITREPORTCHECK,
                    Str(ST_CHECKSUBMIT).c_str());
 
     if (!CheckBoolKey(gCrashReporterKey.c_str(),
                       SUBMIT_REPORT_VALUE, &enabled))
-      enabled = ShouldEnableSending();
+      enabled = true;
 
     CheckDlgButton(hwndDlg, IDC_SUBMITREPORTCHECK, enabled ? BST_CHECKED
                                                            : BST_UNCHECKED);
     SubmitReportChecked(hwndDlg);
 
     HWND hwndComment = GetDlgItem(hwndDlg, IDC_COMMENTTEXT);
     WNDPROC OldWndProc = (WNDPROC)SetWindowLongPtr(hwndComment,
                                                    GWLP_WNDPROC,