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

Unified Diff: Source/core/animation/TimedItem.h

Issue 21156005: Web Animations: Add an event delegate to allow different forms of event dispatch (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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
Index: Source/core/animation/TimedItem.h
diff --git a/Source/core/animation/TimedItem.h b/Source/core/animation/TimedItem.h
index 58ca31476bbc71563f7b0afd67016647bc1ee031..f2db3588be5adde8f952747380e4451af20524be 100644
--- a/Source/core/animation/TimedItem.h
+++ b/Source/core/animation/TimedItem.h
@@ -32,6 +32,7 @@
#define TimedItem_h
#include "core/animation/Timing.h"
+#include "wtf/PassOwnPtr.h"
#include "wtf/RefCounted.h"
namespace WebCore {
@@ -48,6 +49,12 @@ static inline double nullValue()
return std::numeric_limits<double>::quiet_NaN();
}
+class TimedItemEventDelegate {
+public:
+ virtual ~TimedItemEventDelegate() { };
+ virtual void onEventCondition(bool wasInPlay, bool isInPlay, double previousIteration, double currentIteration) = 0;
+};
+
class TimedItem : public RefCounted<TimedItem> {
friend class Player; // Calls attach/detach, updateInheritedTime.
public:
@@ -72,7 +79,7 @@ public:
};
protected:
- TimedItem(const Timing&);
+ TimedItem(const Timing&, PassOwnPtr<TimedItemEventDelegate>);
// When TimedItem receives a new inherited time via updateInheritedTime
// it will (if necessary) recalculate timings and (if necessary) call
@@ -96,6 +103,7 @@ private:
const double m_startTime;
Player* m_player;
Timing m_specified;
+ OwnPtr<TimedItemEventDelegate> m_eventDelegate;
// FIXME: Should be versioned by monotonic value on player.
mutable struct CalculatedTiming {

Powered by Google App Engine
This is Rietveld 408576698