Bug 1392483 - ifdef out mNextIdleDeadline in a few more places. r=froydnj draft
authorAndrew McCreight <continuation@gmail.com>
Tue, 22 Aug 2017 15:00:45 -0700
changeset 650785 ec47f1bd686d2f907ef2a128b2a86b3132bf25b9
parent 650780 aeca2ed6f275ba08ae215ca934a5754c4c3a162e
child 727498 3f55e89ef1c093992c5861aa55a0ed90fbf9b947
push id75497
push userbmo:continuation@gmail.com
push dateTue, 22 Aug 2017 22:20:44 +0000
reviewersfroydnj
bugs1392483
milestone57.0
Bug 1392483 - ifdef out mNextIdleDeadline in a few more places. r=froydnj MozReview-Commit-ID: D9bW4jEHlhl
xpcom/threads/PrioritizedEventQueue.h
xpcom/threads/nsThread.h
xpcom/threads/nsThreadManager.cpp
--- a/xpcom/threads/PrioritizedEventQueue.h
+++ b/xpcom/threads/PrioritizedEventQueue.h
@@ -54,20 +54,22 @@ public:
   size_t Count(const MutexAutoLock& aProofOfLock) const final;
 
   // When checking the idle deadline, we need to drop whatever mutex protects
   // this queue. This method allows that mutex to be stored so that we can drop
   // it and reacquire it when checking the idle deadline. The mutex must live at
   // least as long as the queue.
   void SetMutexRef(Mutex& aMutex) { mMutex = &aMutex; }
 
+#ifndef RELEASE_OR_BETA
   // nsThread.cpp sends telemetry containing the most recently computed idle
   // deadline. We store a reference to a field in nsThread where this deadline
   // will be stored so that it can be fetched quickly for telemetry.
   void SetNextIdleDeadlineRef(TimeStamp& aDeadline) { mNextIdleDeadline = &aDeadline; }
+#endif
 
   void EnableInputEventPrioritization(const MutexAutoLock& aProofOfLock) final;
 
 private:
   class EnablePrioritizationRunnable;
 
   // Returns a null TimeStamp if we're not in the idle period.
   mozilla::TimeStamp GetIdleDeadline();
@@ -76,19 +78,21 @@ private:
   UniquePtr<InnerQueueT> mInputQueue;
   UniquePtr<InnerQueueT> mNormalQueue;
   UniquePtr<InnerQueueT> mIdleQueue;
 
   // We need to drop the queue mutex when checking the idle deadline, so we keep
   // a pointer to it here.
   Mutex* mMutex = nullptr;
 
+#ifndef RELEASE_OR_BETA
   // Pointer to a place where the most recently computed idle deadline is
   // stored.
   TimeStamp* mNextIdleDeadline = nullptr;
+#endif
 
   // Try to process one high priority runnable after each normal
   // priority runnable. This gives the processing model HTML spec has for
   // 'Update the rendering' in the case only vsync messages are in the
   // secondary queue and prevents starving the normal queue.
   bool mProcessHighPriorityQueue = false;
 
   // mIdlePeriod keeps track of the current idle period. If at any
--- a/xpcom/threads/nsThread.h
+++ b/xpcom/threads/nsThread.h
@@ -100,17 +100,19 @@ public:
   static const uint32_t kRunnableNameBufSize = 1000;
   static mozilla::Array<char, kRunnableNameBufSize> sMainThreadRunnableName;
 
   void EnableInputEventPrioritization()
   {
     EventQueue()->EnableInputEventPrioritization();
   }
 
+#ifndef RELEASE_OR_BETA
   mozilla::TimeStamp& NextIdleDeadlineRef() { return mNextIdleDeadline; }
+#endif
 
   mozilla::SynchronizedEventQueue* EventQueue() { return mEvents.get(); }
 
   bool ShuttingDown()
   {
     return mShutdownContext != nullptr;
   }
 
--- a/xpcom/threads/nsThreadManager.cpp
+++ b/xpcom/threads/nsThreadManager.cpp
@@ -112,17 +112,20 @@ nsThreadManager::Init()
   MainThreadQueueT* prioritizedRef = prioritized.get();
   RefPtr<ThreadEventQueue<MainThreadQueueT>> queue =
     new ThreadEventQueue<MainThreadQueueT>(Move(prioritized));
 
   // Setup "main" thread
   mMainThread = new nsThread(WrapNotNull(queue), nsThread::MAIN_THREAD, 0);
 
   prioritizedRef->SetMutexRef(queue->MutexRef());
+
+#ifndef RELEASE_OR_BETA
   prioritizedRef->SetNextIdleDeadlineRef(mMainThread->NextIdleDeadlineRef());
+#endif
 
   nsresult rv = mMainThread->InitCurrentThread();
   if (NS_FAILED(rv)) {
     mMainThread = nullptr;
     return rv;
   }
 
   // We need to keep a pointer to the current thread, so we can satisfy