Bug 837955: In builds without PR_LOGGING, define away the already-neutered logging macros in nsSHistory.cpp. r=smaug
authorDaniel Holbert <dholbert@cs.stanford.edu>
Tue, 05 Feb 2013 08:18:47 -0800
changeset 130751 5490d8c52ff47f0d8729f62675546b6ae575860e
parent 130750 d21ebe0febbe03f0da0717de7cef370c5a6d3156
child 130752 45648727f6e2039e9e4f4da2c7ed24375a127c92
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs837955
milestone21.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 837955: In builds without PR_LOGGING, define away the already-neutered logging macros in nsSHistory.cpp. r=smaug
docshell/shistory/src/nsSHistory.cpp
--- a/docshell/shistory/src/nsSHistory.cpp
+++ b/docshell/shistory/src/nsSHistory.cpp
@@ -57,16 +57,18 @@ static PRCList gSHistoryList;
 // Max viewers allowed total, across all SHistory objects - negative default
 // means we will calculate how many viewers to cache based on total memory
 int32_t nsSHistory::sHistoryMaxTotalViewers = -1;
 
 // A counter that is used to be able to know the order in which
 // entries were touched, so that we can evict older entries first.
 static uint32_t gTouchCounter = 0;
 
+#ifdef PR_LOGGING
+
 static PRLogModuleInfo*
 GetSHistoryLog()
 {
   static PRLogModuleInfo *sLog;
   if (!sLog)
     sLog = PR_NewLogModule("nsSHistory");
   return sLog;
 }
@@ -100,16 +102,24 @@ GetSHistoryLog()
   PR_BEGIN_MACRO                                           \
     if (PR_LOG_TEST(GetSHistoryLog(), PR_LOG_DEBUG)) {     \
       nsCOMPtr<nsIURI> uri;                                \
       shentry->GetURI(getter_AddRefs(uri));                \
       LOG_SPEC(format, uri);                               \
     }                                                      \
   PR_END_MACRO
 
+#else // !PR_LOGGING
+
+#define LOG(format)
+#define LOG_SPEC(format, uri)
+#define LOG_SHENTRY_SPEC(format, shentry)
+
+#endif // PR_LOGGING
+
 // Iterates over all registered session history listeners.
 #define ITERATE_LISTENERS(body)                            \
   PR_BEGIN_MACRO                                           \
   {                                                        \
     nsAutoTObserverArray<nsWeakPtr, 2>::EndLimitedIterator \
       iter(mListeners);                                    \
     while (iter.HasMore()) {                               \
       nsCOMPtr<nsISHistoryListener> listener =             \