summaryrefslogtreecommitdiffstats
path: root/toolkit/xre
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/xre')
-rw-r--r--toolkit/xre/nsAndroidStartup.cpp9
-rw-r--r--toolkit/xre/nsAppRunner.cpp588
-rw-r--r--toolkit/xre/nsEmbedFunctions.cpp79
-rw-r--r--toolkit/xre/nsWindowsWMain.cpp4
-rw-r--r--toolkit/xre/nsX11ErrorHandler.cpp12
5 files changed, 1 insertions, 691 deletions
diff --git a/toolkit/xre/nsAndroidStartup.cpp b/toolkit/xre/nsAndroidStartup.cpp
index a88c58e5d..47b9ec6e5 100644
--- a/toolkit/xre/nsAndroidStartup.cpp
+++ b/toolkit/xre/nsAndroidStartup.cpp
@@ -26,15 +26,6 @@ GeckoStart(JNIEnv* env, char* data, const nsXREAppData* appData)
{
mozilla::jni::SetGeckoThreadEnv(env);
-#ifdef MOZ_CRASHREPORTER
- const struct mapping_info *info = getLibraryMapping();
- while (info->name) {
- CrashReporter::AddLibraryMapping(info->name, info->base,
- info->len, info->offset);
- info++;
- }
-#endif
-
if (!data) {
LOG("Failed to get arguments for GeckoStart\n");
return;
diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
index 1b5c2ed75..530e4a353 100644
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -190,17 +190,6 @@
#include "jprof.h"
#endif
-#ifdef MOZ_CRASHREPORTER
-#include "nsExceptionHandler.h"
-#include "nsICrashReporter.h"
-#define NS_CRASHREPORTER_CONTRACTID "@mozilla.org/toolkit/crash-reporter;1"
-#include "nsIPrefService.h"
-#include "nsIMemoryInfoDumper.h"
-#if defined(XP_LINUX) && !defined(ANDROID)
-#include "mozilla/widget/LSBUtils.h"
-#endif
-#endif
-
#include "base/command_line.h"
#include "GTestRunner.h"
@@ -646,10 +635,6 @@ class nsXULAppInfo : public nsIXULAppInfo,
#ifdef XP_WIN
public nsIWinAppHelper,
#endif
-#ifdef MOZ_CRASHREPORTER
- public nsICrashReporter,
- public nsIFinishDumpingCallback,
-#endif
public nsIXULRuntime
{
@@ -660,10 +645,6 @@ public:
NS_DECL_NSIXULAPPINFO
NS_DECL_NSIXULRUNTIME
NS_DECL_NSIOBSERVER
-#ifdef MOZ_CRASHREPORTER
- NS_DECL_NSICRASHREPORTER
- NS_DECL_NSIFINISHDUMPINGCALLBACK
-#endif
#ifdef XP_WIN
NS_DECL_NSIWINAPPHELPER
#endif
@@ -676,10 +657,6 @@ NS_INTERFACE_MAP_BEGIN(nsXULAppInfo)
#ifdef XP_WIN
NS_INTERFACE_MAP_ENTRY(nsIWinAppHelper)
#endif
-#ifdef MOZ_CRASHREPORTER
- NS_INTERFACE_MAP_ENTRY(nsICrashReporter)
- NS_INTERFACE_MAP_ENTRY(nsIFinishDumpingCallback)
-#endif
NS_INTERFACE_MAP_ENTRY(nsIPlatformInfo)
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIXULAppInfo, gAppData ||
XRE_IsContentProcess())
@@ -1004,12 +981,7 @@ nsXULAppInfo::GetReplacedLockTime(PRTime *aReplacedLockTime)
NS_IMETHODIMP
nsXULAppInfo::GetLastRunCrashID(nsAString &aLastRunCrashID)
{
-#ifdef MOZ_CRASHREPORTER
- CrashReporter::GetLastRunCrashID(aLastRunCrashID);
- return NS_OK;
-#else
return NS_ERROR_NOT_IMPLEMENTED;
-#endif
}
NS_IMETHODIMP
@@ -1051,7 +1023,7 @@ nsXULAppInfo::GetDistributionID(nsACString& aResult)
NS_IMETHODIMP
nsXULAppInfo::GetIsOfficial(bool* aResult)
{
-#ifdef MOZILLA_OFFICIAL
+#ifdef MC_OFFICIAL
*aResult = true;
#else
*aResult = false;
@@ -1117,219 +1089,6 @@ nsXULAppInfo::GetUserCanElevate(bool *aUserCanElevate)
}
#endif
-#ifdef MOZ_CRASHREPORTER
-NS_IMETHODIMP
-nsXULAppInfo::GetEnabled(bool *aEnabled)
-{
- *aEnabled = CrashReporter::GetEnabled();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULAppInfo::SetEnabled(bool aEnabled)
-{
- if (aEnabled) {
- if (CrashReporter::GetEnabled()) {
- // no point in erroring for double-enabling
- return NS_OK;
- }
-
- nsCOMPtr<nsIFile> greBinDir;
- NS_GetSpecialDirectory(NS_GRE_BIN_DIR, getter_AddRefs(greBinDir));
- if (!greBinDir) {
- return NS_ERROR_FAILURE;
- }
-
- nsCOMPtr<nsIFile> xreBinDirectory = do_QueryInterface(greBinDir);
- if (!xreBinDirectory) {
- return NS_ERROR_FAILURE;
- }
-
- return CrashReporter::SetExceptionHandler(xreBinDirectory, true);
- }
- else {
- if (!CrashReporter::GetEnabled()) {
- // no point in erroring for double-disabling
- return NS_OK;
- }
-
- return CrashReporter::UnsetExceptionHandler();
- }
-}
-
-NS_IMETHODIMP
-nsXULAppInfo::GetServerURL(nsIURL** aServerURL)
-{
- if (!CrashReporter::GetEnabled())
- return NS_ERROR_NOT_INITIALIZED;
-
- nsAutoCString data;
- if (!CrashReporter::GetServerURL(data)) {
- return NS_ERROR_FAILURE;
- }
- nsCOMPtr<nsIURI> uri;
- NS_NewURI(getter_AddRefs(uri), data);
- if (!uri)
- return NS_ERROR_FAILURE;
-
- nsCOMPtr<nsIURL> url;
- url = do_QueryInterface(uri);
- NS_ADDREF(*aServerURL = url);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULAppInfo::SetServerURL(nsIURL* aServerURL)
-{
- bool schemeOk;
- // only allow https or http URLs
- nsresult rv = aServerURL->SchemeIs("https", &schemeOk);
- NS_ENSURE_SUCCESS(rv, rv);
- if (!schemeOk) {
- rv = aServerURL->SchemeIs("http", &schemeOk);
- NS_ENSURE_SUCCESS(rv, rv);
-
- if (!schemeOk)
- return NS_ERROR_INVALID_ARG;
- }
- nsAutoCString spec;
- rv = aServerURL->GetSpec(spec);
- NS_ENSURE_SUCCESS(rv, rv);
-
- return CrashReporter::SetServerURL(spec);
-}
-
-NS_IMETHODIMP
-nsXULAppInfo::GetMinidumpPath(nsIFile** aMinidumpPath)
-{
- if (!CrashReporter::GetEnabled())
- return NS_ERROR_NOT_INITIALIZED;
-
- nsAutoString path;
- if (!CrashReporter::GetMinidumpPath(path))
- return NS_ERROR_FAILURE;
-
- nsresult rv = NS_NewLocalFile(path, false, aMinidumpPath);
- NS_ENSURE_SUCCESS(rv, rv);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULAppInfo::SetMinidumpPath(nsIFile* aMinidumpPath)
-{
- nsAutoString path;
- nsresult rv = aMinidumpPath->GetPath(path);
- NS_ENSURE_SUCCESS(rv, rv);
- return CrashReporter::SetMinidumpPath(path);
-}
-
-NS_IMETHODIMP
-nsXULAppInfo::AnnotateCrashReport(const nsACString& key,
- const nsACString& data)
-{
- return CrashReporter::AnnotateCrashReport(key, data);
-}
-
-NS_IMETHODIMP
-nsXULAppInfo::AppendAppNotesToCrashReport(const nsACString& data)
-{
- return CrashReporter::AppendAppNotesToCrashReport(data);
-}
-
-NS_IMETHODIMP
-nsXULAppInfo::RegisterAppMemory(uint64_t pointer,
- uint64_t len)
-{
- return CrashReporter::RegisterAppMemory((void *)pointer, len);
-}
-
-NS_IMETHODIMP
-nsXULAppInfo::WriteMinidumpForException(void* aExceptionInfo)
-{
-#ifdef XP_WIN32
- return CrashReporter::WriteMinidumpForException(static_cast<EXCEPTION_POINTERS*>(aExceptionInfo));
-#else
- return NS_ERROR_NOT_IMPLEMENTED;
-#endif
-}
-
-NS_IMETHODIMP
-nsXULAppInfo::AppendObjCExceptionInfoToAppNotes(void* aException)
-{
-#ifdef XP_MACOSX
- return CrashReporter::AppendObjCExceptionInfoToAppNotes(aException);
-#else
- return NS_ERROR_NOT_IMPLEMENTED;
-#endif
-}
-
-NS_IMETHODIMP
-nsXULAppInfo::GetSubmitReports(bool* aEnabled)
-{
- return CrashReporter::GetSubmitReports(aEnabled);
-}
-
-NS_IMETHODIMP
-nsXULAppInfo::SetSubmitReports(bool aEnabled)
-{
- return CrashReporter::SetSubmitReports(aEnabled);
-}
-
-NS_IMETHODIMP
-nsXULAppInfo::UpdateCrashEventsDir()
-{
- CrashReporter::UpdateCrashEventsDir();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULAppInfo::SaveMemoryReport()
-{
- if (!CrashReporter::GetEnabled()) {
- return NS_ERROR_NOT_INITIALIZED;
- }
- nsCOMPtr<nsIFile> file;
- nsresult rv = CrashReporter::GetDefaultMemoryReportFile(getter_AddRefs(file));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- nsString path;
- file->GetPath(path);
-
- nsCOMPtr<nsIMemoryInfoDumper> dumper =
- do_GetService("@mozilla.org/memory-info-dumper;1");
- if (NS_WARN_IF(!dumper)) {
- return NS_ERROR_UNEXPECTED;
- }
-
- rv = dumper->DumpMemoryReportsToNamedFile(path, this, file, true /* anonymize */);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsXULAppInfo::SetTelemetrySessionId(const nsACString& id)
-{
- CrashReporter::SetTelemetrySessionId(id);
- return NS_OK;
-}
-
-// This method is from nsIFInishDumpingCallback.
-NS_IMETHODIMP
-nsXULAppInfo::Callback(nsISupports* aData)
-{
- nsCOMPtr<nsIFile> file = do_QueryInterface(aData);
- MOZ_ASSERT(file);
-
- CrashReporter::SetMemoryReportFile(file);
- return NS_OK;
-}
-#endif
-
static const nsXULAppInfo kAppInfo;
static nsresult AppInfoConstructor(nsISupports* aOuter,
REFNSIID aIID, void **aResult)
@@ -1434,9 +1193,6 @@ static const mozilla::Module::CIDEntry kXRECIDs[] = {
static const mozilla::Module::ContractIDEntry kXREContracts[] = {
{ XULAPPINFO_SERVICE_CONTRACTID, &kAPPINFO_CID },
{ XULRUNTIME_SERVICE_CONTRACTID, &kAPPINFO_CID },
-#ifdef MOZ_CRASHREPORTER
- { NS_CRASHREPORTER_CONTRACTID, &kAPPINFO_CID },
-#endif
{ NS_PROFILESERVICE_CONTRACTID, &kProfileServiceCID },
{ NS_NATIVEAPPSUPPORT_CONTRACTID, &kNativeAppSupportCID },
{ nullptr }
@@ -2763,33 +2519,6 @@ static void RestoreStateForAppInitiatedRestart()
}
}
-#ifdef MOZ_CRASHREPORTER
-// When we first initialize the crash reporter we don't have a profile,
-// so we set the minidump path to $TEMP. Once we have a profile,
-// we set it to $PROFILE/minidumps, creating the directory
-// if needed.
-static void MakeOrSetMinidumpPath(nsIFile* profD)
-{
- nsCOMPtr<nsIFile> dumpD;
- profD->Clone(getter_AddRefs(dumpD));
-
- if (dumpD) {
- bool fileExists;
- //XXX: do some more error checking here
- dumpD->Append(NS_LITERAL_STRING("minidumps"));
- dumpD->Exists(&fileExists);
- if (!fileExists) {
- nsresult rv = dumpD->Create(nsIFile::DIRECTORY_TYPE, 0700);
- NS_ENSURE_SUCCESS_VOID(rv);
- }
-
- nsAutoString pathStr;
- if (NS_SUCCEEDED(dumpD->GetPath(pathStr)))
- CrashReporter::SetMinidumpPath(pathStr);
- }
-}
-#endif
-
const nsXREAppData* gAppData = nullptr;
#ifdef MOZ_WIDGET_GTK
@@ -3215,94 +2944,6 @@ XREMain::XRE_mainInit(bool* aExitFlag)
if (NS_FAILED(rv))
return 1;
-#ifdef MOZ_CRASHREPORTER
- if (EnvHasValue("MOZ_CRASHREPORTER")) {
- mAppData->flags |= NS_XRE_ENABLE_CRASH_REPORTER;
- }
-
- nsCOMPtr<nsIFile> xreBinDirectory;
- xreBinDirectory = mDirProvider.GetGREBinDir();
-
- if ((mAppData->flags & NS_XRE_ENABLE_CRASH_REPORTER) &&
- NS_SUCCEEDED(
- CrashReporter::SetExceptionHandler(xreBinDirectory))) {
- nsCOMPtr<nsIFile> file;
- rv = mDirProvider.GetUserAppDataDirectory(getter_AddRefs(file));
- if (NS_SUCCEEDED(rv)) {
- CrashReporter::SetUserAppDataDirectory(file);
- }
- if (mAppData->crashReporterURL)
- CrashReporter::SetServerURL(nsDependentCString(mAppData->crashReporterURL));
-
- // We overwrite this once we finish starting up.
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("StartupCrash"),
- NS_LITERAL_CSTRING("1"));
-
- // pass some basic info from the app data
- if (mAppData->vendor)
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Vendor"),
- nsDependentCString(mAppData->vendor));
- if (mAppData->name)
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProductName"),
- nsDependentCString(mAppData->name));
- if (mAppData->ID)
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ProductID"),
- nsDependentCString(mAppData->ID));
- if (mAppData->version)
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Version"),
- nsDependentCString(mAppData->version));
- if (mAppData->buildID)
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("BuildID"),
- nsDependentCString(mAppData->buildID));
-
- nsDependentCString releaseChannel(NS_STRINGIFY(MOZ_UPDATE_CHANNEL));
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("ReleaseChannel"),
- releaseChannel);
-#ifdef MOZ_LINKER
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("CrashAddressLikelyWrong"),
- IsSignalHandlingBroken() ? NS_LITERAL_CSTRING("1")
- : NS_LITERAL_CSTRING("0"));
-#endif
-
-#ifdef XP_WIN
- nsAutoString appInitDLLs;
- if (widget::WinUtils::GetAppInitDLLs(appInitDLLs)) {
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AppInitDLLs"),
- NS_ConvertUTF16toUTF8(appInitDLLs));
- }
-#endif
-
- CrashReporter::SetRestartArgs(gArgc, gArgv);
-
- // annotate other data (user id etc)
- nsCOMPtr<nsIFile> userAppDataDir;
- if (NS_SUCCEEDED(mDirProvider.GetUserAppDataDirectory(
- getter_AddRefs(userAppDataDir)))) {
- CrashReporter::SetupExtraData(userAppDataDir,
- nsDependentCString(mAppData->buildID));
-
- // see if we have a crashreporter-override.ini in the application directory
- nsCOMPtr<nsIFile> overrideini;
- bool exists;
- if (NS_SUCCEEDED(mDirProvider.GetAppDir()->Clone(getter_AddRefs(overrideini))) &&
- NS_SUCCEEDED(overrideini->AppendNative(NS_LITERAL_CSTRING("crashreporter-override.ini"))) &&
- NS_SUCCEEDED(overrideini->Exists(&exists)) &&
- exists) {
-#ifdef XP_WIN
- nsAutoString overridePathW;
- overrideini->GetPath(overridePathW);
- NS_ConvertUTF16toUTF8 overridePath(overridePathW);
-#else
- nsAutoCString overridePath;
- overrideini->GetNativePath(overridePath);
-#endif
-
- SaveWordToEnv("MOZ_CRASHREPORTER_STRINGS_OVERRIDE", overridePath);
- }
- }
- }
-#endif
-
#if defined(MOZ_SANDBOX) && defined(XP_WIN)
if (mAppData->sandboxBrokerServices) {
SandboxBroker::Initialize(mAppData->sandboxBrokerServices);
@@ -3448,22 +3089,9 @@ XREMain::XRE_mainInit(bool* aExitFlag)
}
}
-#ifdef MOZ_CRASHREPORTER
- if (cpuUpdateRevision > 0) {
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("CPUMicrocodeVersion"),
- nsPrintfCString("0x%x",
- cpuUpdateRevision));
- }
-#endif
}
#endif
-#ifdef MOZ_CRASHREPORTER
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("SafeMode"),
- gSafeMode ? NS_LITERAL_CSTRING("1") :
- NS_LITERAL_CSTRING("0"));
-#endif
-
// Handle --no-remote and --new-instance command line arguments. Setup
// the environment to better accommodate other components and various
// restart scenarios.
@@ -3523,102 +3151,6 @@ XREMain::XRE_mainInit(bool* aExitFlag)
return 0;
}
-#ifdef MOZ_CRASHREPORTER
-#ifdef XP_WIN
-/**
- * Uses WMI to read some manufacturer information that may be useful for
- * diagnosing hardware-specific crashes. This function is best-effort; failures
- * shouldn't burden the caller. COM must be initialized before calling.
- */
-static void AnnotateSystemManufacturer()
-{
- RefPtr<IWbemLocator> locator;
-
- HRESULT hr = CoCreateInstance(CLSID_WbemLocator, nullptr, CLSCTX_INPROC_SERVER,
- IID_IWbemLocator, getter_AddRefs(locator));
-
- if (FAILED(hr)) {
- return;
- }
-
- RefPtr<IWbemServices> services;
-
- hr = locator->ConnectServer(_bstr_t(L"ROOT\\CIMV2"), nullptr, nullptr, nullptr,
- 0, nullptr, nullptr, getter_AddRefs(services));
-
- if (FAILED(hr)) {
- return;
- }
-
- hr = CoSetProxyBlanket(services, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, nullptr,
- RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE,
- nullptr, EOAC_NONE);
-
- if (FAILED(hr)) {
- return;
- }
-
- RefPtr<IEnumWbemClassObject> enumerator;
-
- hr = services->ExecQuery(_bstr_t(L"WQL"), _bstr_t(L"SELECT * FROM Win32_BIOS"),
- WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
- nullptr, getter_AddRefs(enumerator));
-
- if (FAILED(hr) || !enumerator) {
- return;
- }
-
- RefPtr<IWbemClassObject> classObject;
- ULONG results;
-
- hr = enumerator->Next(WBEM_INFINITE, 1, getter_AddRefs(classObject), &results);
-
- if (FAILED(hr) || results == 0) {
- return;
- }
-
- VARIANT value;
- VariantInit(&value);
-
- hr = classObject->Get(L"Manufacturer", 0, &value, 0, 0);
-
- if (SUCCEEDED(hr) && V_VT(&value) == VT_BSTR) {
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("BIOS_Manufacturer"),
- NS_ConvertUTF16toUTF8(V_BSTR(&value)));
- }
-
- VariantClear(&value);
-}
-
-static void PR_CALLBACK AnnotateSystemManufacturer_ThreadStart(void*)
-{
- HRESULT hr = CoInitialize(nullptr);
-
- if (FAILED(hr)) {
- return;
- }
-
- AnnotateSystemManufacturer();
-
- CoUninitialize();
-}
-#endif // XP_WIN
-
-#if defined(XP_LINUX) && !defined(ANDROID)
-
-static void
-AnnotateLSBRelease(void*)
-{
- nsCString dist, desc, release, codename;
- if (widget::lsb::GetLSBRelease(dist, desc, release, codename)) {
- CrashReporter::AppendAppNotesToCrashReport(desc);
- }
-}
-
-#endif // defined(XP_LINUX) && !defined(ANDROID)
-
-#endif
-
namespace mozilla {
ShutdownChecksMode gShutdownChecks = SCM_NOTHING;
} // namespace mozilla
@@ -4007,13 +3539,6 @@ XREMain::XRE_mainStartup(bool* aExitFlag)
mozilla::Telemetry::SetProfileDir(mProfD);
-#ifdef MOZ_CRASHREPORTER
- if (mAppData->flags & NS_XRE_ENABLE_CRASH_REPORTER)
- MakeOrSetMinidumpPath(mProfD);
-
- CrashReporter::SetProfileDirectory(mProfD);
-#endif
-
nsAutoCString version;
BuildVersion(version);
@@ -4103,39 +3628,6 @@ XREMain::XRE_mainStartup(bool* aExitFlag)
return 0;
}
-#if defined(MOZ_CRASHREPORTER)
-#if defined(MOZ_CONTENT_SANDBOX) && !defined(MOZ_WIDGET_GONK)
-void AddSandboxAnnotations()
-{
- // Include the sandbox content level, regardless of platform
- int level = Preferences::GetInt("security.sandbox.content.level");
-
- nsAutoCString levelString;
- levelString.AppendInt(level);
-
- CrashReporter::AnnotateCrashReport(
- NS_LITERAL_CSTRING("ContentSandboxLevel"), levelString);
-
- // Include whether or not this instance is capable of content sandboxing
- bool sandboxCapable = false;
-
-#if defined(XP_WIN)
- // All supported Windows versions support some level of content sandboxing
- sandboxCapable = true;
-#elif defined(XP_MACOSX)
- // All supported OS X versions are capable
- sandboxCapable = true;
-#elif defined(XP_LINUX)
- sandboxCapable = SandboxInfo::Get().CanSandboxContent();
-#endif
-
- CrashReporter::AnnotateCrashReport(
- NS_LITERAL_CSTRING("ContentSandboxCapable"),
- sandboxCapable ? NS_LITERAL_CSTRING("1") : NS_LITERAL_CSTRING("0"));
-}
-#endif /* MOZ_CONTENT_SANDBOX && !MOZ_WIDGET_GONK */
-#endif /* MOZ_CRASHREPORTER */
-
/*
* XRE_mainRun - Command line startup, profile migration, and
* the calling of appStartup->Run().
@@ -4169,40 +3661,6 @@ XREMain::XRE_mainRun()
rv = mScopedXPCOM->SetWindowCreator(mNativeApp);
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
-#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(nullptr, 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);
- }
- }
- }
- // Needs to be set after xpcom initialization.
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("FramePoisonBase"),
- nsPrintfCString("%.16llx", uint64_t(gMozillaPoisonBase)));
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("FramePoisonSize"),
- nsPrintfCString("%lu", uint32_t(gMozillaPoisonSize)));
-
-#ifdef XP_WIN
- PR_CreateThread(PR_USER_THREAD, AnnotateSystemManufacturer_ThreadStart, 0,
- PR_PRIORITY_LOW, PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0);
-#endif
-
-#if defined(XP_LINUX) && !defined(ANDROID)
- PR_CreateThread(PR_USER_THREAD, AnnotateLSBRelease, 0, PR_PRIORITY_LOW,
- PR_GLOBAL_THREAD, PR_UNJOINABLE_THREAD, 0);
-#endif
-
-#endif
-
if (mStartOffline) {
nsCOMPtr<nsIIOService2> io (do_GetService("@mozilla.org/network/io-service;1"));
NS_ENSURE_TRUE(io, NS_ERROR_FAILURE);
@@ -4308,17 +3766,6 @@ XREMain::XRE_mainRun()
OverrideDefaultLocaleIfNeeded();
-#ifdef MOZ_CRASHREPORTER
- nsCString userAgentLocale;
- // Try a localized string first. This pref is always a localized string in
- // Fennec, and might be elsewhere, too.
- if (NS_SUCCEEDED(Preferences::GetLocalizedCString("general.useragent.locale", &userAgentLocale))) {
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("useragent_locale"), userAgentLocale);
- } else if (NS_SUCCEEDED(Preferences::GetCString("general.useragent.locale", &userAgentLocale))) {
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("useragent_locale"), userAgentLocale);
- }
-#endif
-
appStartup->GetShuttingDown(&mShuttingDown);
nsCOMPtr<nsICommandLineRunner> cmdLine;
@@ -4411,11 +3858,6 @@ XREMain::XRE_mainRun()
(void)appStartup->DoneStartingUp();
-#ifdef MOZ_CRASHREPORTER
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("StartupCrash"),
- NS_LITERAL_CSTRING("0"));
-#endif
-
appStartup->GetShuttingDown(&mShuttingDown);
}
@@ -4466,21 +3908,8 @@ XREMain::XRE_mainRun()
sandboxInfo.Test(SandboxInfo::kEnabledForContent));
Telemetry::Accumulate(Telemetry::SANDBOX_MEDIA_ENABLED,
sandboxInfo.Test(SandboxInfo::kEnabledForMedia));
-#if defined(MOZ_CRASHREPORTER)
- nsAutoCString flagsString;
- flagsString.AppendInt(sandboxInfo.AsInteger());
-
- CrashReporter::AnnotateCrashReport(
- NS_LITERAL_CSTRING("ContentSandboxCapabilities"), flagsString);
-#endif /* MOZ_CRASHREPORTER */
#endif /* MOZ_SANDBOX && XP_LINUX && !MOZ_WIDGET_GONK */
-#if defined(MOZ_CRASHREPORTER)
-#if defined(MOZ_CONTENT_SANDBOX) && !defined(MOZ_WIDGET_GONK)
- AddSandboxAnnotations();
-#endif /* MOZ_CONTENT_SANDBOX && !MOZ_WIDGET_GONK */
-#endif /* MOZ_CRASHREPORTER */
-
{
rv = appStartup->Run();
if (NS_FAILED(rv)) {
@@ -4673,10 +4102,6 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
rv = LaunchChild(mNativeApp, true);
}
-#ifdef MOZ_CRASHREPORTER
- if (mAppData->flags & NS_XRE_ENABLE_CRASH_REPORTER)
- CrashReporter::UnsetExceptionHandler();
-#endif
return rv == NS_ERROR_LAUNCHED_CHILD_PROCESS ? 0 : 1;
}
@@ -4686,11 +4111,6 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
MOZ_gdk_display_close(mGdkDisplay);
#endif
-#ifdef MOZ_CRASHREPORTER
- if (mAppData->flags & NS_XRE_ENABLE_CRASH_REPORTER)
- CrashReporter::UnsetExceptionHandler();
-#endif
-
XRE_DeinitCommandLine();
return NS_FAILED(rv) ? 1 : 0;
@@ -4863,12 +4283,6 @@ MultiprocessBlockPolicy() {
bool addonsCanDisable = Preferences::GetBool("extensions.e10sBlocksEnabling", false);
bool disabledByAddons = Preferences::GetBool("extensions.e10sBlockedByAddons", false);
-#ifdef MOZ_CRASHREPORTER
- CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AddonsShouldHaveBlockedE10s"),
- disabledByAddons ? NS_LITERAL_CSTRING("1")
- : NS_LITERAL_CSTRING("0"));
-#endif
-
if (addonsCanDisable && disabledByAddons) {
gMultiprocessBlockPolicy = kE10sDisabledForAddons;
return gMultiprocessBlockPolicy;
diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp
index 1e67ea7ce..4a612e495 100644
--- a/toolkit/xre/nsEmbedFunctions.cpp
+++ b/toolkit/xre/nsEmbedFunctions.cpp
@@ -239,30 +239,6 @@ XRE_SetProcessType(const char* aProcessTypeString)
}
}
-#if defined(MOZ_CRASHREPORTER)
-// FIXME/bug 539522: this out-of-place function is stuck here because
-// IPDL wants access to this crashreporter interface, and
-// crashreporter is built in such a way to make that awkward
-bool
-XRE_TakeMinidumpForChild(uint32_t aChildPid, nsIFile** aDump,
- uint32_t* aSequence)
-{
- return CrashReporter::TakeMinidumpForChild(aChildPid, aDump, aSequence);
-}
-
-bool
-XRE_SetRemoteExceptionHandler(const char* aPipe/*= 0*/)
-{
-#if defined(XP_WIN) || defined(XP_MACOSX)
- return CrashReporter::SetRemoteExceptionHandler(nsDependentCString(aPipe));
-#elif defined(OS_LINUX)
- return CrashReporter::SetRemoteExceptionHandler();
-#else
-# error "OOP crash reporter unsupported on this platform"
-#endif
-}
-#endif // if defined(MOZ_CRASHREPORTER)
-
#if defined(XP_WIN)
void
SetTaskbarGroupId(const nsString& aId)
@@ -273,22 +249,6 @@ SetTaskbarGroupId(const nsString& aId)
}
#endif
-#if defined(MOZ_CRASHREPORTER)
-#if defined(MOZ_CONTENT_SANDBOX) && !defined(MOZ_WIDGET_GONK)
-void
-AddContentSandboxLevelAnnotation()
-{
- if (XRE_GetProcessType() == GeckoProcessType_Content) {
- int level = Preferences::GetInt("security.sandbox.content.level");
- nsAutoCString levelString;
- levelString.AppendInt(level);
- CrashReporter::AnnotateCrashReport(
- NS_LITERAL_CSTRING("ContentSandboxLevel"), levelString);
- }
-}
-#endif /* MOZ_CONTENT_SANDBOX && !MOZ_WIDGET_GONK */
-#endif /* MOZ_CRASHREPORTER */
-
nsresult
XRE_InitChildProcess(int aArgc,
char* aArgv[],
@@ -442,33 +402,6 @@ XRE_InitChildProcess(int aArgc,
SetupErrorHandling(aArgv[0]);
-#if defined(MOZ_CRASHREPORTER)
- if (aArgc < 1)
- return NS_ERROR_FAILURE;
- const char* const crashReporterArg = aArgv[--aArgc];
-
-# if defined(XP_WIN) || defined(XP_MACOSX)
- // on windows and mac, |crashReporterArg| is the named pipe on which the
- // server is listening for requests, or "-" if crash reporting is
- // disabled.
- if (0 != strcmp("-", crashReporterArg) &&
- !XRE_SetRemoteExceptionHandler(crashReporterArg)) {
- // Bug 684322 will add better visibility into this condition
- NS_WARNING("Could not setup crash reporting\n");
- }
-# elif defined(OS_LINUX)
- // on POSIX, |crashReporterArg| is "true" if crash reporting is
- // enabled, false otherwise
- if (0 != strcmp("false", crashReporterArg) &&
- !XRE_SetRemoteExceptionHandler(nullptr)) {
- // Bug 684322 will add better visibility into this condition
- NS_WARNING("Could not setup crash reporting\n");
- }
-# else
-# error "OOP crash reporting unsupported on this platform"
-# endif
-#endif // if defined(MOZ_CRASHREPORTER)
-
gArgv = aArgv;
gArgc = aArgc;
@@ -647,12 +580,6 @@ XRE_InitChildProcess(int aArgc,
return NS_ERROR_FAILURE;
}
-#ifdef MOZ_CRASHREPORTER
-#if defined(XP_WIN) || defined(XP_MACOSX)
- CrashReporter::InitChildProcessTmpDir();
-#endif
-#endif
-
#if defined(XP_WIN)
// Set child processes up such that they will get killed after the
// chrome process is killed in cases where the user shuts the system
@@ -668,12 +595,6 @@ XRE_InitChildProcess(int aArgc,
OverrideDefaultLocaleIfNeeded();
-#if defined(MOZ_CRASHREPORTER)
-#if defined(MOZ_CONTENT_SANDBOX) && !defined(MOZ_WIDGET_GONK)
- AddContentSandboxLevelAnnotation();
-#endif
-#endif
-
// Run the UI event loop on the main thread.
uiMessageLoop.MessageLoop::Run();
diff --git a/toolkit/xre/nsWindowsWMain.cpp b/toolkit/xre/nsWindowsWMain.cpp
index 788d25a90..e282374cc 100644
--- a/toolkit/xre/nsWindowsWMain.cpp
+++ b/toolkit/xre/nsWindowsWMain.cpp
@@ -18,10 +18,6 @@
#include "nsSetDllDirectory.h"
#endif
-#if defined(__GNUC__)
-#define XRE_DONT_SUPPORT_XPSP2
-#endif
-
#ifdef __MINGW32__
/* MingW currently does not implement a wide version of the
diff --git a/toolkit/xre/nsX11ErrorHandler.cpp b/toolkit/xre/nsX11ErrorHandler.cpp
index 0db24e58b..0fb0d29c5 100644
--- a/toolkit/xre/nsX11ErrorHandler.cpp
+++ b/toolkit/xre/nsX11ErrorHandler.cpp
@@ -117,18 +117,6 @@ X11Error(Display *display, XErrorEvent *event) {
}
}
-#ifdef MOZ_CRASHREPORTER
- switch (XRE_GetProcessType()) {
- case GeckoProcessType_Default:
- case GeckoProcessType_Plugin:
- case GeckoProcessType_Content:
- CrashReporter::AppendAppNotesToCrashReport(notes);
- break;
- default:
- ; // crash report notes not supported.
- }
-#endif
-
#ifdef DEBUG
// The resource id is unlikely to be useful in a crash report without
// context of other ids, but add it to the debug console output.