Bug 1162293 - Part 1: Remove instances of #ifdef PR_LOGGING. r=froydnj
authorEric Rahm <erahm@mozilla.com>
Thu, 07 May 2015 09:43:38 -0700
changeset 274203 830ce4e36b476c7731c0d9d801eb40c89ab521c8
parent 274202 d7ae6f7c3e20bcc6ec15de62103c5d7a9a540b3f
child 274204 93eded78def993603fd6b78f6a324e8b5c8273e2
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1162293
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1162293 - Part 1: Remove instances of #ifdef PR_LOGGING. r=froydnj PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
widget/android/nsAppShell.cpp
widget/cocoa/NativeKeyBindings.mm
widget/cocoa/TextInputHandler.mm
widget/cocoa/nsChildView.mm
widget/cocoa/nsClipboard.mm
widget/cocoa/nsDragService.mm
widget/gtk/nsAppShell.cpp
widget/gtk/nsDeviceContextSpecG.cpp
widget/gtk/nsGtkIMModule.cpp
widget/gtk/nsGtkIMModule.h
widget/gtk/nsGtkKeyUtils.cpp
widget/gtk/nsGtkKeyUtils.h
widget/gtk/nsIdleServiceGTK.cpp
widget/nsIdleService.cpp
widget/qt/nsAppShell.cpp
widget/qt/nsDeviceContextSpecQt.cpp
widget/windows/KeyboardLayout.cpp
widget/windows/WinMouseScrollHandler.cpp
widget/windows/WinMouseScrollHandler.h
widget/windows/WinUtils.cpp
widget/windows/nsClipboard.cpp
widget/windows/nsDeviceContextSpecWin.cpp
widget/windows/nsIMM32Handler.cpp
widget/windows/nsNativeThemeWin.cpp
widget/windows/nsSound.cpp
widget/windows/nsTextStore.cpp
widget/windows/nsWinGesture.cpp
widget/windows/nsWindow.cpp
widget/windows/nsWindowDbg.cpp
--- a/widget/android/nsAppShell.cpp
+++ b/widget/android/nsAppShell.cpp
@@ -58,19 +58,17 @@
 #ifdef DEBUG_ANDROID_EVENTS
 #define EVLOG(args...)  ALOG(args)
 #else
 #define EVLOG(args...) do { } while (0)
 #endif
 
 using namespace mozilla;
 
-#ifdef PR_LOGGING
 PRLogModuleInfo *gWidgetLog = nullptr;
-#endif
 
 nsIGeolocationUpdate *gLocationCallback = nullptr;
 nsAutoPtr<mozilla::AndroidGeckoEvent> gLastSizeChange;
 
 nsAppShell *nsAppShell::gAppShell = nullptr;
 
 NS_IMPL_ISUPPORTS_INHERITED(nsAppShell, nsBaseAppShell, nsIObserver)
 
