diff --git a/gfx/gl/GfxTexturesReporter.cpp b/gfx/gl/GfxTexturesReporter.cpp index 8007fe6b130a..5fd8dbfa69ad 100644 --- a/gfx/gl/GfxTexturesReporter.cpp +++ b/gfx/gl/GfxTexturesReporter.cpp @@ -6,13 +6,10 @@ #include #include +#include "nsExceptionHandler.h" #include "GfxTexturesReporter.h" #include "gfxPrefs.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif - using namespace mozilla; using namespace mozilla::gl; @@ -76,7 +73,5 @@ 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 4bf5df38f010..005402383d85 100644 --- a/gfx/ipc/GPUChild.cpp +++ b/gfx/ipc/GPUChild.cpp @@ -144,12 +144,11 @@ GPUChild::RecvGraphicsError(const nsCString& aError) mozilla::ipc::IPCResult GPUChild::RecvInitCrashReporter(Shmem&& aShmem, const NativeThreadId& aThreadId) { -#ifdef MOZ_CRASHREPORTER mCrashReporter = MakeUnique( GeckoProcessType_GPU, aShmem, aThreadId); -#endif + return IPC_OK(); } @@ -252,12 +251,10 @@ 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 7462d3ecb920..cf33371966c0 100644 --- a/gfx/ipc/GPUParent.cpp +++ b/gfx/ipc/GPUParent.cpp @@ -100,10 +100,8 @@ GPUParent::Init(base::ProcessId aParentPid, // versions. GetIPCChannel()->SendBuildID(); -#ifdef MOZ_CRASHREPORTER // Init crash reporter support. CrashReporterClient::InitSingleton(this); -#endif // Ensure gfxPrefs are initialized. gfxPrefs::GetSingleton(); @@ -471,9 +469,7 @@ GPUParent::ActorDestroy(ActorDestroyReason aWhy) gfxVars::Shutdown(); gfxConfig::Shutdown(); gfxPrefs::DestroySingleton(); -#ifdef MOZ_CRASHREPORTER CrashReporterClient::DestroySingleton(); -#endif XRE_ShutdownChildProcess(); } diff --git a/gfx/ipc/GPUProcessManager.cpp b/gfx/ipc/GPUProcessManager.cpp index 2ca67d2f32ea..9a78170d8758 100644 --- a/gfx/ipc/GPUProcessManager.cpp +++ b/gfx/ipc/GPUProcessManager.cpp @@ -39,12 +39,9 @@ #include "mozilla/dom/VideoDecoderManagerChild.h" #include "mozilla/dom/VideoDecoderManagerParent.h" #include "MediaPrefs.h" +#include "nsExceptionHandler.h" #include "nsPrintfCString.h" -#ifdef MOZ_CRASHREPORTER -# include "nsExceptionHandler.h" -#endif - #if defined(MOZ_WIDGET_ANDROID) #include "mozilla/widget/AndroidUiThread.h" #include "mozilla/layers/UiCompositorControllerChild.h" @@ -368,7 +365,6 @@ GPUProcessManager::OnProcessLaunchComplete(GPUProcessHost* aHost) mVsyncBridge = VsyncBridgeChild::Create(mVsyncIOThread, mProcessToken, Move(vsyncChild)); mGPUChild->SendInitVsyncBridge(Move(vsyncParent)); -#ifdef MOZ_CRASHREPORTER CrashReporter::AnnotateCrashReport( NS_LITERAL_CSTRING("GPUProcessStatus"), NS_LITERAL_CSTRING("Running")); @@ -376,7 +372,6 @@ GPUProcessManager::OnProcessLaunchComplete(GPUProcessHost* aHost) CrashReporter::AnnotateCrashReport( NS_LITERAL_CSTRING("GPUProcessLaunchCount"), nsPrintfCString("%d", mNumProcessAttempts)); -#endif } static bool @@ -717,11 +712,9 @@ GPUProcessManager::DestroyProcess() mVsyncBridge = nullptr; } -#ifdef MOZ_CRASHREPORTER CrashReporter::AnnotateCrashReport( NS_LITERAL_CSTRING("GPUProcessStatus"), NS_LITERAL_CSTRING("Destroyed")); -#endif } already_AddRefed diff --git a/gfx/src/DriverCrashGuard.cpp b/gfx/src/DriverCrashGuard.cpp index cb4f6a8a1ebb..6763114a0db2 100644 --- a/gfx/src/DriverCrashGuard.cpp +++ b/gfx/src/DriverCrashGuard.cpp @@ -9,9 +9,7 @@ #include "gfxConfig.h" #include "nsAppDirectoryServiceDefs.h" #include "nsDirectoryServiceUtils.h" -#ifdef MOZ_CRASHREPORTER #include "nsExceptionHandler.h" -#endif #include "nsServiceManagerUtils.h" #include "nsString.h" #include "nsXULAppAPI.h" @@ -167,11 +165,9 @@ DriverCrashGuard::~DriverCrashGuard() 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 @@ -210,7 +206,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. @@ -218,7 +213,6 @@ DriverCrashGuard::ActivateGuard() 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. diff --git a/gfx/src/gfxCrashReporterUtils.cpp b/gfx/src/gfxCrashReporterUtils.cpp index caed5e7fda63..5a95c7e964aa 100644 --- a/gfx/src/gfxCrashReporterUtils.cpp +++ b/gfx/src/gfxCrashReporterUtils.cpp @@ -5,13 +5,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "gfxCrashReporterUtils.h" - -#if defined(MOZ_CRASHREPORTER) -#define MOZ_GFXFEATUREREPORTER 1 -#endif - -#ifdef MOZ_GFXFEATUREREPORTER -#include "gfxCrashReporterUtils.h" #include // for strcmp #include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2 #include "mozilla/Services.h" // for GetObserverService @@ -137,13 +130,3 @@ ScopedGfxFeatureReporter::AppNote(const nsACString& aMessage) } } // end namespace mozilla - -#else - -namespace mozilla { -void ScopedGfxFeatureReporter::WriteAppNote(char) {} -void ScopedGfxFeatureReporter::AppNote(const nsACString&) {} - -} // namespace mozilla - -#endif diff --git a/gfx/tests/gtest/TestGfxPrefs.cpp b/gfx/tests/gtest/TestGfxPrefs.cpp index eb79e8f40266..83b2faeba505 100644 --- a/gfx/tests/gtest/TestGfxPrefs.cpp +++ b/gfx/tests/gtest/TestGfxPrefs.cpp @@ -81,7 +81,6 @@ 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) @@ -104,4 +103,3 @@ TEST(GfxPrefs, StringUtility) // It won't fit into 32: ASSERT_FALSE(SimpleNoCLibDtoA(testVal[4], testBuffer, sizeof(testBuffer)/2)); } -#endif diff --git a/gfx/thebes/DeviceManagerDx.cpp b/gfx/thebes/DeviceManagerDx.cpp index d56bc3626b2f..f9c89eb3cfa6 100644 --- a/gfx/thebes/DeviceManagerDx.cpp +++ b/gfx/thebes/DeviceManagerDx.cpp @@ -21,16 +21,13 @@ #include "mozilla/layers/DeviceAttachmentsD3D11.h" #include "mozilla/layers/MLGDeviceD3D11.h" #include "mozilla/layers/PaintThread.h" +#include "nsExceptionHandler.h" #include "nsIGfxInfo.h" +#include "nsPrintfCString.h" #include "nsString.h" #include #include -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#include "nsPrintfCString.h" -#endif - namespace mozilla { namespace gfx { @@ -772,12 +769,10 @@ DeviceManagerDx::MaybeResetAndReacquireDevices() Telemetry::Accumulate(Telemetry::DEVICE_RESET_REASON, uint32_t(resetReason)); } -#ifdef MOZ_CRASHREPORTER nsPrintfCString reasonString("%d", int(resetReason)); CrashReporter::AnnotateCrashReport( NS_LITERAL_CSTRING("DeviceResetReason"), reasonString); -#endif bool createCompositorDevice = !!mCompositorDevice; bool createContentDevice = !!mContentDevice; diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 50c01bc9f877..cfb514bed8e8 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -70,6 +70,7 @@ #include "gfxGradientCache.h" #include "gfxUtils.h" // for NextPowerOfTwo +#include "nsExceptionHandler.h" #include "nsUnicodeRange.h" #include "nsServiceManagerUtils.h" #include "nsTArray.h" @@ -77,9 +78,6 @@ #include "nsIScreenManager.h" #include "FrameMetrics.h" #include "MainThreadUtils.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif #include "nsWeakReference.h" @@ -298,12 +296,9 @@ void CrashStatsLogForwarder::UpdateCrashReport() message << logAnnotation << Get<0>(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());