Bug 1402519 - Remove MOZ_CRASHREPORTER directives from modules/libpref; r?njn draft
authorGabriele Svelto <gsvelto@mozilla.com>
Fri, 29 Sep 2017 16:27:44 +0200
changeset 688681 d595b9f8bd93b1091498acfe15b38ade4a06d02d
parent 688680 8fb82a3426e684b6231da7f7c1ad1e451ad0f725
child 688682 f370ab7b0ceadecbca5d152e16ce2b598349e061
push id86821
push usergsvelto@mozilla.com
push dateMon, 30 Oct 2017 14:19:43 +0000
reviewersnjn
bugs1402519
milestone58.0a1
Bug 1402519 - Remove MOZ_CRASHREPORTER directives from modules/libpref; r?njn MozReview-Commit-ID: 3Jr4Cfe9Bn1
modules/libpref/Preferences.cpp
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -40,16 +40,17 @@
 #include "nsClassHashtable.h"
 #include "nsCOMArray.h"
 #include "nsCOMPtr.h"
 #include "nsCRT.h"
 #include "nsDataHashtable.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsICategoryManager.h"
 #include "nsIConsoleService.h"
+#include "nsICrashReporter.h"
 #include "nsIDirectoryService.h"
 #include "nsIFile.h"
 #include "nsIInputStream.h"
 #include "nsIMemoryReporter.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
 #include "nsIOutputStream.h"
 #include "nsIPrefBranch.h"
@@ -76,20 +77,16 @@
 #include "nsXPCOM.h"
 #include "nsXULAppAPI.h"
 #include "nsZipArchive.h"
 #include "plbase64.h"
 #include "PLDHashTable.h"
 #include "plstr.h"
 #include "prlink.h"
 
-#ifdef MOZ_CRASHREPORTER
-#include "nsICrashReporter.h"
-#endif
-
 #ifdef XP_WIN
 #include "windows.h"
 #endif
 
 using namespace mozilla;
 
 #ifdef DEBUG
 
@@ -2610,26 +2607,25 @@ nsPrefBranch::GetComplexValue(const char
     nsCOMPtr<nsISupportsString> theString(
       do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv));
 
     if (NS_SUCCEEDED(rv)) {
       // Debugging to see why we end up with very long strings here with
       // some addons, see bug 836263.
       nsAutoString wdata;
       if (!AppendUTF8toUTF16(utf8String, wdata, mozilla::fallible)) {
-#ifdef MOZ_CRASHREPORTER
         nsCOMPtr<nsICrashReporter> cr =
           do_GetService("@mozilla.org/toolkit/crash-reporter;1");
         if (cr) {
           cr->AnnotateCrashReport(NS_LITERAL_CSTRING("bug836263-size"),
                                   nsPrintfCString("%x", utf8String.Length()));
           cr->RegisterAppMemory(uint64_t(utf8String.BeginReading()),
                                 std::min(0x1000U, utf8String.Length()));
         }
-#endif
+
         MOZ_CRASH("bug836263");
       }
       theString->SetData(wdata);
       theString.forget(reinterpret_cast<nsISupportsString**>(aRetVal));
     }
     return rv;
   }