Bug 1162673 - Part 1: Remove instances of #ifdef PR_LOGGING in layout. r=froydnj
authorEric Rahm <erahm@mozilla.com>
Mon, 11 May 2015 13:53:18 -0700
changeset 274171 520a0ded5a2fcec9820f5b1de89ee12f8b7c1e91
parent 274170 f9af70b6e6de1ce8e1c823fbdad417c9e084ab79
child 274172 d8977ecb8d2ac3d89943b845a7d163addbb4864e
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1162673
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 1162673 - Part 1: Remove instances of #ifdef PR_LOGGING in layout. r=froydnj PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
layout/base/SelectionCarets.cpp
layout/base/TouchCaret.cpp
layout/base/nsDocumentViewer.cpp
layout/base/nsPresShell.cpp
layout/base/nsPresShell.h
layout/base/nsRefreshDriver.cpp
layout/generic/nsFlexContainerFrame.cpp
layout/generic/nsPageFrame.cpp
layout/generic/nsPluginFrame.cpp
layout/generic/nsSimplePageSequenceFrame.cpp
layout/printing/nsPrintData.cpp
layout/printing/nsPrintEngine.cpp
layout/style/FontFaceSet.cpp
layout/style/Loader.cpp
layout/style/nsFontFaceLoader.cpp
--- a/layout/base/SelectionCarets.cpp
+++ b/layout/base/SelectionCarets.cpp
@@ -34,35 +34,30 @@
 #include "mozilla/Preferences.h"
 #include "mozilla/TouchEvents.h"
 #include "TouchCaret.h"
 #include "nsFrameSelection.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
