Bug 1366750 - Rename nsIIncrementalRunnable to nsIIdleRunnable. r=smaug
authorAndreas Farre <farre@mozilla.com>
Tue, 16 May 2017 17:18:33 +0200
changeset 360198 6a30c71b11e26932888a47ddba9b3d7a1a13d0d2
parent 360085 4f874bc1e42463e30bc5595e84e5aaa450d81167
child 360199 87380800d29122fcb9690e29ebfa96f45162106f
push id31872
push userryanvm@gmail.com
push dateTue, 23 May 2017 22:11:58 +0000
treeherdermozilla-central@96e18bec9fc8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1366750
milestone55.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 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
dom/base/nsGlobalWindow.cpp
xpcom/threads/moz.build
xpcom/threads/nsIIdleRunnable.h
xpcom/threads/nsIIncrementalRunnable.h
xpcom/threads/nsThread.cpp
xpcom/threads/nsThreadUtils.cpp
xpcom/threads/nsThreadUtils.h
--- a/dom/base/IdleRequest.h
+++ b/dom/base/IdleRequest.h
@@ -8,17 +8,16 @@
 #define mozilla_dom_idlerequest_h
 
 #include "mozilla/LinkedList.h"
 #include "mozilla/Maybe.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDOMNavigationTiming.h"
 #include "nsICancelableRunnable.h"
