Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Unified Diff: Source/core/animation/Player.cpp

Issue 48523004: Have Player take the DocumentTimeline object by reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/animation/Player.h ('k') | Source/core/animation/PlayerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/Player.cpp
diff --git a/Source/core/animation/Player.cpp b/Source/core/animation/Player.cpp
index e7c43df3edfe508df76074e5a3bd9bcba518ef4e..7b924ac2e1566cab1b9398f1740c8748256d270c 100644
--- a/Source/core/animation/Player.cpp
+++ b/Source/core/animation/Player.cpp
@@ -37,17 +37,16 @@
namespace WebCore {
-PassRefPtr<Player> Player::create(DocumentTimeline* timeline, TimedItem* content)
+PassRefPtr<Player> Player::create(DocumentTimeline& timeline, TimedItem* content)
{
- ASSERT(timeline);
return adoptRef(new Player(timeline, content));
}
-Player::Player(DocumentTimeline* timeline, TimedItem* content)
+Player::Player(DocumentTimeline& timeline, TimedItem* content)
: m_pauseStartTime(nullValue())
, m_playbackRate(1)
, m_timeDrift(0)
- , m_startTime(effectiveTime(timeline->currentTime()))
+ , m_startTime(effectiveTime(timeline.currentTime()))
, m_content(content)
, m_timeline(timeline)
, m_isPausedForTesting(false)
@@ -66,7 +65,7 @@ Player::~Player()
double Player::currentTimeBeforeDrift() const
{
- return (effectiveTime(m_timeline->currentTime()) - m_startTime) * m_playbackRate;
+ return (effectiveTime(m_timeline.currentTime()) - m_startTime) * m_playbackRate;
}
double Player::pausedTimeDrift() const
@@ -93,7 +92,7 @@ bool Player::update(double* timeToEffectChange)
return false;
}
- double newTime = isNull(m_timeline->currentTime()) ? nullValue() : currentTime();
+ double newTime = isNull(m_timeline.currentTime()) ? nullValue() : currentTime();
m_content->updateInheritedTime(newTime);
if (timeToEffectChange)
*timeToEffectChange = m_content->timeToEffectChange();
« no previous file with comments | « Source/core/animation/Player.h ('k') | Source/core/animation/PlayerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698