Bug 1162242 - Part 3: Clean up usage of PR_LOG_TEST. r=froydnj
authorEric Rahm <erahm@mozilla.com>
Thu, 07 May 2015 09:43:37 -0700
changeset 242785 d7ae6f7c3e20bcc6ec15de62103c5d7a9a540b3f
parent 242784 917d62c82b1d94f1019f76ca21ef03106aedd693
child 242786 830ce4e36b476c7731c0d9d801eb40c89ab521c8
push id59506
push usererahm@mozilla.com
push dateThu, 07 May 2015 16:44:02 +0000
treeherdermozilla-inbound@93eded78def9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1162242
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 1162242 - Part 3: Clean up usage of PR_LOG_TEST. r=froydnj Removes redundant combinations of PR_LOG_TEST and PR_LOG.
xpcom/components/nsComponentManager.cpp
xpcom/threads/TimerThread.cpp
xpcom/threads/nsTimerImpl.cpp
--- a/xpcom/components/nsComponentManager.cpp
+++ b/xpcom/components/nsComponentManager.cpp
@@ -1062,20 +1062,18 @@ nsComponentManagerImpl::GetClassObjectBy
 {
   if (NS_WARN_IF(!aResult) ||
       NS_WARN_IF(!aContractID)) {
     return NS_ERROR_INVALID_ARG;
   }
 
   nsresult rv;
 
-
-  if (PR_LOG_TEST(nsComponentManagerLog, PR_LOG_DEBUG)) {
-    PR_LogPrint("nsComponentManager: GetClassObject(%s)", aContractID);
-  }
+  PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG,
+         ("nsComponentManager: GetClassObject(%s)", aContractID));
 
   nsCOMPtr<nsIFactory> factory = FindFactory(aContractID, strlen(aContractID));
   if (!factory) {
     return NS_ERROR_FACTORY_NOT_REGISTERED;
   }
 
   rv = factory->QueryInterface(aIID, aResult);
 
--- a/xpcom/threads/TimerThread.cpp
+++ b/xpcom/threads/TimerThread.cpp
@@ -255,21 +255,19 @@ TimerThread::Run()
           // from mTimers have gone away (the last non-mTimers[i]-ref's Release
           // must be racing with us, blocked in gThread->RemoveTimer waiting
           // for TimerThread::mMonitor, under nsTimerImpl::Release.
 
           nsRefPtr<nsTimerImpl> timerRef(timer);
           RemoveTimerInternal(timer);
           timer = nullptr;
 
-          if (PR_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) {
-            PR_LOG(GetTimerLog(), PR_LOG_DEBUG,
-                   ("Timer thread woke up %fms from when it was supposed to\n",
-                    fabs((now - timerRef->mTimeout).ToMilliseconds())));
-          }
+          PR_LOG(GetTimerLog(), PR_LOG_DEBUG,
+                 ("Timer thread woke up %fms from when it was supposed to\n",
+                  fabs((now - timerRef->mTimeout).ToMilliseconds())));
 
           {
             // We release mMonitor around the Fire call to avoid deadlock.
             MonitorAutoUnlock unlock(mMonitor);
 
             // We are going to let the call to PostTimerEvent here handle the
             // release of the timer so that we don't end up releasing the timer
             // on the TimerThread instead of on the thread it targets.
--- a/xpcom/threads/nsTimerImpl.cpp
+++ b/xpcom/threads/nsTimerImpl.cpp
@@ -645,21 +645,19 @@ nsTimerImpl::Fire()
     } else if (callbackType == CallbackType::Observer) {
       NS_RELEASE(callback.o);
     }
   }
 
   mFiring = false;
   mTimerCallbackWhileFiring = nullptr;
 
-  if (PR_LOG_TEST(GetTimerLog(), PR_LOG_DEBUG)) {
-    PR_LOG(GetTimerLog(), PR_LOG_DEBUG,
-           ("[this=%p] Took %fms to fire timer callback\n",
-            this, (TimeStamp::Now() - now).ToMilliseconds()));
-  }
+  PR_LOG(GetTimerLog(), PR_LOG_DEBUG,
+         ("[this=%p] Took %fms to fire timer callback\n",
+          this, (TimeStamp::Now() - now).ToMilliseconds()));
 
   // Reschedule repeating timers, except REPEATING_PRECISE which already did
   // that in PostTimerEvent, but make sure that we aren't armed already (which
   // can happen if the callback reinitialized the timer).
   if (IsRepeating() && mType != TYPE_REPEATING_PRECISE && !mArmed) {
     if (mType == TYPE_REPEATING_SLACK) {
       SetDelayInternal(mDelay);  // force mTimeout to be recomputed.  For
     }