From 4e368f8199a61c6319621ad1b9d6c352f0319f41 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Fri, 30 Mar 2018 08:50:58 +0200 Subject: Remove base conditional code for crash reporter and injector. --- xpcom/base/CycleCollectedJSContext.cpp | 26 -------------------------- xpcom/base/nsCrashOnException.cpp | 11 ----------- xpcom/base/nsCycleCollector.cpp | 12 ------------ xpcom/base/nsDebugImpl.cpp | 22 ---------------------- xpcom/base/nsObjCExceptions.h | 15 --------------- 5 files changed, 86 deletions(-) (limited to 'xpcom/base') diff --git a/xpcom/base/CycleCollectedJSContext.cpp b/xpcom/base/CycleCollectedJSContext.cpp index 87e123078..4af8fe4dd 100644 --- a/xpcom/base/CycleCollectedJSContext.cpp +++ b/xpcom/base/CycleCollectedJSContext.cpp @@ -82,10 +82,6 @@ #include "nsJSUtils.h" #include "nsWrapperCache.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif - #include "nsIException.h" #include "nsIPlatformInfo.h" #include "nsThread.h" @@ -539,10 +535,6 @@ CycleCollectedJSContext::Initialize(JSContext* aParentContext, JS_SetSweepZoneCallback(mJSContext, XPCStringConvert::ClearZoneCache); JS::SetBuildIdOp(mJSContext, GetBuildId); JS::SetWarningReporter(mJSContext, MozCrashWarningReporter); -#ifdef MOZ_CRASHREPORTER - js::AutoEnterOOMUnsafeRegion::setAnnotateOOMAllocationSizeCallback( - CrashReporter::AnnotateOOMAllocationSize); -#endif static js::DOMCallbacks DOMcallbacks = { InstanceClassHasProtoAtDepth @@ -1607,16 +1599,6 @@ CycleCollectedJSContext::AnnotateAndSetOutOfMemory(OOMState* aStatePtr, MOZ_ASSERT(mJSContext); *aStatePtr = aNewState; -#ifdef MOZ_CRASHREPORTER - CrashReporter::AnnotateCrashReport(aStatePtr == &mOutOfMemoryState - ? NS_LITERAL_CSTRING("JSOutOfMemory") - : NS_LITERAL_CSTRING("JSLargeAllocationFailure"), - aNewState == OOMState::Reporting - ? NS_LITERAL_CSTRING("Reporting") - : aNewState == OOMState::Reported - ? NS_LITERAL_CSTRING("Reported") - : NS_LITERAL_CSTRING("Recovered")); -#endif } void @@ -1630,14 +1612,6 @@ CycleCollectedJSContext::OnGC(JSGCStatus aStatus) mZonesWaitingForGC.Clear(); break; case JSGC_END: { -#ifdef MOZ_CRASHREPORTER - if (mOutOfMemoryState == OOMState::Reported) { - AnnotateAndSetOutOfMemory(&mOutOfMemoryState, OOMState::Recovered); - } - if (mLargeAllocationFailureState == OOMState::Reported) { - AnnotateAndSetOutOfMemory(&mLargeAllocationFailureState, OOMState::Recovered); - } -#endif // Do any deferred finalization of native objects. FinalizeDeferredThings(JS::WasIncrementalGC(mJSContext) ? FinalizeIncrementally : diff --git a/xpcom/base/nsCrashOnException.cpp b/xpcom/base/nsCrashOnException.cpp index 0f8042531..06c48738f 100644 --- a/xpcom/base/nsCrashOnException.cpp +++ b/xpcom/base/nsCrashOnException.cpp @@ -8,22 +8,11 @@ #include "nsCOMPtr.h" #include "nsServiceManagerUtils.h" -#ifdef MOZ_CRASHREPORTER -#include "nsICrashReporter.h" -#endif - namespace mozilla { static int ReportException(EXCEPTION_POINTERS* aExceptionInfo) { -#ifdef MOZ_CRASHREPORTER - nsCOMPtr cr = - do_GetService("@mozilla.org/toolkit/crash-reporter;1"); - if (cr) { - cr->WriteMinidumpForException(aExceptionInfo); - } -#endif return EXCEPTION_EXECUTE_HANDLER; } diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp index ca7057628..721ae9065 100644 --- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -188,10 +188,6 @@ #include "mozilla/Telemetry.h" #include "mozilla/ThreadLocal.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif - using namespace mozilla; //#define COLLECT_TIME_DEBUG @@ -3150,14 +3146,6 @@ nsCycleCollector::ScanWhiteNodes(bool aFullySynchGraphBuild) } if (pi->mInternalRefs > pi->mRefCount) { -#ifdef MOZ_CRASHREPORTER - const char* piName = "Unknown"; - if (pi->mParticipant) { - piName = pi->mParticipant->ClassName(); - } - nsPrintfCString msg("More references to an object than its refcount, for class %s", piName); - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("CycleCollector"), msg); -#endif MOZ_CRASH(); } diff --git a/xpcom/base/nsDebugImpl.cpp b/xpcom/base/nsDebugImpl.cpp index 36288d203..96487acda 100644 --- a/xpcom/base/nsDebugImpl.cpp +++ b/xpcom/base/nsDebugImpl.cpp @@ -11,9 +11,6 @@ #include "nsDebugImpl.h" #include "nsDebug.h" -#ifdef MOZ_CRASHREPORTER -# include "nsExceptionHandler.h" -#endif #include "nsString.h" #include "nsXULAppAPI.h" #include "prprf.h" @@ -380,22 +377,6 @@ NS_DebugBreak(uint32_t aSeverity, const char* aStr, const char* aExpr, return; case NS_DEBUG_ABORT: { -#if defined(MOZ_CRASHREPORTER) - // Updating crash annotations in the child causes us to do IPC. This can - // really cause trouble if we're asserting from within IPC code. So we - // have to do without the annotations in that case. - if (XRE_IsParentProcess()) { - // Don't include the PID in the crash report annotation to - // allow faceting on crash-stats.mozilla.org. - nsCString note("xpcom_runtime_abort("); - note += nonPIDBuf.buffer; - note += ")"; - CrashReporter::AppendAppNotesToCrashReport(note); - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AbortMessage"), - nsDependentCString(nonPIDBuf.buffer)); - } -#endif // MOZ_CRASHREPORTER - #if defined(DEBUG) && defined(_WIN32) RealBreak(); #endif @@ -600,8 +581,5 @@ NS_ErrorAccordingToNSPR() void NS_ABORT_OOM(size_t aSize) { -#if defined(MOZ_CRASHREPORTER) - CrashReporter::AnnotateOOMAllocationSize(aSize); -#endif MOZ_CRASH("OOM"); } diff --git a/xpcom/base/nsObjCExceptions.h b/xpcom/base/nsObjCExceptions.h index e63c92af5..b3ed532ec 100644 --- a/xpcom/base/nsObjCExceptions.h +++ b/xpcom/base/nsObjCExceptions.h @@ -17,12 +17,6 @@ #import #endif -#if defined(MOZ_CRASHREPORTER) && defined(__cplusplus) -#include "nsICrashReporter.h" -#include "nsCOMPtr.h" -#include "nsServiceManagerUtils.h" -#endif - #include #include #include "nsError.h" @@ -47,15 +41,6 @@ nsObjCExceptionLog(NSException* aException) NSLog(@"Mozilla has caught an Obj-C exception [%@: %@]", [aException name], [aException reason]); -#if defined(MOZ_CRASHREPORTER) && defined(__cplusplus) - // Attach exception info to the crash report. - nsCOMPtr crashReporter = - do_GetService("@mozilla.org/toolkit/crash-reporter;1"); - if (crashReporter) { - crashReporter->AppendObjCExceptionInfoToAppNotes(static_cast(aException)); - } -#endif - #ifdef DEBUG @try { // Try to get stack information out of the exception. 10.5 returns the stack -- cgit v1.2.3