bug 1270916 - allow tracking when a mutation event was fired relative to other mutation events r=davidb a=jcristau
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Thu, 10 Nov 2016 14:44:20 -0500
changeset 352964 3cb1bc7e7fc8ac98ec1edab7d3240361703360a2
parent 352963 f195b9640e6d388912aa81eb65150b39e2b5dd1b
child 352965 166148afee65e1b08260d5c5c8543e4d2154df62
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidb, jcristau
bugs1270916
milestone52.0a2
bug 1270916 - allow tracking when a mutation event was fired relative to other mutation events r=davidb a=jcristau
accessible/base/AccEvent.h
--- a/accessible/base/AccEvent.h
+++ b/accessible/base/AccEvent.h
@@ -206,33 +206,40 @@ private:
 /**
  * A base class for events related to tree mutation, either an AccMutation
  * event, or an AccReorderEvent.
  */
 class AccTreeMutationEvent : public AccEvent
 {
 public:
   AccTreeMutationEvent(uint32_t aEventType, Accessible* aTarget) :
-    AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceReorder) {}
+    AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceReorder), mGeneration(0) {}
 
   // Event
   static const EventGroup kEventGroup = eTreeMutationEvent;
   virtual unsigned int GetEventGroups() const override
   {
     return AccEvent::GetEventGroups() | (1U << eTreeMutationEvent);
   }
 
   void SetNextEvent(AccTreeMutationEvent* aNext) { mNextEvent = aNext; }
   void SetPrevEvent(AccTreeMutationEvent* aPrev) { mPrevEvent = aPrev; }
   AccTreeMutationEvent* NextEvent() const { return mNextEvent; }
   AccTreeMutationEvent* PrevEvent() const { return mPrevEvent; }
 
+  /**
+   * A sequence number to know when this event was fired.
+   */
+  uint32_t EventGeneration() const { return mGeneration; }
+  void SetEventGeneration(uint32_t aGeneration) { mGeneration = aGeneration; }
+
 private:
   RefPtr<AccTreeMutationEvent> mNextEvent;
   RefPtr<AccTreeMutationEvent> mPrevEvent;
+  uint32_t mGeneration;
 };
 
 /**
  * Base class for show and hide accessible events.
  */
 class AccMutationEvent: public AccTreeMutationEvent
 {
 public: