Bug 526623: Send channel with crash data. r=dtownsend

This commit is contained in:
David Dahl 2009-11-13 15:05:14 -08:00
parent 00298412c0
commit ade0db0dc5

View File

@ -205,6 +205,7 @@
#include "nsExceptionHandler.h"
#include "nsICrashReporter.h"
#define NS_CRASHREPORTER_CONTRACTID "@mozilla.org/toolkit/crash-reporter;1"
#include "nsIPrefService.h"
#endif
#ifdef WINCE
@ -3284,6 +3285,23 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
rv |= xpcom.SetWindowCreator(nativeApp);
NS_ENSURE_SUCCESS(rv, 1);
#ifdef MOZ_CRASHREPORTER
// tell the crash reporter to also send the release channel
nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv);
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIPrefBranch> defaultPrefBranch;
rv = prefs->GetDefaultBranch(nsnull, getter_AddRefs(defaultPrefBranch));
if (NS_SUCCEEDED(rv)) {
nsXPIDLCString sval;
rv = defaultPrefBranch->GetCharPref("app.update.channel", getter_Copies(sval));
if (NS_SUCCEEDED(rv)) {
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ReleaseChannel"),
sval);
}
}
}
#endif
{
if (startOffline) {
nsCOMPtr<nsIIOService2> io (do_GetService("@mozilla.org/network/io-service;1"));