Bug 1468112 - Use runnable name also for IdleTaskRunner's timer, r=farre
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Tue, 12 Jun 2018 12:17:08 +0300
changeset 422316 1d80ff31f25a7b113b51738590187b9b0acafa34
parent 422315 def346f39b1d0427cc62676dfd470e95d6ed015f
child 422330 f69e46cd335123845b2535b46308c4959cfb65cc
push id104216
push useropettay@mozilla.com
push dateTue, 12 Jun 2018 09:18:11 +0000
treeherdermozilla-inbound@1d80ff31f25a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfarre
bugs1468112
milestone62.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 1468112 - Use runnable name also for IdleTaskRunner's timer, r=farre
xpcom/threads/IdleTaskRunner.cpp
xpcom/threads/IdleTaskRunner.h
--- a/xpcom/threads/IdleTaskRunner.cpp
+++ b/xpcom/threads/IdleTaskRunner.cpp
@@ -37,16 +37,17 @@ IdleTaskRunner::IdleTaskRunner(const Cal
                                const MayStopProcessingCallbackType& aMayStopProcessing,
                                TaskCategory aTaskCategory)
   : IdleRunnable(aRunnableName)
   , mCallback(aCallback), mDelay(aDelay)
   , mBudget(TimeDuration::FromMilliseconds(aBudget))
   , mRepeating(aRepeating), mTimerActive(false)
   , mMayStopProcessing(aMayStopProcessing)
   , mTaskCategory(aTaskCategory)
+  , mName(aRunnableName)
 {
 }
 
 NS_IMETHODIMP
 IdleTaskRunner::Run()
 {
   if (!mCallback) {
     return NS_OK;
@@ -154,17 +155,17 @@ IdleTaskRunner::Schedule(bool aAllowIdle
       }
       if (TaskCategory::Count != mTaskCategory) {
         mScheduleTimer->SetTarget(SystemGroup::EventTargetFor(mTaskCategory));
       }
       // We weren't allowed to do idle dispatch immediately, do it after a
       // short timeout.
       mScheduleTimer->InitWithNamedFuncCallback(ScheduleTimedOut, this, 16,
                                                 nsITimer::TYPE_ONE_SHOT_LOW_PRIORITY,
-                                                "IdleTaskRunner");
+                                                mName);
     }
   }
 }
 
 IdleTaskRunner::~IdleTaskRunner()
 {
   CancelTimer();
 }
@@ -196,14 +197,14 @@ IdleTaskRunner::SetTimerInternal(uint32_
   }
 
   if (mTimer) {
     if (TaskCategory::Count != mTaskCategory) {
       mTimer->SetTarget(SystemGroup::EventTargetFor(mTaskCategory));
     }
     mTimer->InitWithNamedFuncCallback(TimedOut, this, aDelay,
                                       nsITimer::TYPE_ONE_SHOT,
-                                      "IdleTaskRunner");
+                                      mName);
     mTimerActive = true;
   }
 }
 
 } // end of namespace mozilla
--- a/xpcom/threads/IdleTaskRunner.h
+++ b/xpcom/threads/IdleTaskRunner.h
@@ -62,13 +62,14 @@ private:
   CallbackType mCallback;
   uint32_t mDelay;
   TimeStamp mDeadline;
   TimeDuration mBudget;
   bool mRepeating;
   bool mTimerActive;
   MayStopProcessingCallbackType mMayStopProcessing;
   TaskCategory mTaskCategory;
+  const char* mName;
 };
 
 } // end of namespace mozilla.
 
 #endif