Bug 1402519 - Remove MOZ_CRASHREPORTER directives from xpcom; r=froydnj

MozReview-Commit-ID: HS3M0DJQ3qc
This commit is contained in:
Gabriele Svelto
2017-10-10 11:59:39 +02:00
parent e8381601dc
commit 53bb53d5a2
15 changed files with 20 additions and 86 deletions

View File

@@ -81,6 +81,7 @@
#include "nsCycleCollectionParticipant.h"
#include "nsCycleCollector.h"
#include "nsDOMJSUtils.h"
#include "nsExceptionHandler.h"
#include "nsJSUtils.h"
#include "nsWrapperCache.h"
#include "nsStringBuffer.h"
@@ -90,10 +91,6 @@
#include "ProfilerMarkerPayload.h"
#endif
#ifdef MOZ_CRASHREPORTER
#include "nsExceptionHandler.h"
#endif
#include "nsIException.h"
#include "nsIPlatformInfo.h"
#include "nsThread.h"
@@ -545,10 +542,9 @@ CycleCollectedJSRuntime::CycleCollectedJSRuntime(JSContext* aCx)
JS_SetExternalStringSizeofCallback(aCx, SizeofExternalStringCallback);
JS::SetBuildIdOp(aCx, GetBuildId);
JS::SetWarningReporter(aCx, MozCrashWarningReporter);
#ifdef MOZ_CRASHREPORTER
js::AutoEnterOOMUnsafeRegion::setAnnotateOOMAllocationSizeCallback(
CrashReporter::AnnotateOOMAllocationSize);
#endif
js::AutoEnterOOMUnsafeRegion::setAnnotateOOMAllocationSizeCallback(
CrashReporter::AnnotateOOMAllocationSize);
static js::DOMCallbacks DOMcallbacks = {
InstanceClassHasProtoAtDepth
@@ -1447,7 +1443,6 @@ CycleCollectedJSRuntime::AnnotateAndSetOutOfMemory(OOMState* aStatePtr,
OOMState aNewState)
{
*aStatePtr = aNewState;
#ifdef MOZ_CRASHREPORTER
CrashReporter::AnnotateCrashReport(aStatePtr == &mOutOfMemoryState
? NS_LITERAL_CSTRING("JSOutOfMemory")
: NS_LITERAL_CSTRING("JSLargeAllocationFailure"),
@@ -1456,7 +1451,6 @@ CycleCollectedJSRuntime::AnnotateAndSetOutOfMemory(OOMState* aStatePtr,
: aNewState == OOMState::Reported
? NS_LITERAL_CSTRING("Reported")
: NS_LITERAL_CSTRING("Recovered"));
#endif
}
void
@@ -1469,14 +1463,12 @@ CycleCollectedJSRuntime::OnGC(JSContext* aContext,
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. Normally we do this
// incrementally for an incremental GC, and immediately for a