Index: Source/core/animation/InterpolationEffect.h |
diff --git a/Source/modules/quota/StorageErrorCallback.h b/Source/core/animation/InterpolationEffect.h |
similarity index 56% |
copy from Source/modules/quota/StorageErrorCallback.h |
copy to Source/core/animation/InterpolationEffect.h |
index ed72dda1eea747dc2c927400ac02253c4658c9ec..ce5e60d5d80746e7d504e30612e310cb5c7b48ed 100644 |
--- a/Source/modules/quota/StorageErrorCallback.h |
+++ b/Source/core/animation/InterpolationEffect.h |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright (C) 2013 Google Inc. All rights reserved. |
+ * Copyright (C) 2014 Google Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -28,42 +28,52 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef StorageErrorCallback_h |
-#define StorageErrorCallback_h |
+#ifndef InterpolationEffect_h |
+#define InterpolationEffect_h |
-#include "core/dom/ExecutionContext.h" |
-#include "core/dom/ExecutionContextTask.h" |
-#include "wtf/PassOwnPtr.h" |
#include "wtf/RefCounted.h" |
+#include "wtf/PassOwnPtr.h" |
+#include "Interpolation.h" |
namespace WebCore { |
-class DOMError; |
- |
-typedef int ExceptionCode; |
+class InterpolationEffect : public RefCounted<InterpolationEffect> { |
-class StorageErrorCallback { |
public: |
- virtual ~StorageErrorCallback() { } |
- virtual void handleEvent(DOMError*) = 0; |
+ static PassRefPtr<InterpolationEffect> create() { return adoptRef(new InterpolationEffect()); } |
+ |
+ PassOwnPtr<Vector<RefPtr<Interpolation> > > getActiveInterpolations(double fraction) const; |
+ |
+ void addInterpolation(PassRefPtr<Interpolation> interpolation, double start, double end) |
+ { |
+ m_interpolations.append(InterpolationRecord::create(interpolation, start, end)); |
+ } |
- class CallbackTask FINAL : public ExecutionContextTask { |
+private: |
+ InterpolationEffect() { } |
+ |
+ class InterpolationRecord : public RefCounted<InterpolationRecord> |
+ { |
public: |
- static PassOwnPtr<CallbackTask> create(PassOwnPtr<StorageErrorCallback> callback, ExceptionCode ec) |
+ RefPtr<Interpolation> m_interpolation; |
+ double m_start; |
+ double m_end; |
+ static PassRefPtr<InterpolationRecord> create(PassRefPtr<Interpolation> interpolation, double start, double end) |
{ |
- return adoptPtr(new CallbackTask(callback, ec)); |
+ return adoptRef(new InterpolationRecord(interpolation, start, end)); |
} |
- |
- virtual void performTask(ExecutionContext*) OVERRIDE; |
- |
private: |
- CallbackTask(PassOwnPtr<StorageErrorCallback>, ExceptionCode); |
+ InterpolationRecord(PassRefPtr<Interpolation> interpolation, double start, double end) |
+ : m_interpolation(interpolation) |
+ , m_start(start) |
+ , m_end(end) |
+ { } |
- OwnPtr<StorageErrorCallback> m_callback; |
- ExceptionCode m_ec; |
}; |
+ |
+ Vector<RefPtr<InterpolationRecord> > m_interpolations; |
}; |
-} // namespace WebCore |
+} |
-#endif // StorageErrorCallback_h |
+#endif |