From 5a1916b791cbd9c3818f4e983952c18bbd612134 Mon Sep 17 00:00:00 2001 From: Andreas Farre Date: Tue, 16 May 2017 17:18:33 +0200 Subject: [PATCH] Bug 1366750 - Rename nsIIncrementalRunnable to nsIIdleRunnable. r=smaug The name nsIIdleRunnable makes more sense, since its main use is in nsIThread::idleDispatch. MozReview-Commit-ID: H6qchxKnt7a --- dom/base/IdleRequest.h | 1 - dom/base/nsGlobalWindow.cpp | 4 ++-- xpcom/threads/moz.build | 2 +- ...ncrementalRunnable.h => nsIIdleRunnable.h} | 20 +++++++++---------- xpcom/threads/nsThread.cpp | 4 ++-- xpcom/threads/nsThreadUtils.cpp | 6 +++--- xpcom/threads/nsThreadUtils.h | 18 ++++++++--------- 7 files changed, 27 insertions(+), 28 deletions(-) rename xpcom/threads/{nsIIncrementalRunnable.h => nsIIdleRunnable.h} (64%) diff --git a/dom/base/IdleRequest.h b/dom/base/IdleRequest.h index 40f910bf286c..07eb3745c853 100644 --- a/dom/base/IdleRequest.h +++ b/dom/base/IdleRequest.h @@ -13,7 +13,6 @@ #include "nsCycleCollectionParticipant.h" #include "nsDOMNavigationTiming.h" #include "nsICancelableRunnable.h" -#include "nsIIncrementalRunnable.h" #include "nsIRunnable.h" #include "nsString.h" diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 777929766652..b151f79fd347 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -563,7 +563,7 @@ NS_INTERFACE_MAP_END_INHERITING(TimeoutHandler) class IdleRequestExecutor final : public nsIRunnable , public nsICancelableRunnable , public nsINamed - , public nsIIncrementalRunnable + , public nsIIdleRunnable { public: explicit IdleRequestExecutor(nsGlobalWindow* aWindow) @@ -650,7 +650,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(IdleRequestExecutor) NS_INTERFACE_MAP_ENTRY(nsIRunnable) NS_INTERFACE_MAP_ENTRY(nsICancelableRunnable) NS_INTERFACE_MAP_ENTRY(nsINamed) - NS_INTERFACE_MAP_ENTRY(nsIIncrementalRunnable) + NS_INTERFACE_MAP_ENTRY(nsIIdleRunnable) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIRunnable) NS_INTERFACE_MAP_END diff --git a/xpcom/threads/moz.build b/xpcom/threads/moz.build index e397b334b950..ae205b4e7890 100644 --- a/xpcom/threads/moz.build +++ b/xpcom/threads/moz.build @@ -25,7 +25,7 @@ EXPORTS += [ 'MainThreadUtils.h', 'nsEventQueue.h', 'nsICancelableRunnable.h', - 'nsIIncrementalRunnable.h', + 'nsIIdleRunnable.h', 'nsMemoryPressure.h', 'nsProcess.h', 'nsProxyRelease.h', diff --git a/xpcom/threads/nsIIncrementalRunnable.h b/xpcom/threads/nsIIdleRunnable.h similarity index 64% rename from xpcom/threads/nsIIncrementalRunnable.h rename to xpcom/threads/nsIIdleRunnable.h index 526bc165eda9..08daf264fd9f 100644 --- a/xpcom/threads/nsIIncrementalRunnable.h +++ b/xpcom/threads/nsIIdleRunnable.h @@ -4,13 +4,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef nsIIncrementalRunnable_h__ -#define nsIIncrementalRunnable_h__ +#ifndef nsIIdleRunnable_h__ +#define nsIIdleRunnable_h__ #include "nsISupports.h" #include "mozilla/TimeStamp.h" -#define NS_IINCREMENTALRUNNABLE_IID \ +#define NS_IIDLERUNNABLE_IID \ { 0x688be92e, 0x7ade, 0x4fdc, \ { 0x9d, 0x83, 0x74, 0xcb, 0xef, 0xf4, 0xa5, 0x2c } } @@ -19,10 +19,10 @@ * A task interface for tasks that can schedule their work to happen * in increments bounded by a deadline. */ -class nsIIncrementalRunnable : public nsISupports +class nsIIdleRunnable : public nsISupports { public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_IINCREMENTALRUNNABLE_IID) + NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIDLERUNNABLE_IID) /** * Notify the task of a point in time in the future when the task @@ -31,11 +31,11 @@ public: virtual void SetDeadline(mozilla::TimeStamp aDeadline) = 0; protected: - nsIIncrementalRunnable() { } - virtual ~nsIIncrementalRunnable() {} + nsIIdleRunnable() { } + virtual ~nsIIdleRunnable() {} }; -NS_DEFINE_STATIC_IID_ACCESSOR(nsIIncrementalRunnable, - NS_IINCREMENTALRUNNABLE_IID) +NS_DEFINE_STATIC_IID_ACCESSOR(nsIIdleRunnable, + NS_IIDLERUNNABLE_IID) -#endif // nsIIncrementalRunnable_h__ +#endif // nsIIdleRunnable_h__ diff --git a/xpcom/threads/nsThread.cpp b/xpcom/threads/nsThread.cpp index ee48fd82e362..a3c3f30cc639 100644 --- a/xpcom/threads/nsThread.cpp +++ b/xpcom/threads/nsThread.cpp @@ -37,7 +37,7 @@ #include "mozilla/Unused.h" #include "mozilla/dom/ScriptSettings.h" #include "nsIIdlePeriod.h" -#include "nsIIncrementalRunnable.h" +#include "nsIIdleRunnable.h" #include "nsThreadSyncDispatch.h" #include "LeakRefPtr.h" #include "GeckoProfiler.h" @@ -1157,7 +1157,7 @@ nsThread::GetIdleEvent(nsIRunnable** aEvent, MutexAutoLock& aProofOfLock) mIdleEvents.GetEvent(false, aEvent, aProofOfLock); if (*aEvent) { - nsCOMPtr incrementalEvent(do_QueryInterface(*aEvent)); + nsCOMPtr incrementalEvent(do_QueryInterface(*aEvent)); if (incrementalEvent) { incrementalEvent->SetDeadline(idleDeadline); } diff --git a/xpcom/threads/nsThreadUtils.cpp b/xpcom/threads/nsThreadUtils.cpp index 5c0856e30440..a1b05d5e10dc 100644 --- a/xpcom/threads/nsThreadUtils.cpp +++ b/xpcom/threads/nsThreadUtils.cpp @@ -84,11 +84,11 @@ CancelableRunnable::Cancel() return NS_OK; } -NS_IMPL_ISUPPORTS_INHERITED(IncrementalRunnable, CancelableRunnable, - nsIIncrementalRunnable) +NS_IMPL_ISUPPORTS_INHERITED(IdleRunnable, CancelableRunnable, + nsIIdleRunnable) void -IncrementalRunnable::SetDeadline(TimeStamp aDeadline) +IdleRunnable::SetDeadline(TimeStamp aDeadline) { // Do nothing } diff --git a/xpcom/threads/nsThreadUtils.h b/xpcom/threads/nsThreadUtils.h index d84508a19f70..3e9730f4b32d 100644 --- a/xpcom/threads/nsThreadUtils.h +++ b/xpcom/threads/nsThreadUtils.h @@ -12,7 +12,7 @@ #include "MainThreadUtils.h" #include "nsICancelableRunnable.h" #include "nsIIdlePeriod.h" -#include "nsIIncrementalRunnable.h" +#include "nsIIdleRunnable.h" #include "nsINamed.h" #include "nsIRunnable.h" #include "nsIThreadManager.h" @@ -379,22 +379,22 @@ private: }; // This class is designed to be subclassed. -class IncrementalRunnable : public CancelableRunnable, - public nsIIncrementalRunnable +class IdleRunnable : public CancelableRunnable, + public nsIIdleRunnable { public: NS_DECL_ISUPPORTS_INHERITED - // nsIIncrementalRunnable + // nsIIdleRunnable virtual void SetDeadline(TimeStamp aDeadline) override; - IncrementalRunnable() {} + IdleRunnable() {} protected: - virtual ~IncrementalRunnable() {} + virtual ~IdleRunnable() {} private: - IncrementalRunnable(const IncrementalRunnable&) = delete; - IncrementalRunnable& operator=(const IncrementalRunnable&) = delete; - IncrementalRunnable& operator=(const IncrementalRunnable&&) = delete; + IdleRunnable(const IdleRunnable&) = delete; + IdleRunnable& operator=(const IdleRunnable&) = delete; + IdleRunnable& operator=(const IdleRunnable&&) = delete; }; namespace detail {