Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / animation / AnimationNode.h
index 4c54854..1348094 100644 (file)
 #ifndef AnimationNode_h
 #define AnimationNode_h
 
+#include "bindings/core/v8/ScriptWrappable.h"
 #include "core/animation/Timing.h"
 #include "platform/heap/Handle.h"
 #include "wtf/OwnPtr.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/RefCounted.h"
 
-namespace WebCore {
+namespace blink {
 
 class AnimationPlayer;
 class AnimationNode;
@@ -58,7 +59,7 @@ static inline double nullValue()
     return std::numeric_limits<double>::quiet_NaN();
 }
 
-class AnimationNode : public RefCountedWillBeGarbageCollectedFinalized<AnimationNode> {
+class AnimationNode : public RefCountedWillBeGarbageCollectedFinalized<AnimationNode>, public ScriptWrappable {
     friend class AnimationPlayer; // Calls attach/detach, updateInheritedTime.
 public:
     // Note that logic in CSSAnimations depends on the order of these values.
@@ -69,10 +70,11 @@ public:
         PhaseNone,
     };
 
-    class EventDelegate {
+    class EventDelegate : public NoBaseWillBeGarbageCollectedFinalized<EventDelegate> {
     public:
-        virtual ~EventDelegate() { };
+        virtual ~EventDelegate() { }
         virtual void onEventCondition(const AnimationNode*) = 0;
+        virtual void trace(Visitor*) { }
     };
 
     virtual ~AnimationNode() { }
@@ -102,7 +104,6 @@ public:
 
     const AnimationPlayer* player() const { return m_player; }
     AnimationPlayer* player() { return m_player; }
-    AnimationPlayer* player(bool& isNull) { isNull = !m_player; return m_player; }
     const Timing& specifiedTiming() const { return m_timing; }
     PassRefPtrWillBeRawPtr<AnimationNodeTiming> timing();
     void updateSpecifiedTiming(const Timing&);
@@ -114,7 +115,7 @@ public:
     virtual void trace(Visitor*);
 
 protected:
-    explicit AnimationNode(const Timing&, PassOwnPtr<EventDelegate> = nullptr);
+    explicit AnimationNode(const Timing&, PassOwnPtrWillBeRawPtr<EventDelegate> = nullptr);
 
     // When AnimationNode receives a new inherited time via updateInheritedTime
     // it will (if necessary) recalculate timings and (if necessary) call
@@ -147,7 +148,7 @@ protected:
     const double m_startTime;
     RawPtrWillBeMember<AnimationPlayer> m_player;
     Timing m_timing;
-    OwnPtr<EventDelegate> m_eventDelegate;
+    OwnPtrWillBeMember<EventDelegate> m_eventDelegate;
 
     mutable struct CalculatedTiming {
         Phase phase;
@@ -166,6 +167,6 @@ protected:
     const CalculatedTiming& ensureCalculated() const;
 };
 
-} // namespace WebCore
+} // namespace blink
 
 #endif