Bug 1392483 - ifdef out mNextIdleDeadline in a few more places. r=froydnj
MozReview-Commit-ID: D9bW4jEHlhl
--- 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