-#include "nsIIncrementalRunnable.h"
 #include "nsIRunnable.h"
 #include "nsString.h"
 
 class nsPIDOMWindowInner;
 
 namespace mozilla {
 namespace dom {
 
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -558,17 +558,17 @@ NS_IMPL_RELEASE_INHERITED(IdleRequestExe
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(IdleRequestExecutorTimeoutHandler)
 NS_INTERFACE_MAP_END_INHERITING(TimeoutHandler)
 
 
 class IdleRequestExecutor final : public nsIRunnable
                                 , public nsICancelableRunnable
                                 , public nsINamed
-                                , public nsIIncrementalRunnable
+                                , public nsIIdleRunnable
 {
 public:
   explicit IdleRequestExecutor(nsGlobalWindow* aWindow)
     : mDispatched(false)
     , mDeadline(TimeStamp::Now())
     , mWindow(aWindow)
   {
     MOZ_DIAGNOSTIC_ASSERT(mWindow);
@@ -645,17 +645,17 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDelayedExecutorDispatcher)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 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
 
 NS_IMETHODIMP
 IdleRequestExecutor::GetName(nsACString& aName)
 {
     aName.AssignASCII("IdleRequestExecutor");
     return NS_OK;
--- a/xpcom/threads/moz.build
+++ b/xpcom/threads/moz.build
@@ -20,17 +20,17 @@ XPIDL_SOURCES += [
 ]
 
 XPIDL_MODULE = 'xpcom_threads'
 
 EXPORTS += [
     'MainThreadUtils.h',
     'nsEventQueue.h',
     'nsICancelableRunnable.h',
-    'nsIIncrementalRunnable.h',
+    'nsIIdleRunnable.h',
     'nsMemoryPressure.h',
     'nsProcess.h',
     'nsProxyRelease.h',
     'nsThread.h',
     'nsThreadUtils.h',
 ]
 
 EXPORTS.mozilla += [
new file mode 100644
--- /dev/null
+++ b/xpcom/threads/nsIIdleRunnable.h
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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 nsIIdleRunnable_h__
+#define nsIIdleRunnable_h__
+
+#include "nsISupports.h"
+#include "mozilla/TimeStamp.h"
+
+#define NS_IIDLERUNNABLE_IID \
+{ 0x688be92e, 0x7ade, 0x4fdc, \
+{ 0x9d, 0x83, 0x74, 0xcb, 0xef, 0xf4, 0xa5, 0x2c } }
+
+
+/**
+ * A task interface for tasks that can schedule their work to happen
+ * in increments bounded by a deadline.
+ */
+class nsIIdleRunnable : public nsISupports
+{
+public:
+  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIDLERUNNABLE_IID)
+
+  /**
+   * Notify the task of a point in time in the future when the task
+   * should stop executing.
+   */
+  virtual void SetDeadline(mozilla::TimeStamp aDeadline) = 0;
+
+protected:
+  nsIIdleRunnable() { }
+  virtual ~nsIIdleRunnable() {}
+};
+
+NS_DEFINE_STATIC_IID_ACCESSOR(nsIIdleRunnable,
+                              NS_IIDLERUNNABLE_IID)
+
+#endif // nsIIdleRunnable_h__
deleted file mode 100644
--- a/xpcom/threads/nsIIncrementalRunnable.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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__
-
-#include "nsISupports.h"
-#include "mozilla/TimeStamp.h"
-
-#define NS_IINCREMENTALRUNNABLE_IID \
-{ 0x688be92e, 0x7ade, 0x4fdc, \
-{ 0x9d, 0x83, 0x74, 0xcb, 0xef, 0xf4, 0xa5, 0x2c } }
-
-
-/**
- * A task interface for tasks that can schedule their work to happen
- * in increments bounded by a deadline.
- */
-class nsIIncrementalRunnable : public nsISupports
-{
-public:
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IINCREMENTALRUNNABLE_IID)
-
-  /**
-   * Notify the task of a point in time in the future when the task
-   * should stop executing.
-   */
-  virtual void SetDeadline(mozilla::TimeStamp aDeadline) = 0;
-
-protected:
-  nsIIncrementalRunnable() { }
-  virtual ~nsIIncrementalRunnable() {}
-};
-
-NS_DEFINE_STATIC_IID_ACCESSOR(nsIIncrementalRunnable,
-                              NS_IINCREMENTALRUNNABLE_IID)
-
-#endif // nsIIncrementalRunnable_h__
--- a/xpcom/threads/nsThread.cpp
+++ b/xpcom/threads/nsThread.cpp
@@ -32,17 +32,17 @@
 #include "mozilla/Services.h"
 #include "nsXPCOMPrivate.h"
 #include "mozilla/ChaosMode.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/TimeStamp.h"
 #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"
 
 #ifdef MOZ_CRASHREPORTER
 #include "nsServiceManagerUtils.h"
 #include "nsICrashReporter.h"
 #include "mozilla/dom/ContentChild.h"
@@ -1152,17 +1152,17 @@ nsThread::GetIdleEvent(nsIRunnable** aEv
   if (!idleDeadline || idleDeadline < TimeStamp::Now()) {
     aEvent = nullptr;
     return;
   }
 
   mIdleEvents.GetEvent(false, aEvent, aProofOfLock);
 
   if (*aEvent) {
-    nsCOMPtr<nsIIncrementalRunnable> incrementalEvent(do_QueryInterface(*aEvent));
+    nsCOMPtr<nsIIdleRunnable> incrementalEvent(do_QueryInterface(*aEvent));
     if (incrementalEvent) {
       incrementalEvent->SetDeadline(idleDeadline);
     }
   }
 }
 
 void
 nsThread::GetEvent(bool aWait, nsIRunnable** aEvent,
--- a/xpcom/threads/nsThreadUtils.cpp
+++ b/xpcom/threads/nsThreadUtils.cpp
@@ -79,21 +79,21 @@ NS_IMPL_ISUPPORTS_INHERITED(CancelableRu
 
 nsresult
 CancelableRunnable::Cancel()
 {
   // Do nothing
   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
 }
 
 #endif  // XPCOM_GLUE_AVOID_NSPR
 
 //-----------------------------------------------------------------------------
 
--- a/xpcom/threads/nsThreadUtils.h
+++ b/xpcom/threads/nsThreadUtils.h
@@ -7,17 +7,17 @@
 #ifndef nsThreadUtils_h__
 #define nsThreadUtils_h__
 
 #include "prthread.h"
 #include "prinrval.h"
 #include "MainThreadUtils.h"
 #include "nsICancelableRunnable.h"
 #include "nsIIdlePeriod.h"
-#include "nsIIncrementalRunnable.h"
+#include "nsIIdleRunnable.h"
 #include "nsINamed.h"
 #include "nsIRunnable.h"
 #include "nsIThreadManager.h"
 #include "nsIThread.h"
 #include "nsStringGlue.h"
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "mozilla/Atomics.h"
@@ -374,32 +374,32 @@ protected:
   virtual ~CancelableRunnable() {}
 private:
   CancelableRunnable(const CancelableRunnable&) = delete;
   CancelableRunnable& operator=(const CancelableRunnable&) = delete;
   CancelableRunnable& operator=(const CancelableRunnable&&) = delete;
 };
 
 // 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 {
 
 // An event that can be used to call a C++11 functions or function objects,
 // including lambdas. The function must have no required arguments, and must
 // return void.
 template<typename StoredFunction>