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. --- gfx/gl/GfxTexturesReporter.cpp | 8 -------- gfx/ipc/GPUChild.cpp | 9 --------- gfx/ipc/GPUParent.cpp | 8 -------- gfx/src/DriverCrashGuard.cpp | 19 ------------------- gfx/src/gfxCrashReporterUtils.cpp | 4 ---- gfx/tests/gtest/TestGfxPrefs.cpp | 24 ------------------------ gfx/thebes/gfxPlatform.cpp | 8 -------- 7 files changed, 80 deletions(-) (limited to 'gfx') diff --git a/gfx/gl/GfxTexturesReporter.cpp b/gfx/gl/GfxTexturesReporter.cpp index 8007fe6b1..d2ca70d27 100644 --- a/gfx/gl/GfxTexturesReporter.cpp +++ b/gfx/gl/GfxTexturesReporter.cpp @@ -9,10 +9,6 @@ #include "GfxTexturesReporter.h" #include "gfxPrefs.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif - using namespace mozilla; using namespace mozilla::gl; @@ -75,8 +71,4 @@ GfxTexturesReporter::UpdateAmount(MemoryUse action, size_t amount) } } } - -#ifdef MOZ_CRASHREPORTER - CrashReporter::AnnotateTexturesSize(sAmount); -#endif } diff --git a/gfx/ipc/GPUChild.cpp b/gfx/ipc/GPUChild.cpp index 72328ac0b..3c2797683 100644 --- a/gfx/ipc/GPUChild.cpp +++ b/gfx/ipc/GPUChild.cpp @@ -121,9 +121,6 @@ GPUChild::RecvGraphicsError(const nsCString& aError) bool GPUChild::RecvInitCrashReporter(Shmem&& aShmem) { -#ifdef MOZ_CRASHREPORTER - mCrashReporter = MakeUnique(GeckoProcessType_GPU, aShmem); -#endif return true; } @@ -163,12 +160,6 @@ void GPUChild::ActorDestroy(ActorDestroyReason aWhy) { if (aWhy == AbnormalShutdown) { -#ifdef MOZ_CRASHREPORTER - if (mCrashReporter) { - mCrashReporter->GenerateCrashReport(OtherPid()); - mCrashReporter = nullptr; - } -#endif Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT, nsDependentCString(XRE_ChildProcessTypeToString(GeckoProcessType_GPU), 1)); } diff --git a/gfx/ipc/GPUParent.cpp b/gfx/ipc/GPUParent.cpp index d63e17e2f..896c7b36b 100644 --- a/gfx/ipc/GPUParent.cpp +++ b/gfx/ipc/GPUParent.cpp @@ -82,11 +82,6 @@ GPUParent::Init(base::ProcessId aParentPid, nsDebugImpl::SetMultiprocessMode("GPU"); -#ifdef MOZ_CRASHREPORTER - // Init crash reporter support. - CrashReporterClient::InitSingleton(this); -#endif - // Ensure gfxPrefs are initialized. gfxPrefs::GetSingleton(); gfxConfig::Init(); @@ -380,9 +375,6 @@ GPUParent::ActorDestroy(ActorDestroyReason aWhy) gfxVars::Shutdown(); gfxConfig::Shutdown(); gfxPrefs::DestroySingleton(); -#ifdef MOZ_CRASHREPORTER - CrashReporterClient::DestroySingleton(); -#endif XRE_ShutdownChildProcess(); } diff --git a/gfx/src/DriverCrashGuard.cpp b/gfx/src/DriverCrashGuard.cpp index 36d08dcf3..4754c26ad 100644 --- a/gfx/src/DriverCrashGuard.cpp +++ b/gfx/src/DriverCrashGuard.cpp @@ -7,9 +7,6 @@ #include "gfxPrefs.h" #include "nsAppDirectoryServiceDefs.h" #include "nsDirectoryServiceUtils.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif #include "nsServiceManagerUtils.h" #include "nsString.h" #include "nsXULAppAPI.h" @@ -164,12 +161,6 @@ DriverCrashGuard::~DriverCrashGuard() } else { dom::ContentChild::GetSingleton()->SendEndDriverCrashGuard(uint32_t(mType)); } - -#ifdef MOZ_CRASHREPORTER - // Remove the crash report annotation. - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("GraphicsStartupTest"), - NS_LITERAL_CSTRING("")); -#endif } bool @@ -208,16 +199,6 @@ DriverCrashGuard::ActivateGuard() { mGuardActivated = true; -#ifdef MOZ_CRASHREPORTER - // Anotate crash reports only if we're a real guard. Otherwise, we could - // attribute a random parent process crash to a graphics problem in a child - // process. - if (mMode != Mode::Proxy) { - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("GraphicsStartupTest"), - NS_LITERAL_CSTRING("1")); - } -#endif - // If we're in the content process, the rest of the guarding is handled // in the parent. if (XRE_IsContentProcess()) { diff --git a/gfx/src/gfxCrashReporterUtils.cpp b/gfx/src/gfxCrashReporterUtils.cpp index 42647ccc6..757c15527 100644 --- a/gfx/src/gfxCrashReporterUtils.cpp +++ b/gfx/src/gfxCrashReporterUtils.cpp @@ -5,10 +5,6 @@ #include "gfxCrashReporterUtils.h" -#if defined(MOZ_CRASHREPORTER) -#define MOZ_GFXFEATUREREPORTER 1 -#endif - #ifdef MOZ_GFXFEATUREREPORTER #include "gfxCrashReporterUtils.h" #include // for strcmp diff --git a/gfx/tests/gtest/TestGfxPrefs.cpp b/gfx/tests/gtest/TestGfxPrefs.cpp index 72b698ed6..4e3b6037e 100644 --- a/gfx/tests/gtest/TestGfxPrefs.cpp +++ b/gfx/tests/gtest/TestGfxPrefs.cpp @@ -80,27 +80,3 @@ TEST(GfxPrefs, Set) { ASSERT_TRUE(gfxPrefs::APZMaxVelocity() == -1.0f); } -#ifdef MOZ_CRASHREPORTER -// Randomly test the function we use in nsExceptionHandler.cpp here: -extern bool SimpleNoCLibDtoA(double aValue, char* aBuffer, int aBufferLength); -TEST(GfxPrefs, StringUtility) -{ - char testBuffer[64]; - double testVal[] = {13.4, - 3324243.42, - 0.332424342, - 864.0, - 86400 * 100000000.0 * 10000000000.0 * 10000000000.0 * 100.0, - 86400.0 * 366.0 * 100.0 + 14243.44332}; - for (size_t i=0; i(*it) << "]" << Get<1>(*it) << " (t=" << Get<2>(*it) << ") "; } -#ifdef MOZ_CRASHREPORTER - nsCString reportString(message.str().c_str()); - nsresult annotated = CrashReporter::AnnotateCrashReport(mCrashCriticalKey, reportString); -#else nsresult annotated = NS_ERROR_NOT_IMPLEMENTED; -#endif if (annotated != NS_OK) { printf("Crash Annotation %s: %s", mCrashCriticalKey.get(), message.str().c_str()); -- cgit v1.2.3