-#ifdef PR_LOGGING
 static PRLogModuleInfo* gSelectionCaretsLog;
 static const char* kSelectionCaretsLogModuleName = "SelectionCarets";
 
 // To enable all the SELECTIONCARETS_LOG print statements, set the environment
 // variable NSPR_LOG_MODULES=SelectionCarets:5
 #define SELECTIONCARETS_LOG(message, ...)                                      \
   PR_LOG(gSelectionCaretsLog, PR_LOG_DEBUG,                                    \
          ("SelectionCarets (%p): %s:%d : " message "\n", this, __FUNCTION__,   \
           __LINE__, ##__VA_ARGS__));
 
 #define SELECTIONCARETS_LOG_STATIC(message, ...)                               \
   PR_LOG(gSelectionCaretsLog, PR_LOG_DEBUG,                                    \
          ("SelectionCarets: %s:%d : " message "\n", __FUNCTION__, __LINE__,    \
           ##__VA_ARGS__));
-#else
-#define SELECTIONCARETS_LOG(message, ...)
-#define SELECTIONCARETS_LOG_STATIC(message, ...)
-#endif // #ifdef PR_LOGGING
 
 // We treat mouse/touch move as "REAL" move event once its move distance
 // exceed this value, in CSS pixel.
 static const int32_t kMoveStartTolerancePx = 5;
 // Time for trigger scroll end event, in miliseconds.
 static const int32_t kScrollEndTimerDelay = 300;
 
 NS_IMPL_ISUPPORTS(SelectionCarets,
@@ -83,21 +78,19 @@ SelectionCarets::SelectionCarets(nsIPres
   , mInAsyncPanZoomGesture(false)
   , mEndCaretVisible(false)
   , mStartCaretVisible(false)
   , mSelectionVisibleInScrollFrames(true)
   , mVisible(false)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-#ifdef PR_LOGGING
   if (!gSelectionCaretsLog) {
     gSelectionCaretsLog = PR_NewLogModule(kSelectionCaretsLogModuleName);
   }
-#endif
 
   SELECTIONCARETS_LOG("Constructor, PresShell=%p", mPresShell);
 
   static bool addedPref = false;
   if (!addedPref) {
     Preferences::AddIntVarCache(&sSelectionCaretsInflateSize,
                                 "selectioncaret.inflatesize.threshold");
     Preferences::AddBoolVarCache(&sSelectionCaretDetectsLongTap,
--- a/layout/base/TouchCaret.cpp
+++ b/layout/base/TouchCaret.cpp
@@ -31,35 +31,30 @@
 #include "nsView.h"
 #include "mozilla/dom/SelectionStateChangedEvent.h"
 #include "mozilla/dom/CustomEvent.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/Preferences.h"
 
 using namespace mozilla;
 
-#ifdef PR_LOGGING
 static PRLogModuleInfo* gTouchCaretLog;
 static const char* kTouchCaretLogModuleName = "TouchCaret";
 
 // To enable all the TOUCHCARET_LOG print statements, set the environment
 // variable NSPR_LOG_MODULES=TouchCaret:5
 #define TOUCHCARET_LOG(message, ...)                                           \
   PR_LOG(gTouchCaretLog, PR_LOG_DEBUG,                                         \
          ("TouchCaret (%p): %s:%d : " message "\n", this, __FUNCTION__,        \
           __LINE__, ##__VA_ARGS__));
 
 #define TOUCHCARET_LOG_STATIC(message, ...)                                    \
   PR_LOG(gTouchCaretLog, PR_LOG_DEBUG,                                         \
          ("TouchCaret: %s:%d : " message "\n", __FUNCTION__, __LINE__,         \
           ##__VA_ARGS__));
-#else
-#define TOUCHCARET_LOG(message, ...)
-#define TOUCHCARET_LOG_STATIC(message, ...)
-#endif // #ifdef PR_LOGGING
 
 // Click on the boundary of input/textarea will place the caret at the
 // front/end of the content. To advoid this, we need to deflate the content
 // boundary by 61 app units (1 pixel + 1 app unit).
 static const int32_t kBoundaryAppUnits = 61;
 
 NS_IMPL_ISUPPORTS(TouchCaret, nsISelectionListener)
 
@@ -70,21 +65,19 @@ TouchCaret::TouchCaret(nsIPresShell* aPr
   : mState(TOUCHCARET_NONE),
     mActiveTouchId(-1),
     mCaretCenterToDownPointOffsetY(0),
     mVisible(false),
     mIsValidTap(false)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-#ifdef PR_LOGGING
   if (!gTouchCaretLog) {
     gTouchCaretLog = PR_NewLogModule(kTouchCaretLogModuleName);
   }
-#endif
 
   TOUCHCARET_LOG("Constructor, PresShell=%p", aPresShell);
 
   static bool addedTouchCaretPref = false;
   if (!addedTouchCaretPref) {
     Preferences::AddIntVarCache(&sTouchCaretInflateSize,
                                 "touchcaret.inflatesize.threshold");
     Preferences::AddIntVarCache(&sTouchCaretExpirationTime,
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -128,35 +128,29 @@ using namespace mozilla;
 using namespace mozilla::dom;
 
 #define BEFOREUNLOAD_DISABLED_PREFNAME "dom.disable_beforeunload"
 
 //-----------------------------------------------------
 // PR LOGGING
 #include "prlog.h"
 
-#ifdef PR_LOGGING
-
 #ifdef NS_PRINTING
 static PRLogModuleInfo *
 GetPrintingLog()
 {
   static PRLogModuleInfo *sLog;
   if (!sLog)
     sLog = PR_NewLogModule("printing");
   return sLog;
 }
 #define PR_PL(_p1)  PR_LOG(GetPrintingLog(), PR_LOG_DEBUG, _p1);
 #endif // NS_PRINTING
 
 #define PRT_YESNO(_p) ((_p)?"YES":"NO")
-#else
-#define PRT_YESNO(_p)
-#define PR_PL(_p1)
-#endif
 //-----------------------------------------------------
 
 class nsDocumentViewer;
 class nsPrintEventDispatcher;
 
 // a small delegate class used to avoid circular references
 
 class nsDocViewerSelectionListener : public nsISelectionListener
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -530,19 +530,17 @@ public:
   }
 
 private:
   nsCOMPtr<nsIDocument> mDocument;
 };
 
 bool PresShell::sDisableNonTestMouseEvents = false;
 
-#ifdef PR_LOGGING
 PRLogModuleInfo* PresShell::gLog;
-#endif
 
 #ifdef DEBUG
 static void
 VerifyStyleTree(nsPresContext* aPresContext, nsFrameManager* aFrameManager)
 {
   if (nsFrame::GetVerifyStyleTreeEnable()) {
     nsIFrame* rootFrame = aFrameManager->GetRootFrame();
     aPresContext->RestyleManager()->DebugVerifyStyleTree(rootFrame);
@@ -747,22 +745,20 @@ PresShell::BeforeAfterKeyboardEventEnabl
 PresShell::PresShell()
   : mMouseLocation(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE)
 {
 #ifdef MOZ_REFLOW_PERF
   mReflowCountMgr = new ReflowCountMgr();
   mReflowCountMgr->SetPresContext(mPresContext);
   mReflowCountMgr->SetPresShell(this);
 #endif
-#ifdef PR_LOGGING
   mLoadBegin = TimeStamp::Now();
   if (!gLog) {
     gLog = PR_NewLogModule("PresShell");
   }
-#endif
   mSelectionFlags = nsISelectionDisplay::DISPLAY_TEXT | nsISelectionDisplay::DISPLAY_IMAGES;
   mIsThemeSupportDisabled = false;
   mIsActive = true;
   // FIXME/bug 735029: find a better solution to this problem
 #ifdef MOZ_WIDGET_ANDROID
   // The java pan/zoom code uses this to mean approximately "request a
   // reset of pan/zoom state" which doesn't necessarily correspond
   // with the first paint of content.
@@ -965,17 +961,16 @@ PresShell::Init(nsIDocument* aDocument,
   QueryIsActive();
 
   // Setup our font inflation preferences.
   SetupFontInflation();
 
   mTouchManager.Init(this, mDocument);
 }
 
-#ifdef PR_LOGGING
 enum TextPerfLogType {
   eLog_reflow,
   eLog_loaddone,
   eLog_totals
 };
 
 static void
 LogTextPerfStats(gfxTextPerfMetrics* aTextPerf,
@@ -1046,34 +1041,31 @@ LogTextPerfStats(gfxTextPerfMetrics* aTe
             aCounts.maxTextRunLen,
             lookups, hitRatio,
             aCounts.wordCacheSpaceRules, aCounts.wordCacheLong,
             aCounts.fallbackPrefs, aCounts.fallbackSystem,
             aCounts.textrunConst, aCounts.textrunDestr,
             aTextPerf->cumulative.textrunDestr));
   }
 }
-#endif
 
 void
 PresShell::Destroy()
 {
   NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
     "destroy called on presshell while scripts not blocked");
 
   // dump out cumulative text perf metrics
-#ifdef PR_LOGGING
   gfxTextPerfMetrics* tp;
   if (mPresContext && (tp = mPresContext->GetTextPerfMetrics())) {
     tp->Accumulate();
     if (tp->cumulative.numChars > 0) {
       LogTextPerfStats(tp, this, tp->cumulative, 0.0, eLog_totals, nullptr);
     }
   }
-#endif
 
 #ifdef MOZ_REFLOW_PERF
   DumpReflows();
   if (mReflowCountMgr) {
     delete mReflowCountMgr;
     mReflowCountMgr = nullptr;
   }
 #endif
@@ -2647,17 +2639,16 @@ PresShell::MaybeReleaseCapturingContent(
   }
 }
 
 void
 PresShell::BeginLoad(nsIDocument *aDocument)
 {
   mDocumentLoading = true;
 
-#ifdef PR_LOGGING
   gfxTextPerfMetrics *tp = nullptr;
   if (mPresContext) {
     tp = mPresContext->GetTextPerfMetrics();
   }
 
   bool shouldLog = gLog && PR_LOG_TEST(gLog, PR_LOG_DEBUG);
   if (shouldLog || tp) {
     mLoadBegin = TimeStamp::Now();
@@ -2668,33 +2659,31 @@ PresShell::BeginLoad(nsIDocument *aDocum
     nsAutoCString spec;
     if (uri) {
       uri->GetSpec(spec);
     }
     PR_LOG(gLog, PR_LOG_DEBUG,
            ("(presshell) %p load begin [%s]\n",
             this, spec.get()));
   }
-#endif
 }
 
 void
 PresShell::EndLoad(nsIDocument *aDocument)
 {
   NS_PRECONDITION(aDocument == mDocument, "Wrong document");
 
   RestoreRootScrollPosition();
 
   mDocumentLoading = false;
 }
 
 void
 PresShell::LoadComplete()
 {
-#ifdef PR_LOGGING
   gfxTextPerfMetrics *tp = nullptr;
   if (mPresContext) {
     tp = mPresContext->GetTextPerfMetrics();
   }
 
   // log load
   bool shouldLog = gLog && PR_LOG_TEST(gLog, PR_LOG_DEBUG);
   if (shouldLog || tp) {
@@ -2712,17 +2701,16 @@ PresShell::LoadComplete()
     if (tp) {
       tp->Accumulate();
       if (tp->cumulative.numChars > 0) {
         LogTextPerfStats(tp, this, tp->cumulative, loadTime.ToMilliseconds(),
                          eLog_loaddone, spec.get());
       }
     }
   }
-#endif
 }
 
 #ifdef DEBUG
 void
 PresShell::VerifyHasDirtyRootAncestor(nsIFrame* aFrame)
 {
   // XXXbz due to bug 372769, can't actually assert anything here...
   return;
@@ -9279,27 +9267,25 @@ PresShell::DoReflow(nsIFrame* target, bo
 
     // Any FlushPendingNotifications with interruptible reflows
     // should be suppressed now. We don't want to do extra reflow work
     // before our reflow event happens.
     mSuppressInterruptibleReflows = true;
     MaybeScheduleReflow();
   }
 
-#ifdef PR_LOGGING
   // dump text perf metrics for reflows with significant text processing
   if (tp) {
     if (tp->current.numChars > 100) {
       TimeDuration reflowTime = TimeStamp::Now() - timeStart;
       LogTextPerfStats(tp, this, tp->current,
                        reflowTime.ToMilliseconds(), eLog_reflow, nullptr);
     }
     tp->Accumulate();
   }
-#endif
 
   if (docShell) {
     docShell->AddProfileTimelineMarker("Reflow", TRACING_INTERVAL_END);
   }
   return !interrupted;
 }
 
 #ifdef DEBUG
--- a/layout/base/nsPresShell.h
+++ b/layout/base/nsPresShell.h
@@ -314,19 +314,17 @@ public:
 #ifdef DEBUG
   virtual void ListStyleContexts(nsIFrame *aRootFrame, FILE *out,
                                  int32_t aIndent = 0) override;
 
   virtual void ListStyleSheets(FILE *out, int32_t aIndent = 0) override;
   virtual void VerifyStyleTree() override;
 #endif
 
-#ifdef PR_LOGGING
   static PRLogModuleInfo* gLog;
-#endif
 
   virtual void DisableNonTestMouseEvents(bool aDisable) override;
 
   virtual void UpdateCanvasBackground() override;
 
   virtual void AddCanvasBackgroundColorItem(nsDisplayListBuilder& aBuilder,
                                             nsDisplayList& aList,
                                             nsIFrame* aFrame,
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -68,22 +68,18 @@
 #include "ipc/Nuwa.h"
 #endif
 
 using namespace mozilla;
 using namespace mozilla::widget;
 using namespace mozilla::ipc;
 using namespace mozilla::layout;
 
-#ifdef PR_LOGGING
 static PRLogModuleInfo *gLog = nullptr;
 #define LOG(...) PR_LOG(gLog, PR_LOG_NOTICE, (__VA_ARGS__))
-#else
-#define LOG(...) do { } while(0)
-#endif
 
 #define DEFAULT_FRAME_RATE 60
 #define DEFAULT_THROTTLED_FRAME_RATE 1
 // after 10 minutes, stop firing off inactive timers
 #define DEFAULT_INACTIVE_TIMER_DISABLE_SECONDS 600
 
 namespace mozilla {
 
@@ -897,21 +893,19 @@ GetFirstFrameDelay(imgIRequest* req)
     return 0;
 
   return static_cast<uint32_t>(delay);
 }
 
 /* static */ void
 nsRefreshDriver::InitializeStatics()
 {
-#ifdef PR_LOGGING
   if (!gLog) {
     gLog = PR_NewLogModule("nsRefreshDriver");
   }
-#endif
 }
 
 /* static */ void
 nsRefreshDriver::Shutdown()
 {
   // clean up our timers
   delete sRegularRateTimer;
   delete sThrottledRateTimer;
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -28,26 +28,24 @@ using namespace mozilla::layout;
 
 // Convenience typedefs for helper classes that we forward-declare in .h file
 // (so that nsFlexContainerFrame methods can use them as parameters):
 typedef nsFlexContainerFrame::FlexItem FlexItem;
 typedef nsFlexContainerFrame::FlexLine FlexLine;
 typedef nsFlexContainerFrame::FlexboxAxisTracker FlexboxAxisTracker;
 typedef nsFlexContainerFrame::StrutInfo StrutInfo;
 
-#ifdef PR_LOGGING
 static PRLogModuleInfo*
 GetFlexContainerLog()
 {
   static PRLogModuleInfo *sLog;
   if (!sLog)
     sLog = PR_NewLogModule("nsFlexContainerFrame");
   return sLog;
 }
-#endif /* PR_LOGGING */
 
 // XXXdholbert Some of this helper-stuff should be separated out into a general
 // "main/cross-axis utils" header, shared by grid & flexbox?
 // (Particularly when grid gets support for align-*/justify-* properties.)
 
 // Helper enums
 // ============
 
--- a/layout/generic/nsPageFrame.cpp
+++ b/layout/generic/nsPageFrame.cpp
@@ -17,22 +17,18 @@
 #include "nsDisplayList.h"
 #include "nsLayoutUtils.h" // for function BinarySearchForPosition
 #include "nsSimplePageSequenceFrame.h" // for nsSharedPageData
 #include "nsTextFormatter.h" // for page number localization formatting
 #include "nsBidiUtils.h"
 #include "nsIPrintSettings.h"
 
 #include "prlog.h"
-#ifdef PR_LOGGING 
 extern PRLogModuleInfo *GetLayoutPrintingLog();
 #define PR_PL(_p1)  PR_LOG(GetLayoutPrintingLog(), PR_LOG_DEBUG, _p1)
-#else
-#define PR_PL(_p1)
-#endif
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 
 nsPageFrame*
 NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsPageFrame(aContext);
--- a/layout/generic/nsPluginFrame.cpp
+++ b/layout/generic/nsPluginFrame.cpp
@@ -88,26 +88,24 @@ using mozilla::DefaultXDisplay;
 #endif
 
 #include "mozilla/dom/TabChild.h"
 
 #ifdef CreateEvent // Thank you MS.
 #undef CreateEvent
 #endif
 
-#ifdef PR_LOGGING 
 static PRLogModuleInfo *
 GetObjectFrameLog()
 {
   static PRLogModuleInfo *sLog;
   if (!sLog)
     sLog = PR_NewLogModule("nsPluginFrame");
   return sLog;
 }
-#endif /* PR_LOGGING */
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 using namespace mozilla::layers;
 
 class PluginBackgroundSink : public ReadbackSink {
 public:
   PluginBackgroundSink(nsPluginFrame* aFrame, uint64_t aStartSequenceNumber)
--- a/layout/generic/nsSimplePageSequenceFrame.cpp
+++ b/layout/generic/nsSimplePageSequenceFrame.cpp
@@ -37,29 +37,25 @@
 using namespace mozilla;
 using namespace mozilla::dom;
 
 static const char sPrintOptionsContractID[] = "@mozilla.org/gfx/printsettings-service;1";
 
 //
 
 #include "prlog.h"
-#ifdef PR_LOGGING 
 PRLogModuleInfo *
 GetLayoutPrintingLog()
 {
   static PRLogModuleInfo *sLog;
   if (!sLog)
     sLog = PR_NewLogModule("printing-layout");
   return sLog;
 }
 #define PR_PL(_p1)  PR_LOG(GetLayoutPrintingLog(), PR_LOG_DEBUG, _p1)
-#else
-#define PR_PL(_p1)
-#endif
 
 nsSimplePageSequenceFrame*
 NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsSimplePageSequenceFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsSimplePageSequenceFrame)
--- a/layout/printing/nsPrintData.cpp
+++ b/layout/printing/nsPrintData.cpp
@@ -11,31 +11,26 @@
 #include "nsPrintPreviewListener.h"
 #include "nsIWebProgressListener.h"
 #include "mozilla/Services.h"
 
 //-----------------------------------------------------
 // PR LOGGING
 #include "prlog.h"
 
-#ifdef PR_LOGGING
 #define DUMP_LAYOUT_LEVEL 9 // this turns on the dumping of each doucment's layout info
 static PRLogModuleInfo *
 GetPrintingLog()
 {
   static PRLogModuleInfo *sLog;
   if (!sLog)
     sLog = PR_NewLogModule("printing");
   return sLog;
 }
 #define PR_PL(_p1)  PR_LOG(GetPrintingLog(), PR_LOG_DEBUG, _p1);
-#else
-#define PRT_YESNO(_p)
-#define PR_PL(_p1)
-#endif
 
 //---------------------------------------------------
 //-- nsPrintData Class Impl
 //---------------------------------------------------
 nsPrintData::nsPrintData(ePrintDataType aType) :
   mType(aType), mDebugFilePtr(nullptr), mPrintObject(nullptr), mSelectedPO(nullptr),
   mPrintDocList(0), mIsIFrameSelected(false),
   mIsParentAFrameSet(false), mOnStartSent(false),
--- a/layout/printing/nsPrintEngine.cpp
+++ b/layout/printing/nsPrintEngine.cpp
@@ -124,18 +124,16 @@ static const char kPrintingPromptService
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 //-----------------------------------------------------
 // PR LOGGING
 #include "prlog.h"
 
-#ifdef PR_LOGGING
-
 #ifdef DEBUG
 // PR_LOGGING is force to always be on (even in release builds)
 // but we only want some of it on,
 //#define EXTENDED_DEBUG_PRINTING 
 #endif
 
 #define DUMP_LAYOUT_LEVEL 9 // this turns on the dumping of each doucment's layout info
 
@@ -156,20 +154,16 @@ static uint32_t gDumpFileNameCnt   = 0;
 static uint32_t gDumpLOFileNameCnt = 0;
 #endif
 
 #define PRT_YESNO(_p) ((_p)?"YES":"NO")
 static const char * gFrameTypesStr[]       = {"eDoc", "eFrame", "eIFrame", "eFrameSet"};
 static const char * gPrintFrameTypeStr[]   = {"kNoFrames", "kFramesAsIs", "kSelectedFrame", "kEachFrameSep"};
 static const char * gFrameHowToEnableStr[] = {"kFrameEnableNone", "kFrameEnableAll", "kFrameEnableAsIsAndEach"};
 static const char * gPrintRangeStr[]       = {"kRangeAllPages", "kRangeSpecifiedPageRange", "kRangeSelection", "kRangeFocusFrame"};
-#else
-#define PRT_YESNO(_p)
-#define PR_PL(_p1)
-#endif
 
 #ifdef EXTENDED_DEBUG_PRINTING
 // Forward Declarations
 static void DumpPrintObjectsListStart(const char * aStr, nsTArray<nsPrintObject*> * aDocList);
 static void DumpPrintObjectsTree(nsPrintObject * aPO, int aLevel= 0, FILE* aFD = nullptr);
 static void DumpPrintObjectsTreeLayout(nsPrintObject * aPO,nsDeviceContext * aDC, int aLevel= 0, FILE * aFD = nullptr);
 
 #define DUMP_DOC_LIST(_title) DumpPrintObjectsListStart((_title), mPrt->mPrintDocList);
@@ -1708,33 +1702,31 @@ nsPrintEngine::SetupToPrintContent()
     }
 
     if (mPrt->mShrinkRatio < 0.998f) {
       rv = ReconstructAndReflow(true);
       didReconstruction = true;
       NS_ENSURE_SUCCESS(rv, rv);
     }
 
-#ifdef PR_LOGGING
     float calcRatio = 0.0f;
     if (mPrt->mPrintDocList.Length() > 1 && mPrt->mPrintObject->mFrameType == eFrameSet) {
       nsPrintObject* smallestPO = FindSmallestSTF();
       NS_ASSERTION(smallestPO, "There must always be an XMost PO!");
       if (smallestPO) {
         // Calc the shrinkage based on the entire content area
         calcRatio = smallestPO->mShrinkRatio;
       }
     } else {
       // Single document so use the Shrink as calculated for the PO
       calcRatio = mPrt->mPrintObject->mShrinkRatio;
     }
     PR_PL(("**************************************************************************\n"));
     PR_PL(("STF Ratio is: %8.5f Effective Ratio: %8.5f Diff: %8.5f\n", mPrt->mShrinkRatio, calcRatio,  mPrt->mShrinkRatio-calcRatio));
     PR_PL(("**************************************************************************\n"));
-#endif
   }
   
   // If the frames got reconstructed and reflowed the number of pages might
   // has changed.
   if (didReconstruction) {
     FirePrintPreviewUpdateEvent();
   }
   
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -446,27 +446,25 @@ FontFaceSet::StartLoad(gfxUserFontEntry*
                                             nsIContentPolicy::TYPE_FONT,
                                             loadGroup);
 
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsRefPtr<nsFontFaceLoader> fontLoader =
     new nsFontFaceLoader(aUserFontEntry, aFontFaceSrc->mURI, this, channel);
 
-#ifdef PR_LOGGING
   if (LOG_ENABLED()) {
     nsAutoCString fontURI, referrerURI;
     aFontFaceSrc->mURI->GetSpec(fontURI);
     if (aFontFaceSrc->mReferrer)
       aFontFaceSrc->mReferrer->GetSpec(referrerURI);
     LOG(("userfonts (%p) download start - font uri: (%s) "
          "referrer uri: (%s)\n",
          fontLoader.get(), fontURI.get(), referrerURI.get()));
   }
-#endif
 
   nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
   if (httpChannel) {
     httpChannel->SetReferrerWithPolicy(aFontFaceSrc->mReferrer,
                                        ps->GetDocument()->GetReferrerPolicy());
     nsAutoCString accept("application/font-woff;q=0.9,*/*;q=0.8");
     if (Preferences::GetBool(GFX_PREF_WOFF2_ENABLED)) {
       accept.Insert(NS_LITERAL_CSTRING("application/font-woff2;q=1.0,"), 0);
@@ -648,24 +646,22 @@ FontFaceSet::UpdateRules(const nsTArray<
     mHasLoadingFontFacesIsDirty = true;
     CheckLoadingStarted();
     CheckLoadingFinished();
   }
 
   // local rules have been rebuilt, so clear the flag
   mUserFontSet->mLocalRulesUsed = false;
 
-#if PR_LOGGING
   if (LOG_ENABLED() && !mRuleFaces.IsEmpty()) {
     LOG(("userfonts (%p) userfont rules update (%s) rule count: %d",
          mUserFontSet.get(),
          (modified ? "modified" : "not modified"),
          mRuleFaces.Length()));
   }
-#endif
 
   return modified;
 }
 
 static bool
 HasLocalSrc(const nsCSSValue::Array *aSrcArr)
 {
   size_t numSrc = aSrcArr->Count();
@@ -1106,21 +1102,19 @@ FontFaceSet::LogMessage(gfxUserFontEntry
       message.AppendLiteral("status=");
       message.AppendInt(static_cast<uint32_t>(aStatus));
       break;
     }
   }
   message.AppendLiteral(" source: ");
   message.Append(fontURI);
 
-#ifdef PR_LOGGING
   if (LOG_ENABLED()) {
     LOG(("userfonts (%p) %s", mUserFontSet.get(), message.get()));
   }
-#endif
 
   // try to give the user an indication of where the rule came from
   nsCSSFontFaceRule* rule = FindRuleForUserFontEntry(aUserFontEntry);
   nsString href;
   nsString text;
   nsresult rv;
   uint32_t line = 0;
   uint32_t column = 0;
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -250,63 +250,55 @@ public:
   nsresult                              mStatus;
 
 private:
   void FireLoadEvent(nsIThreadInternal* aThread);
 };
 
 #include "prlog.h"
 
-#ifdef PR_LOGGING
 static PRLogModuleInfo *
 GetLoaderLog()
 {
   static PRLogModuleInfo *sLog;
   if (!sLog)
     sLog = PR_NewLogModule("nsCSSLoader");
   return sLog;
 }
-#endif /* PR_LOGGING */
 
 #define LOG_FORCE(args) PR_LOG(GetLoaderLog(), PR_LOG_ALWAYS, args)
 #define LOG_ERROR(args) PR_LOG(GetLoaderLog(), PR_LOG_ERROR, args)
 #define LOG_WARN(args) PR_LOG(GetLoaderLog(), PR_LOG_WARNING, args)
 #define LOG_DEBUG(args) PR_LOG(GetLoaderLog(), PR_LOG_DEBUG, args)
 #define LOG(args) LOG_DEBUG(args)
 
 #define LOG_FORCE_ENABLED() PR_LOG_TEST(GetLoaderLog(), PR_LOG_ALWAYS)
 #define LOG_ERROR_ENABLED() PR_LOG_TEST(GetLoaderLog(), PR_LOG_ERROR)
 #define LOG_WARN_ENABLED() PR_LOG_TEST(GetLoaderLog(), PR_LOG_WARNING)
 #define LOG_DEBUG_ENABLED() PR_LOG_TEST(GetLoaderLog(), PR_LOG_DEBUG)
 #define LOG_ENABLED() LOG_DEBUG_ENABLED()
 
-#ifdef PR_LOGGING
 #define LOG_URI(format, uri)                        \
   PR_BEGIN_MACRO                                    \
     NS_ASSERTION(uri, "Logging null uri");          \
     if (LOG_ENABLED()) {                            \
       nsAutoCString _logURISpec;                    \
       uri->GetSpec(_logURISpec);                    \
       LOG((format, _logURISpec.get()));             \
     }                                               \
   PR_END_MACRO
-#else // PR_LOGGING
-#define LOG_URI(format, uri)
-#endif // PR_LOGGING
 
 // And some convenience strings...
-#ifdef PR_LOGGING
 static const char* const gStateStrings[] = {
   "eSheetStateUnknown",
   "eSheetNeedsParser",
   "eSheetPending",
   "eSheetLoading",
   "eSheetComplete"
 };
-#endif
 
 /********************************
  * SheetLoadData implementation *
  ********************************/
 NS_IMPL_ISUPPORTS(SheetLoadData, nsIUnicharStreamLoaderObserver, nsIRunnable,
                   nsIThreadObserver)
 
 SheetLoadData::SheetLoadData(Loader* aLoader,
@@ -668,32 +660,28 @@ SheetLoadData::OnDetermineCharset(nsIUni
   aCharset.Truncate();
 
   if (nsContentUtils::CheckForBOM((const unsigned char*)aSegment.BeginReading(),
                                   aSegment.Length(),
                                   aCharset)) {
     // aCharset is now either "UTF-16BE", "UTF-16BE" or "UTF-8"
     // which will swallow the BOM.
     mCharset.Assign(aCharset);
-#ifdef PR_LOGGING
     LOG(("  Setting from BOM to: %s", PromiseFlatCString(aCharset).get()));
-#endif
     return NS_OK;
   }
 
   nsCOMPtr<nsIChannel> channel;
   nsAutoCString specified;
   aLoader->GetChannel(getter_AddRefs(channel));
   if (channel) {
     channel->GetContentCharset(specified);
     if (EncodingUtils::FindEncodingForLabel(specified, aCharset)) {
       mCharset.Assign(aCharset);
-#ifdef PR_LOGGING
       LOG(("  Setting from HTTP to: %s", PromiseFlatCString(aCharset).get()));
-#endif
       return NS_OK;
     }
   }
 
   if (GetCharsetFromData(aSegment.BeginReading(),
                          aSegment.Length(),
                          specified)) {
     if (EncodingUtils::FindEncodingForLabel(specified, aCharset)) {
@@ -704,79 +692,67 @@ SheetLoadData::OnDetermineCharset(nsIUni
           aCharset.EqualsLiteral("UTF-16BE") ||
           aCharset.EqualsLiteral("UTF-16LE")) {
         // Be consistent with HTML <meta> handling in face of impossibility.
         // When the @charset rule itself evidently was not UTF-16-encoded,
         // it saying UTF-16 has to be a lie.
         aCharset.AssignLiteral("UTF-8");
       }
       mCharset.Assign(aCharset);
-#ifdef PR_LOGGING
       LOG(("  Setting from @charset rule to: %s",
           PromiseFlatCString(aCharset).get()));
-#endif
       return NS_OK;
     }
   }
 
   // Now try the charset on the <link> or processing instruction
   // that loaded us
   if (mOwningElement) {
     nsAutoString specified16;
     mOwningElement->GetCharset(specified16);
     if (EncodingUtils::FindEncodingForLabel(specified16, aCharset)) {
       mCharset.Assign(aCharset);
-#ifdef PR_LOGGING
       LOG(("  Setting from charset attribute to: %s",
           PromiseFlatCString(aCharset).get()));
-#endif
       return NS_OK;
     }
   }
 
   // In the preload case, the value of the charset attribute on <link> comes
   // in via mCharsetHint instead.
   if (EncodingUtils::FindEncodingForLabel(mCharsetHint, aCharset)) {
     mCharset.Assign(aCharset);
-#ifdef PR_LOGGING
       LOG(("  Setting from charset attribute (preload case) to: %s",
           PromiseFlatCString(aCharset).get()));
-#endif
     return NS_OK;
   }
 
   // Try charset from the parent stylesheet.
   if (mParentData) {
     aCharset = mParentData->mCharset;
     if (!aCharset.IsEmpty()) {
       mCharset.Assign(aCharset);
-#ifdef PR_LOGGING
       LOG(("  Setting from parent sheet to: %s",
           PromiseFlatCString(aCharset).get()));
-#endif
       return NS_OK;
     }
   }
 
   if (mLoader->mDocument) {
     // no useful data on charset.  Try the document charset.
     aCharset = mLoader->mDocument->GetDocumentCharacterSet();
     MOZ_ASSERT(!aCharset.IsEmpty());
     mCharset.Assign(aCharset);
-#ifdef PR_LOGGING
     LOG(("  Setting from document to: %s", PromiseFlatCString(aCharset).get()));
-#endif
     return NS_OK;
   }
 
   aCharset.AssignLiteral("UTF-8");
   mCharset = aCharset;
-#ifdef PR_LOGGING
   LOG(("  Setting from default to: %s", PromiseFlatCString(aCharset).get()));
-#endif
   return NS_OK;
 }
 
 already_AddRefed<nsIURI>
 SheetLoadData::GetReferrerURI()
 {
   nsCOMPtr<nsIURI> uri;
   if (mParentData)
--- a/layout/style/nsFontFaceLoader.cpp
+++ b/layout/style/nsFontFaceLoader.cpp
@@ -138,29 +138,27 @@ nsFontFaceLoader::OnStreamComplete(nsISt
 {
   if (!mFontFaceSet) {
     // We've been canceled
     return aStatus;
   }
 
   mFontFaceSet->RemoveLoader(this);
 
-#ifdef PR_LOGGING
   if (LOG_ENABLED()) {
     nsAutoCString fontURI;
     mFontURI->GetSpec(fontURI);
     if (NS_SUCCEEDED(aStatus)) {
       LOG(("userfonts (%p) download completed - font uri: (%s)\n",
            this, fontURI.get()));
     } else {
       LOG(("userfonts (%p) download failed - font uri: (%s) error: %8.8x\n",
            this, fontURI.get(), aStatus));
     }
   }
-#endif
 
   nsPresContext* ctx = mFontFaceSet->GetPresContext();
   NS_ASSERTION(ctx && !ctx->PresShell()->IsDestroying(),
                "We should have been canceled already");
 
   if (NS_SUCCEEDED(aStatus)) {
     // for HTTP requests, check whether the request _actually_ succeeded;
     // the "request status" in aStatus does not necessarily indicate this,