Backed out changeset 901f86bee0f7 (bug 740304) for causing build bustages
authorBogdan Szekely <bszekely@mozilla.com>
Tue, 14 Jun 2022 16:41:59 +0300
changeset 620872 4ffee99aa5d182ff26ca8ea04ce0527351e0ba40
parent 620871 901f86bee0f735cc63e1b5340cfc156558ffcbbb
child 620873 c523e6bb4892f0acbcda9c997beb9bf9104d479a
push id164524
push userbszekely@mozilla.com
push dateTue, 14 Jun 2022 13:54:23 +0000
treeherderautoland@c523e6bb4892 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs740304
milestone103.0a1
backs out901f86bee0f735cc63e1b5340cfc156558ffcbbb
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
Backed out changeset 901f86bee0f7 (bug 740304) for causing build bustages
toolkit/crashreporter/client/crashreporter_linux.cpp
toolkit/crashreporter/client/crashreporter_osx.mm
toolkit/crashreporter/client/crashreporter_win.cpp
--- a/toolkit/crashreporter/client/crashreporter_linux.cpp
+++ b/toolkit/crashreporter/client/crashreporter_linux.cpp
@@ -34,34 +34,29 @@ static void* gnomeLib = nullptr;
 static void* gnomeuiLib = nullptr;
 
 static void LoadSettings() {
   /*
    * NOTE! This code needs to stay in sync with the preference checking
    *       code in in nsExceptionHandler.cpp.
    */
 
-  bool includeURL = true;
-  bool submitReport = true;
   StringTable settings;
   if (ReadStringsFromFile(gSettingsPath + "/" + kIniFile, settings, true)) {
-    if (settings.find("IncludeURL") != settings.end()) {
-      includeURL = settings["IncludeURL"][0] != '0';
+    if (settings.find("IncludeURL") != settings.end() &&
+        gIncludeURLCheck != 0) {
+      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gIncludeURLCheck),
+                                   settings["IncludeURL"][0] != '0');
     }
-    if (settings.find("SubmitReport") != settings.end()) {
-      submitReport = settings["SubmitReport"][0] != '0';
-    }
+    bool enabled = true;
+    if (settings.find("SubmitReport") != settings.end())
+      enabled = settings["SubmitReport"][0] != '0';
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gSubmitReportCheck),
+                                 enabled);
   }
-
-  if (gIncludeURLCheck) {
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gIncludeURLCheck),
-                                 includeURL);
-  }
-  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gSubmitReportCheck),
-                               submitReport);
 }
 
 static string Escape(const string& str) {
   string ret;
   for (auto c : str) {
     if (c == '\\') {
       ret += "\\\\";
     } else if (c == '\n') {
--- a/toolkit/crashreporter/client/crashreporter_osx.mm
+++ b/toolkit/crashreporter/client/crashreporter_osx.mm
@@ -164,25 +164,16 @@ static bool RestartApplication() {
   NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
   if (nil != [userDefaults objectForKey:@"submitReport"]) {
     submitChecked = [userDefaults boolForKey:@"submitReport"];
   } else {
     [userDefaults setBool:submitChecked forKey:@"submitReport"];
   }
   [mSubmitReportButton setState:(submitChecked ? NSOnState : NSOffState)];
 
-  // load default state of include URL checkbox
-  BOOL includeChecked = YES;
-  if (nil != [userDefaults objectForKey:@"IncludeURL"]) {
-    includeChecked = [userDefaults boolForKey:@"IncludeURL"];
-  } else {
-    [userDefaults setBool:includeChecked forKey:@"IncludeURL"];
-  }
-  [mIncludeURLButton setState:(includeChecked ? NSOnState : NSOffState)];
-
   [self updateSubmit];
   [self updateURL];
   [self updateEmail];
 
   [mWindow makeKeyAndOrderFront:nil];
 }
 
 - (void)showErrorUI:(const string&)message {
@@ -282,19 +273,16 @@ static bool RestartApplication() {
 
 - (IBAction)restartClicked:(id)sender {
   RestartApplication();
   [self maybeSubmitReport];
 }
 
 - (IBAction)includeURLClicked:(id)sender {
   [self updateURL];
-  NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
-  [userDefaults setBool:([mIncludeURLButton state] == NSOnState) forKey:@"IncludeURL"];
-  [userDefaults synchronize];
 }
 
 - (void)textDidChange:(NSNotification*)aNotification {
   // update comment parameter
   if ([[[mCommentText textStorage] mutableString] length] > 0)
     gQueryParameters["Comments"] = [[[mCommentText textStorage] mutableString] UTF8String];
   else
     gQueryParameters.removeMember("Comments");
--- a/toolkit/crashreporter/client/crashreporter_win.cpp
+++ b/toolkit/crashreporter/client/crashreporter_win.cpp
@@ -18,17 +18,19 @@
 #include <shlwapi.h>
 #include <math.h>
 #include <set>
 #include <algorithm>
 #include "resource.h"
 #include "windows/sender/crash_report_sender.h"
 #include "common/windows/string_utils-inl.h"
 
+#define CRASH_REPORTER_VALUE L"Enabled"
 #define SUBMIT_REPORT_VALUE L"SubmitCrashReport"
+#define SUBMIT_REPORT_OLD L"SubmitReport"
 #define INCLUDE_URL_VALUE L"IncludeURL"
 
 #define SENDURL_ORIGINAL L"https://crash-reports.mozilla.com/submit"
 #define SENDURL_XPSP2 L"https://crash-reports-xpsp2.mozilla.com/submit"
 
 #define WM_UPLOADCOMPLETE WM_APP
 
 // Thanks, Windows.h :(
@@ -170,16 +172,19 @@ static bool CheckBoolKey(const wchar_t* 
 
 static void SetBoolKey(const wchar_t* key, const wchar_t* value, bool enabled) {
   /*
    * NOTE! This code needs to stay in sync with the preference setting
    *       code in in nsExceptionHandler.cpp.
    */
   HKEY hRegKey;
 
+  // remove the old value from the registry if it exists
+  RemoveUnusedValues(key, SUBMIT_REPORT_OLD);
+
   if (RegCreateKey(HKEY_CURRENT_USER, key, &hRegKey) == ERROR_SUCCESS) {
     DWORD data = (enabled ? 1 : 0);
     RegSetValueEx(hRegKey, value, 0, REG_DWORD, (LPBYTE)&data, sizeof(data));
     RegCloseKey(hRegKey);
   }
 }
 
 static string FormatLastError() {