Bug 1109390 part 7 - Rename PendingPlayerTracker's Start* methods to Trigger*; r=jwatt
authorBrian Birtles <birtles@gmail.com>
Fri, 27 Mar 2015 15:56:45 +0900
changeset 266393 92fd678cb47cdd74d12d22ded5656b76dc09a896
parent 266392 ff6b730f3a891749c00940dda54595e4c3e0cab7
child 266394 38f3018ddf8576c93f0ae3f972a42bf3583c9f45
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs1109390
milestone39.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 1109390 part 7 - Rename PendingPlayerTracker's Start* methods to Trigger*; r=jwatt These methods will soon be used to start animations that are waiting to start and also to finish pausing animations that are waiting to pause. As a result we rename them to TriggerXXX since that's a bit more generic. There are still references to StartXXX within PendingPlayerTracker. These will be updated in a subsequent patch once we have the appropriate methods available on AnimationPlayer to call.
dom/animation/PendingPlayerTracker.cpp
dom/animation/PendingPlayerTracker.h
dom/base/nsDOMWindowUtils.cpp
layout/base/nsDisplayList.cpp
--- a/dom/animation/PendingPlayerTracker.cpp
+++ b/dom/animation/PendingPlayerTracker.cpp
@@ -53,44 +53,45 @@ StartPlayerAtTime(nsRefPtrHashKey<dom::A
 {
   dom::AnimationPlayer* player = aKey->GetKey();
   dom::AnimationTimeline* timeline = player->Timeline();
 
   // When the timeline's refresh driver is under test control, its values
   // have no correspondance to wallclock times so we shouldn't try to convert
   // aReadyTime (which is a wallclock time) to a timeline value. Instead, the
   // animation player will be started when the refresh driver is next
-  // advanced since this will trigger a call to StartPendingPlayersNow.
+  // advanced since this will trigger a call to TriggerPendingPlayersNow.
   if (timeline->IsUnderTestControl()) {
     return PL_DHASH_NEXT;
   }
 
   Nullable<TimeDuration> readyTime =
     timeline->ToTimelineTime(*static_cast<const TimeStamp*>(aReadyTime));
   player->StartOnNextTick(readyTime);
 
   return PL_DHASH_REMOVE;
 }
 
 void
-PendingPlayerTracker::StartPendingPlayersOnNextTick(const TimeStamp& aReadyTime)
+PendingPlayerTracker::TriggerPendingPlayersOnNextTick(const TimeStamp&
+                                                        aReadyTime)
 {
   mPlayPendingSet.EnumerateEntries(StartPlayerAtTime,
                                    const_cast<TimeStamp*>(&aReadyTime));
 }
 
 PLDHashOperator
 StartPlayerNow(nsRefPtrHashKey<dom::AnimationPlayer>* aKey, void*)
 {
   aKey->GetKey()->StartNow();
   return PL_DHASH_NEXT;
 }
 
 void
-PendingPlayerTracker::StartPendingPlayersNow()
+PendingPlayerTracker::TriggerPendingPlayersNow()
 {
   mPlayPendingSet.EnumerateEntries(StartPlayerNow, nullptr);
   mPlayPendingSet.Clear();
 }
 
 void
 PendingPlayerTracker::EnsurePaintIsScheduled()
 {
--- a/dom/animation/PendingPlayerTracker.h
+++ b/dom/animation/PendingPlayerTracker.h
@@ -50,18 +50,18 @@ public:
   {
     RemovePending(aPlayer, mPausePendingSet);
   }
   bool IsWaitingToPause(const dom::AnimationPlayer& aPlayer) const
   {
     return IsWaiting(aPlayer, mPausePendingSet);
   }
 
-  void StartPendingPlayersOnNextTick(const TimeStamp& aReadyTime);
-  void StartPendingPlayersNow();
+  void TriggerPendingPlayersOnNextTick(const TimeStamp& aReadyTime);
+  void TriggerPendingPlayersNow();
   bool HasPendingPlayers() const {
     return mPlayPendingSet.Count() > 0 || mPausePendingSet.Count() > 0;
   }
 
 private:
   ~PendingPlayerTracker() { }
 
   void EnsurePaintIsScheduled();
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2590,17 +2590,17 @@ nsDOMWindowUtils::AdvanceTimeAndRefresh(
   // player's 'ready' promise before continuing. Then we could remove the
   // special handling here and the code path followed when testing would
   // more closely match the code path during regular operation. Filed as
   // bug 1112957.
   nsCOMPtr<nsIDocument> doc = GetDocument();
   if (doc) {
     PendingPlayerTracker* tracker = doc->GetPendingPlayerTracker();
     if (tracker) {
-      tracker->StartPendingPlayersNow();
+      tracker->TriggerPendingPlayersNow();
     }
   }
 
   nsRefreshDriver* driver = GetPresContext()->RefreshDriver();
   driver->AdvanceTimeAndRefresh(aMilliseconds);
 
   RefPtr<LayerTransactionChild> transaction = GetLayerTransaction();
   if (transaction && transaction->IPCOpen()) {
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -1543,41 +1543,41 @@ nsDisplayList::ComputeVisibilityForSubli
     AppendToBottom(item);
   }
 
   mIsOpaque = !aVisibleRegion->Intersects(aListVisibleBounds);
   return anyVisible;
 }
 
 static bool
-StartPendingAnimationsOnSubDocuments(nsIDocument* aDocument, void* aReadyTime)
+TriggerPendingAnimationsOnSubDocuments(nsIDocument* aDocument, void* aReadyTime)
 {
   PendingPlayerTracker* tracker = aDocument->GetPendingPlayerTracker();
   if (tracker) {
     nsIPresShell* shell = aDocument->GetShell();
     // If paint-suppression is in effect then we haven't finished painting
     // this document yet so we shouldn't start animations
     if (!shell || !shell->IsPaintingSuppressed()) {
       const TimeStamp& readyTime = *static_cast<TimeStamp*>(aReadyTime);
-      tracker->StartPendingPlayersOnNextTick(readyTime);
+      tracker->TriggerPendingPlayersOnNextTick(readyTime);
     }
   }
-  aDocument->EnumerateSubDocuments(StartPendingAnimationsOnSubDocuments,
+  aDocument->EnumerateSubDocuments(TriggerPendingAnimationsOnSubDocuments,
                                    aReadyTime);
   return true;
 }
 
 static void
-StartPendingAnimations(nsIDocument* aDocument,
+TriggerPendingAnimations(nsIDocument* aDocument,
                        const TimeStamp& aReadyTime) {
   MOZ_ASSERT(!aReadyTime.IsNull(),
              "Animation ready time is not set. Perhaps we're using a layer"
              " manager that doesn't update it");
-  StartPendingAnimationsOnSubDocuments(aDocument,
-                                       const_cast<TimeStamp*>(&aReadyTime));
+  TriggerPendingAnimationsOnSubDocuments(aDocument,
+                                         const_cast<TimeStamp*>(&aReadyTime));
 }
 
 /**
  * We paint by executing a layer manager transaction, constructing a
  * single layer representing the display list, and then making it the
  * root of the layer manager, drawing into the PaintedLayers.
  */
 already_AddRefed<LayerManager> nsDisplayList::PaintRoot(nsDisplayListBuilder* aBuilder,
@@ -1766,17 +1766,17 @@ already_AddRefed<LayerManager> nsDisplay
   MaybeSetupTransactionIdAllocator(layerManager, view);
 
   layerManager->EndTransaction(FrameLayerBuilder::DrawPaintedLayer,
                                aBuilder, flags);
   aBuilder->SetIsCompositingCheap(temp);
   layerBuilder->DidEndTransaction();
 
   if (document && widgetTransaction) {
-    StartPendingAnimations(document, layerManager->GetAnimationReadyTime());
+    TriggerPendingAnimations(document, layerManager->GetAnimationReadyTime());
   }
 
   nsIntRegion invalid;
   if (props) {
     invalid = props->ComputeDifferences(root, computeInvalidFunc);
   } else if (widgetTransaction) {
     LayerProperties::ClearInvalidations(root);
   }