Bug 1415780 - Rename DelayedEventsDispatcher to AnimationEventDispatcher. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Sat, 27 Jan 2018 21:17:27 +0900
changeset 748021 c2e87e459e0c9ec94709c0959ae893ee6061055f
parent 748020 ce27253273f6e9185f8f0e6fbbedf9705f25f334
child 748022 d3fa8509b00b6c0ec70d4bf44fc96e17b25a1b39
push id97048
push userhikezoe@mozilla.com
push dateSat, 27 Jan 2018 12:23:10 +0000
reviewersbirtles
bugs1415780, 1354501
milestone60.0a1
Bug 1415780 - Rename DelayedEventsDispatcher to AnimationEventDispatcher. r?birtles We plan to use this class to dispatch web animation API events as well (bug 1354501). MozReview-Commit-ID: 7DMmc0aJzJ5
layout/style/AnimationCommon.h
--- a/layout/style/AnimationCommon.h
+++ b/layout/style/AnimationCommon.h
@@ -22,17 +22,17 @@
 #include "nsCSSPseudoElements.h"
 #include "nsCycleCollectionParticipant.h"
 
 class nsIFrame;
 class nsPresContext;
 
 namespace mozilla {
 enum class CSSPseudoElementType : uint8_t;
-template <class EventInfo> class DelayedEventDispatcher;
+template <class EventInfo> class AnimationEventDispatcher;
 
 namespace dom {
 class Element;
 }
 
 template <class AnimationType, class AnimationEventType>
 class CommonAnimationManager {
 public:
@@ -103,17 +103,17 @@ protected:
            mElementCollections.getFirst()) {
       head->Destroy(); // Note: this removes 'head' from mElementCollections.
     }
   }
 
   LinkedList<AnimationCollection<AnimationType>> mElementCollections;
   nsPresContext *mPresContext; // weak (non-null from ctor to Disconnect)
 
-  mozilla::DelayedEventDispatcher<AnimationEventType> mEventDispatcher;
+  mozilla::AnimationEventDispatcher<AnimationEventType> mEventDispatcher;
 };
 
 /**
  * Utility class for referencing the element that created a CSS animation or
  * transition. It is non-owning (i.e. it uses a raw pointer) since it is only
  * expected to be set by the owned animation while it actually being managed
  * by the owning element.
  *
@@ -175,20 +175,20 @@ public:
     return nsContentUtils::GetContextForContent(mTarget.mElement);
   }
 
 private:
   NonOwningAnimationTarget mTarget;
 };
 
 template <class EventInfo>
-class DelayedEventDispatcher
+class AnimationEventDispatcher
 {
 public:
-  DelayedEventDispatcher() : mIsSorted(true) { }
+  AnimationEventDispatcher() : mIsSorted(true) { }
 
   void QueueEvents(nsTArray<EventInfo>&& aEvents)
   {
     mPendingEvents.AppendElements(Forward<nsTArray<EventInfo>>(aEvents));
     mIsSorted = false;
   }
 
   // This is exposed as a separate method so that when we are dispatching
@@ -275,25 +275,25 @@ protected:
 
   typedef nsTArray<EventInfo> EventArray;
   EventArray mPendingEvents;
   bool mIsSorted;
 };
 
 template <class EventInfo>
 inline void
-ImplCycleCollectionUnlink(DelayedEventDispatcher<EventInfo>& aField)
+ImplCycleCollectionUnlink(AnimationEventDispatcher<EventInfo>& aField)
 {
   aField.Unlink();
 }
 
 template <class EventInfo>
 inline void
 ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
-                            DelayedEventDispatcher<EventInfo>& aField,
+                            AnimationEventDispatcher<EventInfo>& aField,
                             const char* aName,
                             uint32_t aFlags = 0)
 {
   aField.Traverse(&aCallback, aName);
 }
 
 // Return the TransitionPhase or AnimationPhase to use when the animation
 // doesn't have a target effect.