Bug 927349 part 6 - Rename AnimationPlayer::ResolveStartTime to AnimationPlayer::StartNow; r=jwatt
authorBrian Birtles <birtles@gmail.com>
Thu, 18 Dec 2014 08:42:41 +0900
changeset 220288 19407030d97a2c2f66d3207e9a39201e09b8e7ef
parent 220287 f47c180eb1c3b82538f9562dce44e2fad7cc61ab
child 220289 1e4ce2a592b820029a7b864f3af6aceeeb9c0160
push id27983
push usercbook@mozilla.com
push dateThu, 18 Dec 2014 12:51:14 +0000
treeherdermozilla-central@9bb8b0b4daae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs927349
milestone37.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 927349 part 6 - Rename AnimationPlayer::ResolveStartTime to AnimationPlayer::StartNow; r=jwatt ResolveStartTime is a bit hard to understand. Eventually, once we implement SetStartTime, we can probably remove this method altogether and just use that. This renaming moves us closer to that direction. This patch also adjusts a comment about the preconditions for calling StartNow. This is because in a subsequent patch in this series we will update the assertion at the beginning of StartNow to simply check that the player is pending.
dom/animation/AnimationPlayer.cpp
dom/animation/AnimationPlayer.h
--- a/dom/animation/AnimationPlayer.cpp
+++ b/dom/animation/AnimationPlayer.cpp
@@ -134,17 +134,17 @@ void
 AnimationPlayer::Tick()
 {
   if (mSource) {
     mSource->SetParentTime(GetCurrentTime());
   }
 }
 
 void
-AnimationPlayer::ResolveStartTime()
+AnimationPlayer::StartNow()
 {
   // Currently we only expect this method to be called when we are in the
   // middle of initiating/resuming playback so we should have an unresolved
   // start time to update and a fixed current time to seek to.
   MOZ_ASSERT(mStartTime.IsNull() && !mHoldTime.IsNull(),
              "Resolving the start time but we don't appear to be waiting"
              " to begin playback");
 
@@ -243,17 +243,17 @@ AnimationPlayer::DoPlay()
   } else if (mHoldTime.IsNull()) {
     // If the hold time is null, we are already playing normally
     return;
   }
 
   // Clear ready promise. We'll create a new one lazily.
   mReady = nullptr;
 
-  ResolveStartTime();
+  StartNow();
 }
 
 void
 AnimationPlayer::DoPause()
 {
   if (mIsPending) {
     CancelPendingPlay();
     // Resolve the ready promise since we currently only use it for
--- a/dom/animation/AnimationPlayer.h
+++ b/dom/animation/AnimationPlayer.h
@@ -83,20 +83,20 @@ public:
   virtual void PlayFromJS() { Play(); }
   // PauseFromJS is currently only here for symmetry with PlayFromJS but
   // in future we will likely have to flush style in
   // CSSAnimationPlayer::PauseFromJS so we leave it for now.
   void PauseFromJS() { Pause(); }
 
   void SetSource(Animation* aSource);
   void Tick();
-  // Sets the start time of the player to the current time of its timeline.
-  // This should only be called on a player that is currently waiting to play
-  // (and therefore has a null start time but a fixed hold time).
-  void ResolveStartTime();
+
+  // Sets the start time of a player that is waiting to play to the current
+  // time of its timeline.
+  void StartNow();
   void Cancel();
 
   const nsString& Name() const {
     return mSource ? mSource->Name() : EmptyString();
   }
 
   bool IsPaused() const { return PlayState() == AnimationPlayState::Paused; }
   bool IsRunning() const;