@@ -172,20 +170,18 @@ nsAppShell::NotifyNativeEvent()
 static const char* kObservedPrefs[] = {
   PREFNAME_COALESCE_TOUCHES,
   nullptr
 };
 
 nsresult
 nsAppShell::Init()
 {
-#ifdef PR_LOGGING
     if (!gWidgetLog)
         gWidgetLog = PR_NewLogModule("Widget");
-#endif
 
     nsresult rv = nsBaseAppShell::Init();
     nsCOMPtr<nsIObserverService> obsServ =
         mozilla::services::GetObserverService();
     if (obsServ) {
         obsServ->AddObserver(this, "xpcom-shutdown", false);
         obsServ->AddObserver(this, "browser-delayed-startup-finished", false);
     }
--- a/widget/cocoa/NativeKeyBindings.mm
+++ b/widget/cocoa/NativeKeyBindings.mm
@@ -8,19 +8,17 @@
 #include "nsTArray.h"
 #include "nsCocoaUtils.h"
 #include "prlog.h"
 #include "mozilla/TextEvents.h"
 
 namespace mozilla {
 namespace widget {
 
-#ifdef PR_LOGGING
 PRLogModuleInfo* gNativeKeyBindingsLog = nullptr;
-#endif
 
 NativeKeyBindings* NativeKeyBindings::sInstanceForSingleLineEditor = nullptr;
 NativeKeyBindings* NativeKeyBindings::sInstanceForMultiLineEditor = nullptr;
 
 // static
 NativeKeyBindings*
 NativeKeyBindings::GetInstance(NativeKeyBindingsType aType)
 {
@@ -60,21 +58,19 @@ NativeKeyBindings::NativeKeyBindings()
 
 #define SEL_TO_COMMAND(aSel, aCommand) \
   mSelectorToCommand.Put( \
     reinterpret_cast<struct objc_selector *>(@selector(aSel)), aCommand)
 
 void
 NativeKeyBindings::Init(NativeKeyBindingsType aType)
 {
-#ifdef PR_LOGGING
   if (!gNativeKeyBindingsLog) {
     gNativeKeyBindingsLog = PR_NewLogModule("NativeKeyBindings");
   }
-#endif
 
   PR_LOG(gNativeKeyBindingsLog, PR_LOG_ALWAYS,
     ("%p NativeKeyBindings::Init", this));
 
   // Many selectors have a one-to-one mapping to a Gecko command. Those mappings
   // are registered in mSelectorToCommand.
 
   // Selectors from NSResponder's "Responding to Action Messages" section and
@@ -232,27 +228,25 @@ NativeKeyBindings::Execute(const WidgetK
     ("%p NativeKeyBindings::KeyPress, bindingCommands=%u",
      this, bindingCommands.Length()));
 
   nsAutoTArray<Command, 4> geckoCommands;
 
   for (uint32_t i = 0; i < bindingCommands.Length(); i++) {
     SEL selector = bindingCommands[i].selector;
 
-#ifdef PR_LOGGING
     if (PR_LOG_TEST(gNativeKeyBindingsLog, PR_LOG_ALWAYS)) {
       NSString* selectorString = NSStringFromSelector(selector);
       nsAutoString nsSelectorString;
       nsCocoaUtils::GetStringForNSString(selectorString, nsSelectorString);
 
       PR_LOG(gNativeKeyBindingsLog, PR_LOG_ALWAYS,
         ("%p NativeKeyBindings::KeyPress, selector=%s",
          this, ToNewCString(nsSelectorString)));
     }
-#endif
 
     // Try to find a simple mapping in the hashtable
     Command geckoCommand = static_cast<Command>(mSelectorToCommand.Get(
       reinterpret_cast<struct objc_selector*>(selector)));
 
     if (geckoCommand) {
       geckoCommands.AppendElement(geckoCommand);
     } else if (selector == @selector(selectLine:)) {
--- a/widget/cocoa/TextInputHandler.mm
+++ b/widget/cocoa/TextInputHandler.mm
@@ -23,18 +23,16 @@
 #include "nsPrintfCString.h"
 #include "mozilla/unused.h"
 #include "mozilla/dom/ContentParent.h"
 #include "ComplexTextInputPanel.h"
 
 using namespace mozilla;
 using namespace mozilla::widget;
 
-#ifdef PR_LOGGING
-
 PRLogModuleInfo* gLog = nullptr;
 
 static const char*
 OnOrOff(bool aBool)
 {
   return aBool ? "ON" : "off";
 }
 
@@ -300,38 +298,34 @@ GetWindowLevelName(NSInteger aWindowLeve
       return "kCGCursorWindowLevelKey";
     case kCGNumberOfWindowLevelKeys:
       return "kCGNumberOfWindowLevelKeys";
     default:
       return "unknown window level";
   }
 }
 
-#endif // #ifdef PR_LOGGING
-
 static bool
 IsControlChar(uint32_t aCharCode)
 {
   return aCharCode < ' ' || aCharCode == 0x7F;
 }
 
 static uint32_t gHandlerInstanceCount = 0;
 static TISInputSourceWrapper gCurrentInputSource;
 
 static void
 InitLogModule()
 {
-#ifdef PR_LOGGING
   // Clear() is always called when TISInputSourceWrappper is created.
   if (!gLog) {
     gLog = PR_NewLogModule("TextInputHandlerWidgets");
     TextInputHandler::DebugPrintAllKeyboardLayouts();
     IMEInputHandler::DebugPrintAllIMEModes();
   }
-#endif
 }
 
 static void
 InitCurrentInputSource()
 {
   if (gHandlerInstanceCount > 0 &&
       !gCurrentInputSource.IsInitializedByCurrentInputSource()) {
     gCurrentInputSource.InitByCurrentInputSource();
@@ -1042,32 +1036,30 @@ TISInputSourceWrapper::InitKeyPressEvent
                                          WidgetKeyboardEvent& aKeyEvent,
                                          UInt32 aKbType)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   NS_ASSERTION(aKeyEvent.message == NS_KEY_PRESS,
                "aKeyEvent must be NS_KEY_PRESS event");
 
-#ifdef PR_LOGGING
   if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
     nsAutoString chars;
     nsCocoaUtils::GetStringForNSString([aNativeKeyEvent characters], chars);
     NS_ConvertUTF16toUTF8 utf8Chars(chars);
     char16_t expectedChar = static_cast<char16_t>(aInsertChar);
     NS_ConvertUTF16toUTF8 utf8ExpectedChar(&expectedChar, 1);
     PR_LOG(gLog, PR_LOG_ALWAYS,
       ("%p TISInputSourceWrapper::InitKeyPressEvent, aNativeKeyEvent=%p, "
        "[aNativeKeyEvent characters]=\"%s\", aInsertChar=0x%X(%s), "
        "aKeyEvent.message=%s, aKbType=0x%X, IsOpenedIMEMode()=%s",
        this, aNativeKeyEvent, utf8Chars.get(), aInsertChar,
        utf8ExpectedChar.get(), GetGeckoKeyEventType(aKeyEvent), aKbType,
        TrueOrFalse(IsOpenedIMEMode())));
   }
-#endif // #ifdef PR_LOGGING
 
   aKeyEvent.isChar = true; // this is not a special key  XXX not used in XP
   aKeyEvent.charCode = aInsertChar;
   if (aKeyEvent.charCode != 0) {
     aKeyEvent.keyCode = 0;
   }
 
   PR_LOG(gLog, PR_LOG_ALWAYS,
@@ -1446,17 +1438,16 @@ TextInputHandler::CreateAllKeyboardLayou
   ::CFRelease(filter);
   return list;
 }
 
 // static
 void
 TextInputHandler::DebugPrintAllKeyboardLayouts()
 {
-#ifdef PR_LOGGING
   if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
     CFArrayRef list = CreateAllKeyboardLayoutList();
     PR_LOG(gLog, PR_LOG_ALWAYS, ("Keyboard layout configuration:"));
     CFIndex idx = ::CFArrayGetCount(list);
     TISInputSourceWrapper tis;
     for (CFIndex i = 0; i < idx; ++i) {
       TISInputSourceRef inputSource = static_cast<TISInputSourceRef>(
         const_cast<void *>(::CFArrayGetValueAtIndex(list, i)));
@@ -1469,17 +1460,16 @@ TextInputHandler::DebugPrintAllKeyboardL
               NS_ConvertUTF16toUTF8(name).get(),
               NS_ConvertUTF16toUTF8(isid).get(),
               tis.IsASCIICapable() ? "" : "\t(Isn't ASCII capable)",
               tis.IsKeyboardLayout() && tis.GetUCKeyboardLayout() ?
                 "" : "\t(uchr is NOT AVAILABLE)"));
     }
     ::CFRelease(list);
   }
-#endif // #ifdef PR_LOGGING
 }
 
 
 #pragma mark -
 
 
 /******************************************************************************
  *
@@ -2265,17 +2255,16 @@ IMEInputHandler::OnCurrentTextInputSourc
 {
   // Cache the latest IME opened mode to sLatestIMEOpenedModeInputSourceID.
   TISInputSourceWrapper tis;
   tis.InitByCurrentInputSource();
   if (tis.IsOpenedIMEMode()) {
     tis.GetInputSourceID(sLatestIMEOpenedModeInputSourceID);
   }
 
-#ifdef PR_LOGGING
   if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
     static CFStringRef sLastTIS = nullptr;
     CFStringRef newTIS;
     tis.GetInputSourceID(newTIS);
     if (!sLastTIS ||
         ::CFStringCompare(sLastTIS, newTIS, 0) != kCFCompareEqualTo) {
       TISInputSourceWrapper tis1, tis2, tis3, tis4, tis5;
       tis1.InitByCurrentKeyboardLayout();
@@ -2312,17 +2301,16 @@ IMEInputHandler::OnCurrentTextInputSourc
          [NSTextInputContext currentInputContext], GetCharacters(is0),
          GetCharacters(type0), tis.IsASCIICapable() ? "- ASCII capable " : "",
          GetCharacters(is4), GetCharacters(is5),
          GetCharacters(lang0), GetCharacters(bundleID0),
          GetCharacters(is2), GetCharacters(is1), GetCharacters(is3)));
     }
     sLastTIS = newTIS;
   }
-#endif // #ifdef PR_LOGGING
 
   /**
    * When the direction is changed, all the children are notified.
    * No need to treat the initial case separately because it is covered
    * by the general case (sCachedIsForRTLLangage is initially false)
    */
   if (sCachedIsForRTLLangage != tis.IsForRTLLanguage()) {
     nsTArray<dom::ContentParent*> children;
@@ -2355,17 +2343,16 @@ IMEInputHandler::CreateAllIMEModeList()
   ::CFRelease(filter);
   return list;
 }
 
 // static
 void
 IMEInputHandler::DebugPrintAllIMEModes()
 {
-#ifdef PR_LOGGING
   if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
     CFArrayRef list = CreateAllIMEModeList();
     PR_LOG(gLog, PR_LOG_ALWAYS, ("IME mode configuration:"));
     CFIndex idx = ::CFArrayGetCount(list);
     TISInputSourceWrapper tis;
     for (CFIndex i = 0; i < idx; ++i) {
       TISInputSourceRef inputSource = static_cast<TISInputSourceRef>(
         const_cast<void *>(::CFArrayGetValueAtIndex(list, i)));
@@ -2377,17 +2364,16 @@ IMEInputHandler::DebugPrintAllIMEModes()
              ("  %s\t<%s>%s%s\n",
               NS_ConvertUTF16toUTF8(name).get(),
               NS_ConvertUTF16toUTF8(isid).get(),
               tis.IsASCIICapable() ? "" : "\t(Isn't ASCII capable)",
               tis.IsEnabled() ? "" : "\t(Isn't Enabled)"));
     }
     ::CFRelease(list);
   }
-#endif // #ifdef PR_LOGGING
 }
 
 //static
 TSMDocumentID
 IMEInputHandler::GetCurrentTSMDocumentID()
 {
   // At least on Mac OS X 10.6.x and 10.7.x, ::TSMGetActiveDocument() has a bug.
   // The result of ::TSMGetActiveDocument() isn't modified for new active text
@@ -3690,26 +3676,24 @@ IMEInputHandler::OpenSystemPreferredLang
     bool changed = false;
     CFStringRef lang = static_cast<CFStringRef>(
       ::CFLocaleGetValue(locale, kCFLocaleLanguageCode));
     NS_ASSERTION(lang, "lang is null");
     if (lang) {
       TISInputSourceWrapper tis;
       tis.InitByLanguage(lang);
       if (tis.IsOpenedIMEMode()) {
-#ifdef PR_LOGGING
         if (PR_LOG_TEST(gLog, PR_LOG_ALWAYS)) {
           CFStringRef foundTIS;
           tis.GetInputSourceID(foundTIS);
           PR_LOG(gLog, PR_LOG_ALWAYS,
             ("%p IMEInputHandler::OpenSystemPreferredLanguageIME, "
              "foundTIS=%s, lang=%s",
              this, GetCharacters(foundTIS), GetCharacters(lang)));
         }
-#endif // #ifdef PR_LOGGING
         tis.Select();
         changed = true;
       }
     }
     ::CFRelease(locale);
     if (changed) {
       break;
     }
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -102,19 +102,17 @@ using mozilla::gfx::Matrix4x4;
 
 #undef DEBUG_UPDATE
 #undef INVALIDATE_DEBUGGING  // flash areas as they are invalidated
 
 // Don't put more than this many rects in the dirty region, just fluff
 // out to the bounding-box if there are more
 #define MAX_RECTS_IN_REGION 100
 
-#ifdef PR_LOGGING
 PRLogModuleInfo* sCocoaLog = nullptr;
-#endif
 
 extern "C" {
   CG_EXTERN void CGContextResetCTM(CGContextRef);
   CG_EXTERN void CGContextSetCTM(CGContextRef, CGAffineTransform);
   CG_EXTERN void CGContextResetClip(CGContextRef);
 
   typedef CFTypeRef CGSRegionObj;
   CGError CGSNewRegionWithRect(const CGRect *rect, CGSRegionObj *outRegion);
@@ -270,21 +268,19 @@ ConvertGeckoRectToMacRect(const nsIntRec
 static inline void
 FlipCocoaScreenCoordinate(NSPoint &inPoint)
 {
   inPoint.y = nsCocoaUtils::FlippedScreenY(inPoint.y);
 }
 
 void EnsureLogInitialized()
 {
-#ifdef PR_LOGGING
   if (!sCocoaLog) {
     sCocoaLog = PR_NewLogModule("nsCocoaWidgets");
   }
-#endif // PR_LOGGING
 }
 
 namespace {
 
 // Manages a texture which can resize dynamically, binds to the
 // LOCAL_GL_TEXTURE_RECTANGLE_ARB texture target and is automatically backed
 // by a power-of-two size GL texture. The latter two features are used for
 // compatibility with older Mac hardware which we block GL layers on.
--- a/widget/cocoa/nsClipboard.mm
+++ b/widget/cocoa/nsClipboard.mm
@@ -26,19 +26,17 @@
 
 using mozilla::gfx::DataSourceSurface;
 using mozilla::gfx::SourceSurface;
 using mozilla::RefPtr;
 
 // Screenshots use the (undocumented) png pasteboard type.
 #define IMAGE_PASTEBOARD_TYPES NSTIFFPboardType, @"Apple PNG pasteboard type", nil
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* sCocoaLog;
-#endif
 
 extern void EnsureLogInitialized();
 
 nsClipboard::nsClipboard() : nsBaseClipboard()
 {
   mCachedClipboard = -1;
   mChangeCount = 0;
 
--- a/widget/cocoa/nsDragService.mm
+++ b/widget/cocoa/nsDragService.mm
@@ -27,19 +27,17 @@
 #include "gfxContext.h"
 #include "nsCocoaUtils.h"
 #include "mozilla/gfx/2D.h"
 #include "gfxPlatform.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* sCocoaLog;
-#endif
 
 extern void EnsureLogInitialized();
 
 extern NSPasteboard* globalDragPboard;
 extern NSView* gLastDragView;
 extern NSEvent* gLastDragMouseDownEvent;
 extern bool gUserCancelledDrag;
 
--- a/widget/gtk/nsAppShell.cpp
+++ b/widget/gtk/nsAppShell.cpp
@@ -21,22 +21,20 @@
 #ifdef MOZ_ENABLE_DBUS
 #include "WakeLockListener.h"
 #endif
 
 using mozilla::unused;
 
 #define NOTIFY_TOKEN 0xFA
 
-#ifdef PR_LOGGING
 PRLogModuleInfo *gWidgetLog = nullptr;
 PRLogModuleInfo *gWidgetFocusLog = nullptr;
 PRLogModuleInfo *gWidgetDragLog = nullptr;
 PRLogModuleInfo *gWidgetDrawLog = nullptr;
-#endif
 
 static GPollFunc sPollFunc;
 
 // Wrapper function to disable hang monitoring while waiting in poll().
 static gint
 PollWrapper(GPollFD *ufds, guint nfsd, gint timeout_)
 {
     mozilla::HangMonitor::Suspend();
@@ -70,26 +68,24 @@ nsAppShell::~nsAppShell()
         close(mPipeFDs[0]);
     if (mPipeFDs[1])
         close(mPipeFDs[1]);
 }
 
 nsresult
 nsAppShell::Init()
 {
-#ifdef PR_LOGGING
     if (!gWidgetLog)
         gWidgetLog = PR_NewLogModule("Widget");
     if (!gWidgetFocusLog)
         gWidgetFocusLog = PR_NewLogModule("WidgetFocus");
     if (!gWidgetDragLog)
         gWidgetDragLog = PR_NewLogModule("WidgetDrag");
     if (!gWidgetDrawLog)
         gWidgetDrawLog = PR_NewLogModule("WidgetDraw");
-#endif
 
 #ifdef MOZ_ENABLE_DBUS
     nsCOMPtr<nsIPowerManagerService> powerManagerService =
       do_GetService(POWERMANAGERSERVICE_CONTRACTID);
 
     if (powerManagerService) {
         powerManagerService->AddWakeLockListener(WakeLockListener::GetSingleton());
     } else {
--- a/widget/gtk/nsDeviceContextSpecG.cpp
+++ b/widget/gtk/nsDeviceContextSpecG.cpp
@@ -28,26 +28,24 @@
 #include "mozilla/Preferences.h"
 
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
 using namespace mozilla;
 
-#ifdef PR_LOGGING 
 static PRLogModuleInfo *
 GetDeviceContextSpecGTKLog()
 {
   static PRLogModuleInfo *sLog;
   if (!sLog)
     sLog = PR_NewLogModule("DeviceContextSpecGTK");
   return sLog;
 }
-#endif /* PR_LOGGING */
 /* Macro to make lines shorter */
 #define DO_PR_DEBUG_LOG(x) PR_LOG(GetDeviceContextSpecGTKLog(), PR_LOG_DEBUG, x)
 
 //----------------------------------------------------------------------------------
 // The printer data is shared between the PrinterEnumerator and the nsDeviceContextSpecGTK
 // The PrinterEnumerator creates the printer info
 // but the nsDeviceContextSpecGTK cleans it up
 // If it gets created (via the Page Setup Dialog) but the user never prints anything
--- a/widget/gtk/nsGtkIMModule.cpp
+++ b/widget/gtk/nsGtkIMModule.cpp
@@ -13,17 +13,16 @@
 #include "mozilla/Likely.h"
 #include "mozilla/MiscEvents.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/TextEvents.h"
 
 using namespace mozilla;
 using namespace mozilla::widget;
 
-#ifdef PR_LOGGING
 PRLogModuleInfo* gGtkIMLog = nullptr;
 
 static const char*
 GetBoolName(bool aBool)
 {
   return aBool ? "true" : "false";
 }
 
@@ -70,17 +69,16 @@ GetEventType(GdkEventKey* aKeyEvent)
         case GDK_KEY_PRESS:
             return "GDK_KEY_PRESS";
         case GDK_KEY_RELEASE:
             return "GDK_KEY_RELEASE";
         default:
             return "Unknown";
     }
 }
-#endif
 
 const static bool kUseSimpleContextDefault = MOZ_WIDGET_GTK == 2;
 
 nsGtkIMModule* nsGtkIMModule::sLastFocusedModule = nullptr;
 bool nsGtkIMModule::sUseSimpleContext;
 
 nsGtkIMModule::nsGtkIMModule(nsWindow* aOwnerWindow)
     : mOwnerWindow(aOwnerWindow)
@@ -91,21 +89,19 @@ nsGtkIMModule::nsGtkIMModule(nsWindow* a
     , mComposingContext(nullptr)
     , mCompositionStart(UINT32_MAX)
     , mProcessingKeyEvent(nullptr)
     , mCompositionTargetOffset(UINT32_MAX)
     , mCompositionState(eCompositionState_NotComposing)
     , mIsIMFocused(false)
     , mIsDeletingSurrounding(false)
 {
-#ifdef PR_LOGGING
     if (!gGtkIMLog) {
         gGtkIMLog = PR_NewLogModule("nsGtkIMModuleWidgets");
     }
-#endif
     static bool sFirstInstance = true;
     if (sFirstInstance) {
         sFirstInstance = false;
         sUseSimpleContext =
             Preferences::GetBool(
                 "intl.ime.use_simple_context_on_password_field",
                 kUseSimpleContextDefault);
     }
--- a/widget/gtk/nsGtkIMModule.h
+++ b/widget/gtk/nsGtkIMModule.h
@@ -158,31 +158,29 @@ protected:
      *
      * @param aContext          An IM context which is specified by native
      *                          composition events.
      * @return                  true if the context is valid context for
      *                          handling composition.  Otherwise, false.
      */
     bool IsValidContext(GtkIMContext* aContext) const;
 
-#ifdef PR_LOGGING
     const char* GetCompositionStateName()
     {
         switch (mCompositionState) {
             case eCompositionState_NotComposing:
                 return "NotComposing";
             case eCompositionState_CompositionStartDispatched:
                 return "CompositionStartDispatched";
             case eCompositionState_CompositionChangeEventDispatched:
                 return "CompositionChangeEventDispatched";
             default:
                 return "InvaildState";
         }
     }
-#endif // PR_LOGGING
 
 
     // mIsIMFocused is set to TRUE when we call gtk_im_context_focus_in(). And
     // it's set to FALSE when we call gtk_im_context_focus_out().
     bool mIsIMFocused;
     // mFilterKeyEvent is used by OnKeyEvent().  If the commit event should
     // be processed as simple key event, this is set to TRUE by the commit
     // handler.
--- a/widget/gtk/nsGtkKeyUtils.cpp
+++ b/widget/gtk/nsGtkKeyUtils.cpp
@@ -17,19 +17,17 @@
 #include <gdk/gdkkeysyms-compat.h>
 #endif
 #include <X11/XKBlib.h>
 #include "WidgetUtils.h"
 #include "keysym2ucs.h"
 #include "nsIBidiKeyboard.h"
 #include "nsServiceManagerUtils.h"
 
-#ifdef PR_LOGGING
 PRLogModuleInfo* gKeymapWrapperLog = nullptr;
-#endif // PR_LOGGING
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/TextEvents.h"
 
 namespace mozilla {
 namespace widget {
 
@@ -39,18 +37,16 @@ namespace widget {
 #define MOZ_MODIFIER_KEYS "MozKeymapWrapper"
 
 KeymapWrapper* KeymapWrapper::sInstance = nullptr;
 guint KeymapWrapper::sLastRepeatableHardwareKeyCode = 0;
 KeymapWrapper::RepeatState KeymapWrapper::sRepeatState =
     KeymapWrapper::NOT_PRESSED;
 nsIBidiKeyboard* sBidiKeyboard = nullptr;
 
-#ifdef PR_LOGGING
-
 static const char* GetBoolName(bool aBool)
 {
     return aBool ? "TRUE" : "FALSE";
 }
 
 /* static */ const char*
 KeymapWrapper::GetModifierName(Modifier aModifier)
 {
@@ -66,18 +62,16 @@ KeymapWrapper::GetModifierName(Modifier 
         case META:         return "Meta";
         case LEVEL3:       return "Level3";
         case LEVEL5:       return "Level5";
         case NOT_MODIFIER: return "NotModifier";
         default:           return "InvalidValue";
     }
 }
 
-#endif // PR_LOGGING
-
 /* static */ KeymapWrapper::Modifier
 KeymapWrapper::GetModifierForGDKKeyval(guint aGdkKeyval)
 {
     switch (aGdkKeyval) {
         case GDK_Caps_Lock:        return CAPS_LOCK;
         case GDK_Num_Lock:         return NUM_LOCK;
         case GDK_Scroll_Lock:      return SCROLL_LOCK;
         case GDK_Shift_Lock:
@@ -154,24 +148,22 @@ KeymapWrapper::GetInstance()
     sInstance = new KeymapWrapper();
     return sInstance;
 }
 
 KeymapWrapper::KeymapWrapper() :
     mInitialized(false), mGdkKeymap(gdk_keymap_get_default()),
     mXKBBaseEventCode(0)
 {
-#ifdef PR_LOGGING
     if (!gKeymapWrapperLog) {
         gKeymapWrapperLog = PR_NewLogModule("KeymapWrapperWidgets");
     }
     PR_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS,
         ("KeymapWrapper(%p): Constructor, mGdkKeymap=%p",
          this, mGdkKeymap));
-#endif // PR_LOGGING
 
     g_signal_connect(mGdkKeymap, "keys-changed",
                      (GCallback)OnKeysChanged, this);
 
     // This is necessary for catching the destroying timing.
     g_object_weak_ref(G_OBJECT(mGdkKeymap),
                       (GWeakNotify)OnDestroyKeymap, this);
 
--- a/widget/gtk/nsGtkKeyUtils.h
+++ b/widget/gtk/nsGtkKeyUtils.h
@@ -193,19 +193,17 @@ protected:
      * @param aGdkKeyval        A GDK defined modifier key value such as
      *                          GDK_Shift_L.
      * @return                  Returns Modifier values for aGdkKeyval.
      *                          If the given key code isn't a modifier key,
      *                          returns NOT_MODIFIER.
      */
     static Modifier GetModifierForGDKKeyval(guint aGdkKeyval);
 
-#ifdef PR_LOGGING
     static const char* GetModifierName(Modifier aModifier);
-#endif // PR_LOGGING
 
     /**
      * mGdkKeymap is a wrapped instance by this class.
      */
     GdkKeymap* mGdkKeymap;
 
     /**
      * The base event code of XKB extension.
--- a/widget/gtk/nsIdleServiceGTK.cpp
+++ b/widget/gtk/nsIdleServiceGTK.cpp
@@ -8,19 +8,17 @@
 #include <gtk/gtk.h>
 
 #include "nsIdleServiceGTK.h"
 #include "nsIServiceManager.h"
 #include "nsDebug.h"
 #include "prlink.h"
 #include "prlog.h"
 
-#ifdef PR_LOGGING
 static PRLogModuleInfo* sIdleLog = nullptr;
-#endif
 
 typedef bool (*_XScreenSaverQueryExtension_fn)(Display* dpy, int* event_base,
                                                  int* error_base);
 
 typedef XScreenSaverInfo* (*_XScreenSaverAllocInfo_fn)(void);
 
 typedef void (*_XScreenSaverQueryInfo_fn)(Display* dpy, Drawable drw,
                                           XScreenSaverInfo *info);
@@ -36,47 +34,42 @@ static void Initialize()
 {
     if (!GDK_IS_X11_DISPLAY(gdk_display_get_default()))
         return;
 
     // This will leak - See comments in ~nsIdleServiceGTK().
     PRLibrary* xsslib = PR_LoadLibrary("libXss.so.1");
     if (!xsslib) // ouch.
     {
-#ifdef PR_LOGGING
         PR_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to find libXss.so!\n"));
-#endif
         return;
     }
 
     _XSSQueryExtension = (_XScreenSaverQueryExtension_fn)
         PR_FindFunctionSymbol(xsslib, "XScreenSaverQueryExtension");
     _XSSAllocInfo = (_XScreenSaverAllocInfo_fn)
         PR_FindFunctionSymbol(xsslib, "XScreenSaverAllocInfo");
     _XSSQueryInfo = (_XScreenSaverQueryInfo_fn)
         PR_FindFunctionSymbol(xsslib, "XScreenSaverQueryInfo");
-#ifdef PR_LOGGING
+
     if (!_XSSQueryExtension)
         PR_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to get XSSQueryExtension!\n"));
     if (!_XSSAllocInfo)
         PR_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to get XSSAllocInfo!\n"));
     if (!_XSSQueryInfo)
         PR_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to get XSSQueryInfo!\n"));
-#endif
 
     sInitialized = true;
 }
 
 nsIdleServiceGTK::nsIdleServiceGTK()
     : mXssInfo(nullptr)
 {
-#ifdef PR_LOGGING
     if (!sIdleLog)
         sIdleLog = PR_NewLogModule("nsIIdleService");
-#endif
 
     Initialize();
 }
 
 nsIdleServiceGTK::~nsIdleServiceGTK()
 {
     if (mXssInfo)
         XFree(mXssInfo);
@@ -101,19 +94,17 @@ nsIdleServiceGTK::PollIdleTime(uint32_t 
     }
 
     // Ask xscreensaver about idle time:
     *aIdleTime = 0;
 
     // We might not have a display (cf. in xpcshell)
     Display *dplay = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
     if (!dplay) {
-#ifdef PR_LOGGING
         PR_LOG(sIdleLog, PR_LOG_WARNING, ("No display found!\n"));
-#endif
         return false;
     }
 
     if (!_XSSQueryExtension || !_XSSAllocInfo || !_XSSQueryInfo) {
         return false;
     }
 
     int event_base, error_base;
@@ -123,19 +114,17 @@ nsIdleServiceGTK::PollIdleTime(uint32_t 
             mXssInfo = _XSSAllocInfo();
         if (!mXssInfo)
             return false;
         _XSSQueryInfo(dplay, GDK_ROOT_WINDOW(), mXssInfo);
         *aIdleTime = mXssInfo->idle;
         return true;
     }
     // If we get here, we couldn't get to XScreenSaver:
-#ifdef PR_LOGGING
     PR_LOG(sIdleLog, PR_LOG_WARNING, ("XSSQueryExtension returned false!\n"));
-#endif
     return false;
 }
 
 bool
 nsIdleServiceGTK::UsePollMode()
 {
     return sInitialized;
 }
--- a/widget/nsIdleService.cpp
+++ b/widget/nsIdleService.cpp
@@ -41,19 +41,17 @@ using namespace mozilla;
 #define DAILY_SHORTENED_IDLE_SERVICE_SEC 60
 
 // Pref for last time (seconds since epoch) daily notification was sent.
 #define PREF_LAST_DAILY "idle.lastDailyNotification"
 
 // Number of seconds in a day.
 #define SECONDS_PER_DAY 86400
 
-#ifdef PR_LOGGING
 static PRLogModuleInfo *sLog = nullptr;
-#endif
 
 #define LOG_TAG "GeckoIdleService"
 #define LOG_LEVEL ANDROID_LOG_DEBUG
 
 // Use this to find previously added observers in our array:
 class IdleListenerComparator
 {
 public:
@@ -391,20 +389,18 @@ nsIdleService::GetInstance()
   return instance.forget();
 }
 
 nsIdleService::nsIdleService() : mCurrentlySetToTimeoutAt(TimeStamp()),
                                  mIdleObserverCount(0),
                                  mDeltaToNextIdleSwitchInS(UINT32_MAX),
                                  mLastUserInteraction(TimeStamp::Now())
 {
-#ifdef PR_LOGGING
   if (sLog == nullptr)
     sLog = PR_NewLogModule("idleService");
-#endif
   MOZ_ASSERT(!gIdleService);
   gIdleService = this;
   if (XRE_GetProcessType() == GeckoProcessType_Default) {
     mDailyIdle = new nsIdleServiceDaily(this);
     mDailyIdle->Init();
   }
 }
 
@@ -787,19 +783,17 @@ nsIdleService::IdleTimerCallback(void)
                                                       OBSERVER_TOPIC_IDLE,
                                                       timeStr.get());
   }
 }
 
 void
 nsIdleService::SetTimerExpiryIfBefore(TimeStamp aNextTimeout)
 {
-#if defined(PR_LOGGING) || defined(MOZ_WIDGET_ANDROID)
   TimeDuration nextTimeoutDuration = aNextTimeout - TimeStamp::Now();
-#endif
 
   PR_LOG(sLog, PR_LOG_DEBUG,
          ("idleService: SetTimerExpiryIfBefore: next timeout %0.f msec from now",
           nextTimeoutDuration.ToMilliseconds()));
 
 #ifdef MOZ_WIDGET_ANDROID
   __android_log_print(LOG_LEVEL, LOG_TAG,
                       "SetTimerExpiryIfBefore: next timeout %0.f msec from now",
@@ -869,19 +863,17 @@ nsIdleService::ReconfigureTimer(void)
 
   // We need to store the current time, so we don't get artifacts from the time
   // ticking while we are processing.
   TimeStamp curTime = TimeStamp::Now();
 
   TimeStamp nextTimeoutAt = mLastUserInteraction +
                             TimeDuration::FromSeconds(mDeltaToNextIdleSwitchInS);
 
-#if defined(PR_LOGGING) || defined(MOZ_WIDGET_ANDROID)
   TimeDuration nextTimeoutDuration = nextTimeoutAt - curTime;
-#endif
 
   PR_LOG(sLog, PR_LOG_DEBUG,
          ("idleService: next timeout %0.f msec from now",
           nextTimeoutDuration.ToMilliseconds()));
 
 #ifdef MOZ_WIDGET_ANDROID
   __android_log_print(LOG_LEVEL, LOG_TAG,
                       "next timeout %0.f msec from now",
--- a/widget/qt/nsAppShell.cpp
+++ b/widget/qt/nsAppShell.cpp
@@ -16,43 +16,40 @@
 
 #include "prenv.h"
 #include "nsQAppInstance.h"
 
 #ifdef MOZ_LOGGING
 #include "prlog.h"
 #endif
 
-#ifdef PR_LOGGING
 PRLogModuleInfo *gWidgetLog = nullptr;
 PRLogModuleInfo *gWidgetFocusLog = nullptr;
 PRLogModuleInfo *gWidgetIMLog = nullptr;
 PRLogModuleInfo *gWidgetDrawLog = nullptr;
-#endif
 
 static int sPokeEvent;
 
 nsAppShell::~nsAppShell()
 {
     nsQAppInstance::Release();
 }
 
 nsresult
 nsAppShell::Init()
 {
-#ifdef PR_LOGGING
     if (!gWidgetLog)
         gWidgetLog = PR_NewLogModule("Widget");
     if (!gWidgetFocusLog)
         gWidgetFocusLog = PR_NewLogModule("WidgetFocus");
     if (!gWidgetIMLog)
         gWidgetIMLog = PR_NewLogModule("WidgetIM");
     if (!gWidgetDrawLog)
         gWidgetDrawLog = PR_NewLogModule("WidgetDraw");
-#endif
+
     sPokeEvent = QEvent::registerEventType();
 
     nsQAppInstance::AddRef();
 
     return nsBaseAppShell::Init();
 }
 
 void
--- a/widget/qt/nsDeviceContextSpecQt.cpp
+++ b/widget/qt/nsDeviceContextSpecQt.cpp
@@ -27,20 +27,18 @@
 #include "nsTArray.h"
 
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
 #include "gfxPDFSurface.h"
 
-#ifdef PR_LOGGING
 static PRLogModuleInfo* DeviceContextSpecQtLM =
     PR_NewLogModule("DeviceContextSpecQt");
-#endif /* PR_LOGGING */
 /* Macro to make lines shorter */
 #define DO_PR_DEBUG_LOG(x) PR_LOG(DeviceContextSpecQtLM, PR_LOG_DEBUG, x)
 
 nsDeviceContextSpecQt::nsDeviceContextSpecQt()
 {
     DO_PR_DEBUG_LOG(("nsDeviceContextSpecQt::nsDeviceContextSpecQt()\n"));
 }
 
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -45,17 +45,16 @@
 // In WinUser.h, MAPVK_VK_TO_VSC_EX is defined only when WINVER >= 0x0600
 #ifndef MAPVK_VK_TO_VSC_EX
 #define MAPVK_VK_TO_VSC_EX (4)
 #endif
 
 namespace mozilla {
 namespace widget {
 
-#ifdef PR_LOGGING
 static const char* kVirtualKeyName[] = {
   "NULL", "VK_LBUTTON", "VK_RBUTTON", "VK_CANCEL",
   "VK_MBUTTON", "VK_XBUTTON1", "VK_XBUTTON2", "0x07",
   "VK_BACK", "VK_TAB", "0x0A", "0x0B",
   "VK_CLEAR", "VK_RETURN", "0x0E", "0x0F",
 
   "VK_SHIFT", "VK_CONTROL", "VK_MENU", "VK_PAUSE",
   "VK_CAPITAL", "VK_KANA, VK_HANGUL", "0x16", "VK_JUNJA",
@@ -135,18 +134,16 @@ static const char* kVirtualKeyName[] = {
   "VK_OEM_ENLW", "VK_OEM_BACKTAB", "VK_ATTN", "VK_CRSEL",
   "VK_EXSEL", "VK_EREOF", "VK_PLAY", "VK_ZOOM",
   "VK_NONAME", "VK_PA1", "VK_OEM_CLEAR", "0xFF"
 };
 
 static_assert(sizeof(kVirtualKeyName) / sizeof(const char*) == 0x100,
   "The virtual key name must be defined just 256 keys");
 
-#endif // #ifdef PR_LOGGING
-
 // Unique id counter associated with a keydown / keypress events. Used in
 // identifing keypress events for removal from async event dispatch queue
 // in metrofx after preventDefault is called on keydown events.
 static uint32_t sUniqueKeyEventId = 0;
 
 struct DeadKeyEntry
 {
   char16_t BaseChar;
@@ -2240,30 +2237,26 @@ NativeKey::DispatchKeyPressEventForFollo
 
 /*****************************************************************************
  * mozilla::widget::KeyboardLayout
  *****************************************************************************/
 
 KeyboardLayout* KeyboardLayout::sInstance = nullptr;
 nsIIdleServiceInternal* KeyboardLayout::sIdleService = nullptr;
 
-#ifdef PR_LOGGING
 PRLogModuleInfo* sKeyboardLayoutLogger = nullptr;
-#endif // #ifdef PR_LOGGING
 
 // static
 KeyboardLayout*
 KeyboardLayout::GetInstance()
 {
   if (!sInstance) {
-#ifdef PR_LOGGING
     if (!sKeyboardLayoutLogger) {
       sKeyboardLayoutLogger = PR_NewLogModule("KeyboardLayoutWidgets");
     }
-#endif // #ifdef PR_LOGGING
     sInstance = new KeyboardLayout();
     nsCOMPtr<nsIIdleServiceInternal> idleService =
       do_GetService("@mozilla.org/widget/idleservice;1");
     // The refcount will be decreased at shut down.
     sIdleService = idleService.forget().take();
   }
   return sInstance;
 }
@@ -2542,17 +2535,16 @@ KeyboardLayout::LoadLayout(HKL aLayout)
         }
         mVirtualKeys[vki].AttachDeadKeyTable(shiftState, dkt);
       }
     }
   }
 
   ::SetKeyboardState(originalKbdState);
 
-#ifdef PR_LOGGING
   if (PR_LOG_TEST(sKeyboardLayoutLogger, PR_LOG_DEBUG)) {
     static const UINT kExtendedScanCode[] = { 0x0000, 0xE000 };
     static const UINT kMapType =
       IsVistaOrLater() ? MAPVK_VSC_TO_VK_EX : MAPVK_VSC_TO_VK;
     PR_LOG(sKeyboardLayoutLogger, PR_LOG_DEBUG,
            ("Logging virtual keycode values for scancode (0x%p)...",
             mKeyboardLayout));
     for (uint32_t i = 0; i < ArrayLength(kExtendedScanCode); i++) {
@@ -2565,17 +2557,16 @@ KeyboardLayout::LoadLayout(HKL aLayout)
       }
       // XP and Server 2003 don't support 0xE0 prefix of the scancode.
       // Therefore, we don't need to continue on them.
       if (!IsVistaOrLater()) {
         break;
       }
     }
   }
-#endif // #ifdef PR_LOGGING
 }
 
 inline int32_t
 KeyboardLayout::GetKeyIndex(uint8_t aVirtualKey)
 {
 // Currently these 68 (NS_NUM_OF_KEYS) virtual keys are assumed
 // to produce visible representation:
 // 0x20 - VK_SPACE          ' '
--- a/widget/windows/WinMouseScrollHandler.cpp
+++ b/widget/windows/WinMouseScrollHandler.cpp
@@ -22,17 +22,16 @@
 #include "mozilla/Preferences.h"
 #include "mozilla/WindowsVersion.h"
 
 #include <psapi.h>
 
 namespace mozilla {
 namespace widget {
 
-#ifdef PR_LOGGING
 PRLogModuleInfo* gMouseScrollLog = nullptr;
 
 static const char* GetBoolName(bool aBool)
 {
   return aBool ? "TRUE" : "FALSE";
 }
 
 static void LogKeyStateImpl()
@@ -55,19 +54,16 @@ static void LogKeyStateImpl()
   } else {
     PR_LOG(gMouseScrollLog, PR_LOG_DEBUG,
       ("MouseScroll::Device::Elantech::HandleKeyMessage(): Failed to print "
        "current keyboard state"));
   }
 }
 
 #define LOG_KEYSTATE() LogKeyStateImpl()
-#else // PR_LOGGING
-#define LOG_KEYSTATE()
-#endif
 
 MouseScrollHandler* MouseScrollHandler::sInstance = nullptr;
 
 bool MouseScrollHandler::Device::sFakeScrollableWindowNeeded = false;
 
 bool MouseScrollHandler::Device::Elantech::sUseSwipeHack = false;
 bool MouseScrollHandler::Device::Elantech::sUsePinchHack = false;
 DWORD MouseScrollHandler::Device::Elantech::sZoomUntil = 0;
@@ -98,21 +94,19 @@ MouseScrollHandler::GetCurrentMessagePos
 
 // Get rid of the GetMessagePos() API.
 #define GetMessagePos()
 
 /* static */
 void
 MouseScrollHandler::Initialize()
 {
-#ifdef PR_LOGGING
   if (!gMouseScrollLog) {
     gMouseScrollLog = PR_NewLogModule("MouseScrollHandlerWidgets");
   }
-#endif
   Device::Init();
 }
 
 /* static */
 void
 MouseScrollHandler::Shutdown()
 {
   delete sInstance;
@@ -643,23 +637,21 @@ MouseScrollHandler::HandleMouseWheelMess
     if (aWidget->Destroyed()) {
       PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
         ("MouseScroll::HandleMouseWheelMessage: The window was destroyed "
          "by NS_WHEEL_WHEEL event"));
       mLastEventInfo.ResetTransaction();
       return;
     }
   }
-#ifdef PR_LOGGING
   else {
     PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
       ("MouseScroll::HandleMouseWheelMessage: NS_WHEEL_WHEEL event is not "
        "dispatched"));
   }
-#endif
 }
 
 void
 MouseScrollHandler::HandleScrollMessageAsMouseWheelMessage(nsWindowBase* aWidget,
                                                            UINT aMessage,
                                                            WPARAM aWParam,
                                                            LPARAM aLParam)
 {
@@ -1224,22 +1216,20 @@ MouseScrollHandler::Device::Elantech::Ha
          "%s command event",
          aWParam == VK_NEXT ? "Forward" : "Back"));
 
       WidgetCommandEvent commandEvent(true, nsGkAtoms::onAppCommand,
         (aWParam == VK_NEXT) ? nsGkAtoms::Forward : nsGkAtoms::Back, aWidget);
       InitEvent(aWidget, commandEvent);
       aWidget->DispatchWindowEvent(&commandEvent);
     }
-#ifdef PR_LOGGING
     else {
       PR_LOG(gMouseScrollLog, PR_LOG_ALWAYS,
         ("MouseScroll::Device::Elantech::HandleKeyMessage(): Consumed"));
     }
-#endif
     return true; // consume the message (doesn't need to dispatch key events)
   }
 
   // Version 8 of the Elantech touchpad driver sends these messages for
   // zoom gestures:
   //
   //   WM_KEYDOWN    virtual_key = 0xCC        time = 10
   //   WM_KEYDOWN    virtual_key = VK_CONTROL  time = 10
--- a/widget/windows/WinMouseScrollHandler.h
+++ b/widget/windows/WinMouseScrollHandler.h
@@ -378,33 +378,31 @@ private:
     enum Status {
       NOT_SYNTHESIZING,
       SENDING_MESSAGE,
       NATIVE_MESSAGE_RECEIVED,
       INTERNAL_MESSAGE_POSTED,
     };
     Status mStatus;
 
-#ifdef PR_LOGGING
     const char* GetStatusName()
     {
       switch (mStatus) {
         case NOT_SYNTHESIZING:
           return "NOT_SYNTHESIZING";
         case SENDING_MESSAGE:
           return "SENDING_MESSAGE";
         case NATIVE_MESSAGE_RECEIVED:
           return "NATIVE_MESSAGE_RECEIVED";
         case INTERNAL_MESSAGE_POSTED:
           return "INTERNAL_MESSAGE_POSTED";
         default:
           return "Unknown";
       }
     }
-#endif
 
     void Finish();
   }; // SynthesizingEvent
 
   SynthesizingEvent* mSynthesizingEvent;
 
 public:
 
--- a/widget/windows/WinUtils.cpp
+++ b/widget/windows/WinUtils.cpp
@@ -41,19 +41,17 @@
 #include "MainThreadUtils.h"
 #include "gfxColor.h"
 
 #ifdef NS_ENABLE_TSF
 #include <textstor.h>
 #include "nsTextStore.h"
 #endif // #ifdef NS_ENABLE_TSF
 
-#ifdef PR_LOGGING
 PRLogModuleInfo* gWindowsLog = nullptr;
-#endif
 
 using namespace mozilla::gfx;
 
 namespace mozilla {
 namespace widget {
 
 #define ENTRY(_msg) { #_msg, _msg }
 EventMsgInfo gAllEvents[] = {
@@ -427,21 +425,19 @@ WinUtils::DwmInvalidateIconicBitmapsProc
 WinUtils::DwmDefWindowProcProc WinUtils::dwmDwmDefWindowProcPtr = nullptr;
 WinUtils::DwmGetCompositionTimingInfoProc WinUtils::dwmGetCompositionTimingInfoPtr = nullptr;
 WinUtils::DwmFlushProc WinUtils::dwmFlushProcPtr = nullptr;
 
 /* static */
 void
 WinUtils::Initialize()
 {
-#ifdef PR_LOGGING
   if (!gWindowsLog) {
     gWindowsLog = PR_NewLogModule("Widget");
   }
-#endif
   if (!sDwmDll && IsVistaOrLater()) {
     sDwmDll = ::LoadLibraryW(kDwmLibraryName);
 
     if (sDwmDll) {
       dwmExtendFrameIntoClientAreaPtr = (DwmExtendFrameIntoClientAreaProc)::GetProcAddress(sDwmDll, "DwmExtendFrameIntoClientArea");
       dwmIsCompositionEnabledPtr = (DwmIsCompositionEnabledProc)::GetProcAddress(sDwmDll, "DwmIsCompositionEnabled");
       dwmSetIconicThumbnailPtr = (DwmSetIconicThumbnailProc)::GetProcAddress(sDwmDll, "DwmSetIconicThumbnail");
       dwmSetIconicLivePreviewBitmapPtr = (DwmSetIconicLivePreviewBitmapProc)::GetProcAddress(sDwmDll, "DwmSetIconicLivePreviewBitmap");
@@ -480,21 +476,19 @@ WinUtils::LogW(const wchar_t *fmt, ...)
   int len = WideCharToMultiByte(CP_ACP, 0, buffer, -1, nullptr, 0, nullptr, nullptr);
   if (len) {
     char* utf8 = new char[len];
     if (WideCharToMultiByte(CP_ACP, 0, buffer,
                             -1, utf8, len, nullptr,
                             nullptr) > 0) {
       // desktop console
       printf("%s\n", utf8);
-#ifdef PR_LOGGING
       NS_ASSERTION(gWindowsLog, "Called WinUtils Log() but Widget "
                                    "log module doesn't exist!");
       PR_LOG(gWindowsLog, PR_LOG_ALWAYS, (utf8));
-#endif
     }
     delete[] utf8;
   }
   delete[] buffer;
 }
 
 // static
 void
@@ -516,21 +510,19 @@ WinUtils::Log(const char *fmt, ...)
 
   // MSVC, including remote debug sessions
   OutputDebugStringA(buffer);
   OutputDebugStringW(L"\n");
 
   // desktop console
   printf("%s\n", buffer);
 
-#ifdef PR_LOGGING
   NS_ASSERTION(gWindowsLog, "Called WinUtils Log() but Widget "
                                "log module doesn't exist!");
   PR_LOG(gWindowsLog, PR_LOG_ALWAYS, (buffer));
-#endif
   delete[] buffer;
 }
 
 /* static */
 double
 WinUtils::LogToPhysFactor()
 {
   // dpi / 96.0
--- a/widget/windows/nsClipboard.cpp
+++ b/widget/windows/nsClipboard.cpp
@@ -29,36 +29,32 @@
 #include "nsIWidget.h"
 #include "nsIComponentManager.h"
 #include "nsWidgetsCID.h"
 #include "nsCRT.h"
 #include "nsNetUtil.h"
 #include "nsEscape.h"
 #include "nsIObserverService.h"
 
-#ifdef PR_LOGGING
 PRLogModuleInfo* gWin32ClipboardLog = nullptr;
-#endif
 
 // oddly, this isn't in the MSVC headers anywhere.
 UINT nsClipboard::CF_HTML = ::RegisterClipboardFormatW(L"HTML Format");
 
 
 //-------------------------------------------------------------------------
 //
 // nsClipboard constructor
 //
 //-------------------------------------------------------------------------
 nsClipboard::nsClipboard() : nsBaseClipboard()
 {
-#ifdef PR_LOGGING
   if (!gWin32ClipboardLog) {
     gWin32ClipboardLog = PR_NewLogModule("nsClipboard");
   }
-#endif
 
   mIgnoreEmptyNotification = false;
   mWindow         = nullptr;
 
   // Register for a shutdown notification so that we can flush data
  // to the OS clipboard.
   nsCOMPtr<nsIObserverService> observerService =
     do_GetService("@mozilla.org/observer-service;1");
--- a/widget/windows/nsDeviceContextSpecWin.cpp
+++ b/widget/windows/nsDeviceContextSpecWin.cpp
@@ -37,22 +37,18 @@
 
 // File Picker
 #include "nsIFile.h"
 #include "nsIFilePicker.h"
 #include "nsIStringBundle.h"
 #define NS_ERROR_GFX_PRINTER_BUNDLE_URL "chrome://global/locale/printing.properties"
 
 #include "prlog.h"
-#ifdef PR_LOGGING 
 PRLogModuleInfo * kWidgetPrintingLogMod = PR_NewLogModule("printing-widget");
 #define PR_PL(_p1)  PR_LOG(kWidgetPrintingLogMod, PR_LOG_DEBUG, _p1)
-#else
-#define PR_PL(_p1)
-#endif
 
 using namespace mozilla;
 
 //----------------------------------------------------------------------------------
 // The printer data is shared between the PrinterEnumerator and the nsDeviceContextSpecWin
 // The PrinterEnumerator creates the printer info
 // but the nsDeviceContextSpecWin cleans it up
 // If it gets created (via the Page Setup Dialog) but the user never prints anything
--- a/widget/windows/nsIMM32Handler.cpp
+++ b/widget/windows/nsIMM32Handler.cpp
@@ -16,19 +16,17 @@
 #include "mozilla/MiscEvents.h"
 #include "mozilla/TextEvents.h"
 
 using namespace mozilla;
 using namespace mozilla::widget;
 
 static nsIMM32Handler* gIMM32Handler = nullptr;
 
-#ifdef PR_LOGGING
 PRLogModuleInfo* gIMM32Log = nullptr;
-#endif
 
 static UINT sWM_MSIME_MOUSE = 0; // mouse message for MSIME 98/2000
 
 //-------------------------------------------------------------------------
 //
 // from http://download.microsoft.com/download/6/0/9/60908e9e-d2c1-47db-98f6-216af76a235f/msime.h
 // The document for this has been removed from MSDN...
 //
@@ -52,20 +50,18 @@ nsIMM32Handler::EnsureHandlerInstance()
   if (!gIMM32Handler) {
     gIMM32Handler = new nsIMM32Handler();
   }
 }
 
 /* static */ void
 nsIMM32Handler::Initialize()
 {
-#ifdef PR_LOGGING
   if (!gIMM32Log)
     gIMM32Log = PR_NewLogModule("nsIMM32HandlerWidgets");
-#endif
 
   if (!sWM_MSIME_MOUSE) {
     sWM_MSIME_MOUSE = ::RegisterWindowMessage(RWM_MOUSE);
   }
   InitKeyboardLayout(::GetKeyboardLayout(0));
 }
 
 /* static */ void
@@ -528,17 +524,16 @@ nsIMM32Handler::OnIMECompositionFull(nsW
 }
 
 /* static */ bool
 nsIMM32Handler::OnIMENotify(nsWindow* aWindow,
                             WPARAM wParam,
                             LPARAM lParam,
                             MSGResult& aResult)
 {
-#ifdef PR_LOGGING
   switch (wParam) {
     case IMN_CHANGECANDIDATE:
       PR_LOG(gIMM32Log, PR_LOG_ALWAYS,
         ("IMM32: OnIMENotify, hWnd=%08x, IMN_CHANGECANDIDATE, lParam=%08x\n",
          aWindow->GetWindowHandle(), lParam));
       break;
     case IMN_CLOSECANDIDATE:
       PR_LOG(gIMM32Log, PR_LOG_ALWAYS,
@@ -601,17 +596,16 @@ nsIMM32Handler::OnIMENotify(nsWindow* aW
          aWindow->GetWindowHandle()));
       break;
     case IMN_PRIVATE:
       PR_LOG(gIMM32Log, PR_LOG_ALWAYS,
         ("IMM32: OnIMENotify, hWnd=%08x, IMN_PRIVATE\n",
          aWindow->GetWindowHandle()));
       break;
   }
-#endif // PR_LOGGING
 
   // not implement yet
   aResult.mConsumed = false;
   return true;
 }
 
 bool
 nsIMM32Handler::OnIMERequest(nsWindow* aWindow,
@@ -1539,17 +1533,16 @@ PlatformToNSAttr(uint8_t aAttr)
     case ATTR_TARGET_CONVERTED:
       return NS_TEXTRANGE_SELECTEDCONVERTEDTEXT;
     default:
       NS_ASSERTION(false, "unknown attribute");
       return NS_TEXTRANGE_CARETPOSITION;
   }
 }
 
-#ifdef PR_LOGGING
 static const char*
 GetRangeTypeName(uint32_t aRangeType)
 {
   switch (aRangeType) {
     case NS_TEXTRANGE_RAWINPUT:
       return "NS_TEXTRANGE_RAWINPUT";
     case NS_TEXTRANGE_CONVERTEDTEXT:
       return "NS_TEXTRANGE_CONVERTEDTEXT";
@@ -1558,17 +1551,16 @@ GetRangeTypeName(uint32_t aRangeType)
     case NS_TEXTRANGE_SELECTEDCONVERTEDTEXT:
       return "NS_TEXTRANGE_SELECTEDCONVERTEDTEXT";
     case NS_TEXTRANGE_CARETPOSITION:
       return "NS_TEXTRANGE_CARETPOSITION";
     default:
       return "UNKNOWN SELECTION TYPE!!";
   }
 }
-#endif
 
 void
 nsIMM32Handler::DispatchCompositionChangeEvent(nsWindow* aWindow,
                                                const nsIMEContext& aIMEContext)
 {
   NS_ASSERTION(mIsComposing, "conflict state");
   PR_LOG(gIMM32Log, PR_LOG_ALWAYS,
     ("IMM32: DispatchCompositionChangeEvent"));
--- a/widget/windows/nsNativeThemeWin.cpp
+++ b/widget/windows/nsNativeThemeWin.cpp
@@ -37,19 +37,17 @@
 #include "nsUXThemeData.h"
 #include "nsUXThemeConstants.h"
 #include <algorithm>
 
 using mozilla::IsVistaOrLater;
 using namespace mozilla;
 using namespace mozilla::widget;
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gWindowsLog;
-#endif
 
 NS_IMPL_ISUPPORTS_INHERITED(nsNativeThemeWin, nsNativeTheme, nsITheme)
 
 nsNativeThemeWin::nsNativeThemeWin() :
   mProgressDeterminateTimeStamp(TimeStamp::Now()),
   mProgressIndeterminateTimeStamp(TimeStamp::Now())
 {
   // If there is a relevant change in forms.css for windows platform,
--- a/widget/windows/nsSound.cpp
+++ b/widget/windows/nsSound.cpp
@@ -22,19 +22,17 @@
 #include "prlog.h"
 #include "prtime.h"
 #include "prprf.h"
 #include "prmem.h"
 
 #include "nsNativeCharsetUtils.h"
 #include "nsThreadUtils.h"
 
-#ifdef PR_LOGGING
 PRLogModuleInfo* gWin32SoundLog = nullptr;
-#endif
 
 class nsSoundPlayer: public nsRunnable {
 public:
   nsSoundPlayer(nsSound *aSound, const wchar_t* aSoundName) :
     mSoundName(aSoundName), mSound(aSound)
   {
     Init();
   }
@@ -103,21 +101,19 @@ nsSoundPlayer::SoundReleaser::Run()
 #define SND_PURGE 0
 #endif
 
 NS_IMPL_ISUPPORTS(nsSound, nsISound, nsIStreamLoaderObserver)
 
 
 nsSound::nsSound()
 {
-#ifdef PR_LOGGING
     if (!gWin32SoundLog) {
       gWin32SoundLog = PR_NewLogModule("nsSound");
     }
-#endif
 
     mLastSound = nullptr;
 }
 
 nsSound::~nsSound()
 {
   NS_ASSERTION(!mPlayerThread, "player thread is not null but should be");
   PurgeLastSound();
--- a/widget/windows/nsTextStore.cpp
+++ b/widget/windows/nsTextStore.cpp
@@ -22,17 +22,16 @@
 #include "nsTextStore.h"
 
 using namespace mozilla;
 using namespace mozilla::widget;
 
 static const char* kPrefNameEnableTSF = "intl.tsf.enable";
 static const char* kPrefNameForceEnableTSF = "intl.tsf.force_enable";
 
-#ifdef PR_LOGGING
 /**
  * TSF related code should log its behavior even on release build especially
  * in the interface methods.
  *
  * In interface methods, use PR_LOG_ALWAYS.
  * In internal methods, use PR_LOG_DEBUG for logging normal behavior.
  * For logging error, use PR_LOG_ERROR.
  *
@@ -653,18 +652,16 @@ GetModifiersName(Modifiers aModifiers)
   }
   if (aModifiers & MODIFIER_OS) {
     ADD_SEPARATOR_IF_NECESSARY(names);
     names += NS_DOM_KEYNAME_OS;
   }
   return names;
 }
 
-#endif // #ifdef PR_LOGGING
-
 /******************************************************************/
 /* InputScopeImpl                                                 */
 /******************************************************************/
 
 class InputScopeImpl final : public ITfInputScope
 {
   ~InputScopeImpl() {}
 
@@ -2003,28 +2000,26 @@ nsTextStore::GetDisplayAttribute(ITfProp
                                  TF_DISPLAYATTRIBUTE* aResult)
 {
   NS_ENSURE_TRUE(aAttrProperty, E_FAIL);
   NS_ENSURE_TRUE(aRange, E_FAIL);
   NS_ENSURE_TRUE(aResult, E_FAIL);
 
   HRESULT hr;
 
-#ifdef PR_LOGGING
   if (PR_LOG_TEST(sTextStoreLog, PR_LOG_DEBUG)) {
     LONG start = 0, length = 0;
     hr = GetRangeExtent(aRange, &start, &length);
     PR_LOG(sTextStoreLog, PR_LOG_DEBUG,
            ("TSF: 0x%p   nsTextStore::GetDisplayAttribute(): "
             "GetDisplayAttribute range=%ld-%ld (hr=%s)",
             this, start - mComposition.mStart,
             start - mComposition.mStart + length,
             GetCommonReturnValueName(hr)));
   }
-#endif
 
   VARIANT propValue;
   ::VariantInit(&propValue);
   hr = aAttrProperty->GetValue(TfEditCookie(mEditCookie), aRange, &propValue);
   if (FAILED(hr)) {
     PR_LOG(sTextStoreLog, PR_LOG_ERROR,
            ("TSF: 0x%p   nsTextStore::GetDisplayAttribute() FAILED due to "
             "ITfProperty::GetValue() failed", this));
@@ -3971,17 +3966,16 @@ nsTextStore::OnUpdateComposition(ITfComp
   hr = RecordCompositionUpdateAction();
   if (FAILED(hr)) {
     PR_LOG(sTextStoreLog, PR_LOG_ERROR,
            ("TSF: 0x%p   nsTextStore::OnUpdateComposition() FAILED due to "
             "RecordCompositionUpdateAction() failure", this));
     return hr;
   }
 
-#ifdef PR_LOGGING
   if (PR_LOG_TEST(sTextStoreLog, PR_LOG_ALWAYS)) {
     Selection& currentSel = CurrentSelection();
     if (currentSel.IsDirty()) {
       PR_LOG(sTextStoreLog, PR_LOG_ERROR,
              ("TSF: 0x%p   nsTextStore::OnUpdateComposition() FAILED due to "
               "CurrentSelection() failure", this));
       return E_FAIL;
     }
@@ -3989,17 +3983,16 @@ nsTextStore::OnUpdateComposition(ITfComp
            ("TSF: 0x%p   nsTextStore::OnUpdateComposition() succeeded: "
             "mComposition={ mStart=%ld, mString=\"%s\" }, "
             "CurrentSelection()={ acpStart=%ld, acpEnd=%ld, style.ase=%s }",
             this, mComposition.mStart,
             NS_ConvertUTF16toUTF8(mComposition.mString).get(),
             currentSel.StartOffset(), currentSel.EndOffset(),
             GetActiveSelEndName(currentSel.ActiveSelEnd())));
   }
-#endif // #ifdef PR_LOGGING
   return S_OK;
 }
 
 STDMETHODIMP
 nsTextStore::OnEndComposition(ITfCompositionView* pComposition)
 {
   PR_LOG(sTextStoreLog, PR_LOG_ALWAYS,
          ("TSF: 0x%p nsTextStore::OnEndComposition(pComposition=0x%p), "
@@ -4726,21 +4719,19 @@ nsTextStore::MarkContextAsEmpty(ITfConte
           "to mark empty context 0x%p...", aContext));
   comp->SetValue(sClientId, &variant_int4_value1);
 }
 
 // static
 void
 nsTextStore::Initialize()
 {
-#ifdef PR_LOGGING
   if (!sTextStoreLog) {
     sTextStoreLog = PR_NewLogModule("nsTextStoreWidgets");
   }
-#endif
 
   PR_LOG(sTextStoreLog, PR_LOG_ALWAYS,
     ("TSF: nsTextStore::Initialize() is called..."));
 
   if (sThreadMgr) {
     PR_LOG(sTextStoreLog, PR_LOG_ERROR,
       ("TSF:   nsTextStore::Initialize() FAILED due to already initialized"));
     return;
--- a/widget/windows/nsWinGesture.cpp
+++ b/widget/windows/nsWinGesture.cpp
@@ -15,19 +15,17 @@
 #include "mozilla/Constants.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/TouchEvents.h"
 
 using namespace mozilla;
 using namespace mozilla::widget;
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gWindowsLog;
-#endif
 
 const wchar_t nsWinGesture::kGestureLibraryName[] =  L"user32.dll";
 HMODULE nsWinGesture::sLibraryHandle = nullptr;
 nsWinGesture::GetGestureInfoPtr nsWinGesture::getGestureInfo = nullptr;
 nsWinGesture::CloseGestureInfoHandlePtr nsWinGesture::closeGestureInfoHandle = nullptr;
 nsWinGesture::GetGestureExtraArgsPtr nsWinGesture::getGestureExtraArgs = nullptr;
 nsWinGesture::SetGestureConfigPtr nsWinGesture::setGestureConfig = nullptr;
 nsWinGesture::GetGestureConfigPtr nsWinGesture::getGestureConfig = nullptr;
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -260,19 +260,17 @@ TimeStamp       nsWindow::sFirstEventTim
 /**************************************************************
  *
  * SECTION: globals variables
  *
  **************************************************************/
 
 static const char *sScreenManagerContractID       = "@mozilla.org/gfx/screenmanager;1";
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gWindowsLog;
-#endif
 
 // Global used in Show window enumerations.
 static bool     gWindowsVisible                   = false;
 
 // True if we have sent a notification that we are suspending/sleeping.
 static bool     gIsSleepMode                      = false;
 
 static NS_DEFINE_CID(kCClipboardCID, NS_CLIPBOARD_CID);
--- a/widget/windows/nsWindowDbg.cpp
+++ b/widget/windows/nsWindowDbg.cpp
@@ -7,19 +7,17 @@
  * nsWindowDbg - Debug related utilities for nsWindow.
  */
 
 #include "nsWindowDbg.h"
 #include "WinUtils.h"
 
 using namespace mozilla::widget;
 
-#ifdef PR_LOGGING
 extern PRLogModuleInfo* gWindowsLog;
-#endif
 
 #if defined(POPUP_ROLLUP_DEBUG_OUTPUT)
 MSGFEventMsgInfo gMSGFEvents[] = {
   "MSGF_DIALOGBOX",      0,
   "MSGF_MESSAGEBOX",     1,
   "MSGF_MENU",           2,
   "MSGF_SCROLLBAR",      5,
   "MSGF_NEXTWINDOW",     6,