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

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

Issue 143573004: [wip] interpolable value refactor. NOT FOR LANDING. Base URL: https://chromium.googlesource.com/chromium/blink.git@interpolationWrap
Patch Set: Created 6 years, 11 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/Interpolation.h ('k') | Source/core/animation/InterpolationEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/animation/Interpolation.h ('k') | Source/core/animation/InterpolationEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698