From cbb30621ecda466b51a06d7f45215f82f613cf0e Mon Sep 17 00:00:00 2001 From: Gabriele Svelto Date: Thu, 23 Nov 2017 10:59:04 +0100 Subject: [PATCH] Bug 1402519 - Remove MOZ_CRASHREPORTER directives from widget; r=froydnj --HG-- extra : rebase_source : 4472a8d6ce5edf1b5a4665d522a1816020308a43 --- widget/ContentCache.cpp | 52 +++++++++++++++---------------- widget/ContentCache.h | 8 ++--- widget/GfxInfoBase.cpp | 4 --- widget/GfxInfoX11.cpp | 12 +++---- widget/android/GfxInfo.cpp | 8 ++--- widget/android/jni/Utils.cpp | 5 --- widget/android/nsAppShell.cpp | 7 ++--- widget/cocoa/GfxInfo.mm | 8 ++--- widget/cocoa/nsChildView.mm | 15 ++++----- widget/nsBaseAppShell.cpp | 6 ---- widget/windows/GfxInfo.cpp | 11 ++----- widget/windows/KeyboardLayout.cpp | 14 ++------- widget/windows/moz.build | 6 +--- widget/windows/nsAppShell.cpp | 2 -- 14 files changed, 50 insertions(+), 108 deletions(-) diff --git a/widget/ContentCache.cpp b/widget/ContentCache.cpp index 6290e6f5d043..a2938946c675 100644 --- a/widget/ContentCache.cpp +++ b/widget/ContentCache.cpp @@ -15,9 +15,7 @@ #include "mozilla/TextComposition.h" #include "mozilla/TextEvents.h" #include "mozilla/dom/TabParent.h" -#ifdef MOZ_CRASHREPORTER #include "nsExceptionHandler.h" -#endif // #ifdef MOZ_CRASHREPORTER #include "nsIWidget.h" namespace mozilla { @@ -1113,7 +1111,7 @@ ContentCacheInParent::OnCompositionEvent(const WidgetCompositionEvent& aEvent) GetBoolName(mWidgetHasComposition), mPendingCompositionCount, mCommitStringByRequest)); -#if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#if MOZ_DIAGNOSTIC_ASSERT_ENABLED mDispatchedEventMessages.AppendElement(aEvent.mMessage); #endif // #ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED @@ -1193,9 +1191,9 @@ ContentCacheInParent::OnSelectionEvent( GetBoolName(aSelectionEvent.mUseNativeLineBreak), mPendingEventsNeedingAck, GetBoolName(mWidgetHasComposition), mPendingCompositionCount)); -#if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#if MOZ_DIAGNOSTIC_ASSERT_ENABLED mDispatchedEventMessages.AppendElement(aSelectionEvent.mMessage); -#endif // #if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#endif // MOZ_DIAGNOSTIC_ASSERT_ENABLED mPendingEventsNeedingAck++; } @@ -1212,27 +1210,27 @@ ContentCacheInParent::OnEventNeedingAckHandled(nsIWidget* aWidget, "aMessage=%s), mPendingEventsNeedingAck=%u, mPendingCompositionCount=%" PRIu8, this, aWidget, ToChar(aMessage), mPendingEventsNeedingAck, mPendingCompositionCount)); -#if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#if MOZ_DIAGNOSTIC_ASSERT_ENABLED mReceivedEventMessages.AppendElement(aMessage); -#endif // #if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#endif // MOZ_DIAGNOSTIC_ASSERT_ENABLED if (WidgetCompositionEvent::IsFollowedByCompositionEnd(aMessage) || aMessage == eCompositionCommitRequestHandled) { -#if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#if MOZ_DIAGNOSTIC_ASSERT_ENABLED if (mPendingCompositionCount == 1) { RemoveUnnecessaryEventMessageLog(); } -#endif // #if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#endif // #if MOZ_DIAGNOSTIC_ASSERT_ENABLED if (NS_WARN_IF(!mPendingCompositionCount)) { -#if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#if MOZ_DIAGNOSTIC_ASSERT_ENABLED nsPrintfCString info("\nThere is no pending composition but received %s " "message from the remote child\n\n", ToChar(aMessage)); AppendEventMessageLog(info); CrashReporter::AppendAppNotesToCrashReport(info); -#endif // #if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#endif // #if MOZ_DIAGNOSTIC_ASSERT_ENABLED MOZ_DIAGNOSTIC_ASSERT(false, "No pending composition but received unexpected commit event"); mPendingCompositionCount = 1; @@ -1254,13 +1252,13 @@ ContentCacheInParent::OnEventNeedingAckHandled(nsIWidget* aWidget, } if (NS_WARN_IF(!mPendingEventsNeedingAck)) { -#if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#if MOZ_DIAGNOSTIC_ASSERT_ENABLED nsPrintfCString info("\nThere is no pending events but received %s " "message from the remote child\n\n", ToChar(aMessage)); AppendEventMessageLog(info); CrashReporter::AppendAppNotesToCrashReport(info); -#endif // #if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#endif // #if MOZ_DIAGNOSTIC_ASSERT_ENABLED MOZ_DIAGNOSTIC_ASSERT(false, "No pending event message but received unexpected event"); mPendingEventsNeedingAck = 1; @@ -1294,11 +1292,11 @@ ContentCacheInParent::RequestIMEToCommitComposition(nsIWidget* aWidget, // composition events for cleaning up TextComposition and handle the // request as it's handled asynchronously. if (mPendingCompositionCount > 1) { -#if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#if MOZ_DIAGNOSTIC_ASSERT_ENABLED mRequestIMEToCommitCompositionResults. AppendElement(RequestIMEToCommitCompositionResult:: eToOldCompositionReceived); -#endif // #if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#endif // #if MOZ_DIAGNOSTIC_ASSERT_ENABLED return false; } @@ -1308,11 +1306,11 @@ ContentCacheInParent::RequestIMEToCommitComposition(nsIWidget* aWidget, // TextComposition. So, this shouldn't do nothing and TextComposition // should handle the request as it's handled asynchronously. if (mIsPendingLastCommitEvent) { -#if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#if MOZ_DIAGNOSTIC_ASSERT_ENABLED mRequestIMEToCommitCompositionResults. AppendElement(RequestIMEToCommitCompositionResult:: eToCommittedCompositionReceived); -#endif // #if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#endif // #if MOZ_DIAGNOSTIC_ASSERT_ENABLED return false; } @@ -1321,11 +1319,11 @@ ContentCacheInParent::RequestIMEToCommitComposition(nsIWidget* aWidget, if (!IMEStateManager::DoesTabParentHaveIMEFocus(&mTabParent)) { // Use the latest composition string which may not be handled in the // remote process for avoiding data loss. -#if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#if MOZ_DIAGNOSTIC_ASSERT_ENABLED mRequestIMEToCommitCompositionResults. AppendElement(RequestIMEToCommitCompositionResult:: eReceivedAfterTabParentBlur); -#endif // #if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#endif // #if MOZ_DIAGNOSTIC_ASSERT_ENABLED aCommittedString = mCompositionString; // After we return true from here, i.e., without actually requesting IME // to commit composition, we will receive eCompositionCommitRequestHandled @@ -1341,11 +1339,11 @@ ContentCacheInParent::RequestIMEToCommitComposition(nsIWidget* aWidget, MOZ_LOG(sContentCacheLog, LogLevel::Warning, (" 0x%p RequestToCommitComposition(), " "does nothing due to no composition", this)); -#if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#if MOZ_DIAGNOSTIC_ASSERT_ENABLED mRequestIMEToCommitCompositionResults. AppendElement(RequestIMEToCommitCompositionResult:: eReceivedButNoTextComposition); -#endif // #if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#endif // #if MOZ_DIAGNOSTIC_ASSERT_ENABLED return false; } @@ -1376,11 +1374,11 @@ ContentCacheInParent::RequestIMEToCommitComposition(nsIWidget* aWidget, // normally. On the other hand, TextComposition instance in the remote // process won't dispatch following composition events and will be // destroyed by IMEStateManager::DispatchCompositionEvent(). -#if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#if MOZ_DIAGNOSTIC_ASSERT_ENABLED mRequestIMEToCommitCompositionResults. AppendElement(RequestIMEToCommitCompositionResult:: eHandledAsynchronously); -#endif // #if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#endif // #if MOZ_DIAGNOSTIC_ASSERT_ENABLED return false; } @@ -1392,10 +1390,10 @@ ContentCacheInParent::RequestIMEToCommitComposition(nsIWidget* aWidget, // IMEStateManager::DispatchCompositionEvent() at receiving the // eCompositionCommit event (Note that TextComposition instance in this // process was already destroyed). -#if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#if MOZ_DIAGNOSTIC_ASSERT_ENABLED mRequestIMEToCommitCompositionResults. AppendElement(RequestIMEToCommitCompositionResult::eHandledSynchronously); -#endif // #if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#endif // #if MOZ_DIAGNOSTIC_ASSERT_ENABLED return true; } @@ -1492,7 +1490,7 @@ ContentCacheInParent::FlushPendingNotifications(nsIWidget* aWidget) } } -#if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#if MOZ_DIAGNOSTIC_ASSERT_ENABLED void ContentCacheInParent::RemoveUnnecessaryEventMessageLog() @@ -1581,7 +1579,7 @@ ContentCacheInParent::AppendEventMessageLog(nsACString& aLog) const aLog.AppendLiteral("\n"); } -#endif // #if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#endif // #if MOZ_DIAGNOSTIC_ASSERT_ENABLED /***************************************************************************** * mozilla::ContentCache::TextRectArray diff --git a/widget/ContentCache.h b/widget/ContentCache.h index c01f5c63028c..d7a3f2455f96 100644 --- a/widget/ContentCache.h +++ b/widget/ContentCache.h @@ -410,7 +410,7 @@ private: IMENotification mPendingLayoutChange; IMENotification mPendingCompositionUpdate; -#if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#if MOZ_DIAGNOSTIC_ASSERT_ENABLED // Log of event messages to be output to crash report. nsTArray mDispatchedEventMessages; nsTArray mReceivedEventMessages; @@ -450,7 +450,7 @@ private: } nsTArray mRequestIMEToCommitCompositionResults; -#endif // #if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#endif // MOZ_DIAGNOSTIC_ASSERT_ENABLED // mTabParent is owner of the instance. dom::TabParent& MOZ_NON_OWNING_REF mTabParent; @@ -507,7 +507,7 @@ private: void FlushPendingNotifications(nsIWidget* aWidget); -#if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#if MOZ_DIAGNOSTIC_ASSERT_ENABLED /** * Remove unnecessary messages from mDispatchedEventMessages and * mReceivedEventMessages. @@ -518,7 +518,7 @@ private: * Append event message log to aLog. */ void AppendEventMessageLog(nsACString& aLog) const; -#endif // #if defined(MOZ_CRASHREPORTER) && MOZ_DIAGNOSTIC_ASSERT_ENABLED +#endif // #if MOZ_DIAGNOSTIC_ASSERT_ENABLED }; } // namespace mozilla diff --git a/widget/GfxInfoBase.cpp b/widget/GfxInfoBase.cpp index fd28fc69a6bf..d8031d3813ec 100644 --- a/widget/GfxInfoBase.cpp +++ b/widget/GfxInfoBase.cpp @@ -38,10 +38,6 @@ #include "gfxConfig.h" #include "DriverCrashGuard.h" -#if defined(MOZ_CRASHREPORTER) -#include "nsExceptionHandler.h" -#endif - using namespace mozilla::widget; using namespace mozilla; using mozilla::MutexAutoLock; diff --git a/widget/GfxInfoX11.cpp b/widget/GfxInfoX11.cpp index 8bb54a99136f..94083648cb61 100644 --- a/widget/GfxInfoX11.cpp +++ b/widget/GfxInfoX11.cpp @@ -11,14 +11,12 @@ #include #include #include "nsCRTGlue.h" +#include "nsExceptionHandler.h" +#include "nsICrashReporter.h" #include "prenv.h" #include "GfxInfoX11.h" -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#include "nsICrashReporter.h" -#endif namespace mozilla { namespace widget { @@ -176,9 +174,8 @@ GfxInfo::GetData() mAdapterDescription.Append(nsDependentCString(buf)); mAdapterDescription.Append('\n'); } -#ifdef MOZ_CRASHREPORTER + CrashReporter::AppendAppNotesToCrashReport(mAdapterDescription); -#endif return; } @@ -194,9 +191,8 @@ GfxInfo::GetData() if (mHasTextureFromPixmap) note.AppendLiteral(" -- texture_from_pixmap"); note.Append('\n'); -#ifdef MOZ_CRASHREPORTER + CrashReporter::AppendAppNotesToCrashReport(note); -#endif // determine the major OpenGL version. That's the first integer in the version string. mGLMajorVersion = strtol(mVersion.get(), 0, 10); diff --git a/widget/android/GfxInfo.cpp b/widget/android/GfxInfo.cpp index 846e0625e366..13d097e380c1 100644 --- a/widget/android/GfxInfo.cpp +++ b/widget/android/GfxInfo.cpp @@ -8,17 +8,15 @@ #include "GLContextProvider.h" #include "nsUnicharUtils.h" #include "prenv.h" +#include "nsExceptionHandler.h" #include "nsHashKeys.h" +#include "nsICrashReporter.h" #include "nsVersionComparator.h" #include "AndroidBridge.h" #include "nsIWindowWatcher.h" #include "nsServiceManagerUtils.h" -#if defined(MOZ_CRASHREPORTER) -#include "nsExceptionHandler.h" -#include "nsICrashReporter.h" #define NS_CRASHREPORTER_CONTRACTID "@mozilla.org/toolkit/crash-reporter;1" -#endif namespace mozilla { namespace widget { @@ -350,7 +348,6 @@ GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active) void GfxInfo::AddCrashReportAnnotations() { -#if defined(MOZ_CRASHREPORTER) CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterVendorID"), mGLStrings->Vendor()); CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDeviceID"), @@ -364,7 +361,6 @@ GfxInfo::AddCrashReportAnnotations() note.AppendPrintf("AdapterDescription: '%s'\n", mAdapterDescription.get()); CrashReporter::AppendAppNotesToCrashReport(note); -#endif } const nsTArray& diff --git a/widget/android/jni/Utils.cpp b/widget/android/jni/Utils.cpp index 73d739f48af8..a928814bd8a1 100644 --- a/widget/android/jni/Utils.cpp +++ b/widget/android/jni/Utils.cpp @@ -9,10 +9,7 @@ #include "GeneratedJNIWrappers.h" #include "AndroidBuild.h" #include "nsAppShell.h" - -#ifdef MOZ_CRASHREPORTER #include "nsExceptionHandler.h" -#endif namespace mozilla { namespace jni { @@ -206,7 +203,6 @@ bool ReportException(JNIEnv* aEnv, jthrowable aExc, jstring aStack) { bool result = true; -#ifdef MOZ_CRASHREPORTER result &= NS_SUCCEEDED(CrashReporter::AnnotateCrashReport( NS_LITERAL_CSTRING("JavaStackTrace"), String::Ref::From(aStack)->ToCString())); @@ -219,7 +215,6 @@ bool ReportException(JNIEnv* aEnv, jthrowable aExc, jstring aStack) CrashReporter::AppendAppNotesToCrashReport(NS_LITERAL_CSTRING("\n") + appNotes->ToCString()); } -#endif // MOZ_CRASHREPORTER if (sOOMErrorClass && aEnv->IsInstanceOf(aExc, sOOMErrorClass)) { NS_ABORT_OOM(0); // Unknown OOM size diff --git a/widget/android/nsAppShell.cpp b/widget/android/nsAppShell.cpp index 729b4f11e309..a176794bf8f4 100644 --- a/widget/android/nsAppShell.cpp +++ b/widget/android/nsAppShell.cpp @@ -9,11 +9,13 @@ #include "base/message_loop.h" #include "base/task.h" #include "mozilla/Hal.h" +#include "nsExceptionHandler.h" #include "nsIScreen.h" #include "nsIScreenManager.h" #include "nsWindow.h" #include "nsThreadUtils.h" #include "nsICommandLineRunner.h" +#include "nsICrashReporter.h" #include "nsIObserverService.h" #include "nsIAppStartup.h" #include "nsIGeolocationProvider.h" @@ -58,11 +60,6 @@ #include "mozilla/Logging.h" #endif -#ifdef MOZ_CRASHREPORTER -#include "nsICrashReporter.h" -#include "nsExceptionHandler.h" -#endif - #include "AndroidAlerts.h" #include "AndroidUiThread.h" #include "ANRReporter.h" diff --git a/widget/cocoa/GfxInfo.mm b/widget/cocoa/GfxInfo.mm index aceba29ffd16..fd73d8bcec5c 100644 --- a/widget/cocoa/GfxInfo.mm +++ b/widget/cocoa/GfxInfo.mm @@ -10,7 +10,9 @@ #include "GfxInfo.h" #include "nsUnicharUtils.h" +#include "nsExceptionHandler.h" #include "nsCocoaFeatures.h" +#include "nsICrashReporter.h" #include "mozilla/Preferences.h" #include @@ -18,11 +20,7 @@ #import #import -#if defined(MOZ_CRASHREPORTER) -#include "nsExceptionHandler.h" -#include "nsICrashReporter.h" #define NS_CRASHREPORTER_CONTRACTID "@mozilla.org/toolkit/crash-reporter;1" -#endif using namespace mozilla; using namespace mozilla::widget; @@ -275,7 +273,6 @@ GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active) void GfxInfo::AddCrashReportAnnotations() { -#if defined(MOZ_CRASHREPORTER) nsString deviceID, vendorID, driverVersion; nsAutoCString narrowDeviceID, narrowVendorID, narrowDriverVersion; @@ -301,7 +298,6 @@ GfxInfo::AddCrashReportAnnotations() note.AppendLiteral(", AdapterDeviceID: "); note.Append(narrowDeviceID); CrashReporter::AppendAppNotesToCrashReport(note); -#endif } // We don't support checking driver versions on Mac. diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index bf42b4f8c095..d051dae44601 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -19,6 +19,7 @@ #include "mozilla/TouchEvents.h" #include "nsArrayUtils.h" +#include "nsExceptionHandler.h" #include "nsObjCExceptions.h" #include "nsCOMPtr.h" #include "nsThreadUtils.h" @@ -83,9 +84,6 @@ #include "nsAccessibilityService.h" #include "mozilla/a11y/Platform.h" #endif -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif #include "mozilla/Preferences.h" @@ -5519,31 +5517,30 @@ GetIntegerDeltaForEvent(NSEvent* aEvent) #if !defined(RELEASE_OR_BETA) || defined(DEBUG) if (!Preferences::GetBool("intl.allow-insecure-text-input", false) && mGeckoChild && mTextInputHandler && mTextInputHandler->IsFocused()) { -#ifdef MOZ_CRASHREPORTER NSWindow* window = [self window]; NSString* info = [NSString stringWithFormat:@"\nview [%@], window [%@], window is key %i, is fullscreen %i, app is active %i", self, window, [window isKeyWindow], ([window styleMask] & (1 << 14)) != 0, [NSApp isActive]]; nsAutoCString additionalInfo([info UTF8String]); -#endif + if (mGeckoChild->GetInputContext().IsPasswordEditor() && !TextInputHandler::IsSecureEventInputEnabled()) { #define CRASH_MESSAGE "A password editor has focus, but not in secure input mode" -#ifdef MOZ_CRASHREPORTER + CrashReporter::AppendAppNotesToCrashReport(NS_LITERAL_CSTRING("\nBug 893973: ") + NS_LITERAL_CSTRING(CRASH_MESSAGE)); CrashReporter::AppendAppNotesToCrashReport(additionalInfo); -#endif + MOZ_CRASH(CRASH_MESSAGE); #undef CRASH_MESSAGE } else if (!mGeckoChild->GetInputContext().IsPasswordEditor() && TextInputHandler::IsSecureEventInputEnabled()) { #define CRASH_MESSAGE "A non-password editor has focus, but in secure input mode" -#ifdef MOZ_CRASHREPORTER + CrashReporter::AppendAppNotesToCrashReport(NS_LITERAL_CSTRING("\nBug 893973: ") + NS_LITERAL_CSTRING(CRASH_MESSAGE)); CrashReporter::AppendAppNotesToCrashReport(additionalInfo); -#endif + MOZ_CRASH(CRASH_MESSAGE); #undef CRASH_MESSAGE } diff --git a/widget/nsBaseAppShell.cpp b/widget/nsBaseAppShell.cpp index 40915acecace..6be0d37a4461 100644 --- a/widget/nsBaseAppShell.cpp +++ b/widget/nsBaseAppShell.cpp @@ -6,9 +6,7 @@ #include "base/message_loop.h" #include "nsBaseAppShell.h" -#if defined(MOZ_CRASHREPORTER) #include "nsExceptionHandler.h" -#endif #include "nsThreadUtils.h" #include "nsIObserverService.h" #include "nsServiceManagerUtils.h" @@ -320,18 +318,14 @@ void nsBaseAppShell::IncrementEventloopNestingLevel() { ++mEventloopNestingLevel; -#if defined(MOZ_CRASHREPORTER) CrashReporter::SetEventloopNestingLevel(mEventloopNestingLevel); -#endif } void nsBaseAppShell::DecrementEventloopNestingLevel() { --mEventloopNestingLevel; -#if defined(MOZ_CRASHREPORTER) CrashReporter::SetEventloopNestingLevel(mEventloopNestingLevel); -#endif } // Called from the main thread diff --git a/widget/windows/GfxInfo.cpp b/widget/windows/GfxInfo.cpp index 9548b6ea56b1..f71b324a0495 100644 --- a/widget/windows/GfxInfo.cpp +++ b/widget/windows/GfxInfo.cpp @@ -18,15 +18,13 @@ #include "mozilla/Preferences.h" #include "mozilla/gfx/DeviceManagerDx.h" #include "mozilla/gfx/Logging.h" +#include "nsExceptionHandler.h" +#include "nsICrashReporter.h" #include "nsPrintfCString.h" #include "jsapi.h" #include -#if defined(MOZ_CRASHREPORTER) -#include "nsExceptionHandler.h" -#include "nsICrashReporter.h" #define NS_CRASHREPORTER_CONTRACTID "@mozilla.org/toolkit/crash-reporter;1" -#endif using namespace mozilla; using namespace mozilla::gfx; @@ -854,7 +852,6 @@ GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active) return NS_OK; } -#if defined(MOZ_CRASHREPORTER) /* Cisco's VPN software can cause corruption of the floating point state. * Make a note of this in our crash reports so that some weird crashes * make more sense */ @@ -869,12 +866,10 @@ CheckForCiscoVPN() { CrashReporter::AppendAppNotesToCrashReport(NS_LITERAL_CSTRING("Cisco VPN\n")); } } -#endif void GfxInfo::AddCrashReportAnnotations() { -#if defined(MOZ_CRASHREPORTER) CheckForCiscoVPN(); if (mHasDriverVersionMismatch) { @@ -954,8 +949,6 @@ GfxInfo::AddCrashReportAnnotations() note.Append(NS_LossyConvertUTF16toASCII(adapterDriverVersionString2)); } CrashReporter::AppendAppNotesToCrashReport(note); - -#endif } static OperatingSystem diff --git a/widget/windows/KeyboardLayout.cpp b/widget/windows/KeyboardLayout.cpp index 50e2cb837aa4..e29c0b0655d9 100644 --- a/widget/windows/KeyboardLayout.cpp +++ b/widget/windows/KeyboardLayout.cpp @@ -12,9 +12,7 @@ #include "mozilla/TextEvents.h" #include "nsAlgorithm.h" -#ifdef MOZ_CRASHREPORTER #include "nsExceptionHandler.h" -#endif #include "nsGkAtoms.h" #include "nsIIdleServiceInternal.h" #include "nsIWindowsRegKey.h" @@ -2696,8 +2694,6 @@ NativeKey::NeedsToHandleWithoutFollowingCharMessages() const return mIsPrintableKey; } -#ifdef MOZ_CRASHREPORTER - static nsCString GetResultOfInSendMessageEx() { @@ -2730,8 +2726,6 @@ GetResultOfInSendMessageEx() return result; } -#endif // #ifdef MOZ_CRASHREPORTER - bool NativeKey::MayBeSameCharMessage(const MSG& aCharMsg1, const MSG& aCharMsg2) const @@ -2975,7 +2969,6 @@ NativeKey::GetFollowingCharMessage(MSG& aCharMsg) } if (doCrash) { -#ifdef MOZ_CRASHREPORTER nsPrintfCString info("\nPeekMessage() failed to remove char message! " "\nActive keyboard layout=0x%08X (%s), " "\nHandling message: %s, InSendMessageEx()=%s, " @@ -3001,7 +2994,7 @@ NativeKey::GetFollowingCharMessage(MSG& aCharMsg) CrashReporter::AppendAppNotesToCrashReport( NS_LITERAL_CSTRING("\nThere is no message in any window")); } -#endif // #ifdef MOZ_CRASHREPORTER + MOZ_CRASH("We lost the following char message"); } @@ -3120,7 +3113,6 @@ NativeKey::GetFollowingCharMessage(MSG& aCharMsg) "nextKeyMsg=%s, kFoundCharMsg=%s", this, ToString(removedMsg).get(), ToString(nextKeyMsg).get(), ToString(kFoundCharMsg).get())); -#ifdef MOZ_CRASHREPORTER nsPrintfCString info("\nPeekMessage() removed unexpcted char message! " "\nActive keyboard layout=0x%08X (%s), " "\nHandling message: %s, InSendMessageEx()=%s, " @@ -3158,14 +3150,13 @@ NativeKey::GetFollowingCharMessage(MSG& aCharMsg) CrashReporter::AppendAppNotesToCrashReport( NS_LITERAL_CSTRING("\nThere is no key message in any windows.")); } -#endif // #ifdef MOZ_CRASHREPORTER + MOZ_CRASH("PeekMessage() removed unexpected message"); } MOZ_LOG(sNativeKeyLogger, LogLevel::Error, ("%p NativeKey::GetFollowingCharMessage(), FAILED, removed messages " "are all WM_NULL, nextKeyMsg=%s", this, ToString(nextKeyMsg).get())); -#ifdef MOZ_CRASHREPORTER nsPrintfCString info("\nWe lost following char message! " "\nActive keyboard layout=0x%08X (%s), " "\nHandling message: %s, InSendMessageEx()=%s, \n" @@ -3176,7 +3167,6 @@ NativeKey::GetFollowingCharMessage(MSG& aCharMsg) GetResultOfInSendMessageEx().get(), ToString(kFoundCharMsg).get()); CrashReporter::AppendAppNotesToCrashReport(info); -#endif // #ifdef MOZ_CRASHREPORTER MOZ_CRASH("We lost the following char message"); return false; } diff --git a/widget/windows/moz.build b/widget/windows/moz.build index 8215ca5efd7f..66806a8fa0a6 100644 --- a/widget/windows/moz.build +++ b/widget/windows/moz.build @@ -42,6 +42,7 @@ UNIFIED_SOURCES += [ 'InProcessWinCompositorWidget.cpp', 'JumpListItem.cpp', 'KeyboardLayout.cpp', + 'LSPAnnotator.cpp', 'nsAppShell.cpp', 'nsClipboard.cpp', 'nsColorPicker.cpp', @@ -87,11 +88,6 @@ SOURCES += [ 'WinMouseScrollHandler.cpp', ] -if CONFIG['MOZ_CRASHREPORTER']: - UNIFIED_SOURCES += [ - 'LSPAnnotator.cpp', - ] - if CONFIG['NS_PRINTING']: UNIFIED_SOURCES += [ 'nsDeviceContextSpecWin.cpp', diff --git a/widget/windows/nsAppShell.cpp b/widget/windows/nsAppShell.cpp index 4ea292d959b4..f3d5b16e6c40 100644 --- a/widget/windows/nsAppShell.cpp +++ b/widget/windows/nsAppShell.cpp @@ -164,9 +164,7 @@ nsAppShell::~nsAppShell() nsresult nsAppShell::Init() { -#ifdef MOZ_CRASHREPORTER LSPAnnotate(); -#endif mLastNativeEventScheduled = TimeStamp::NowLoRes();