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

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

Issue 1120003002: [Oilpan] Migrate most classes under core/animations to Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 4 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/IntegerSVGInterpolation.h ('k') | Source/core/animation/InterpolableValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/InterpolableValue.h
diff --git a/Source/core/animation/InterpolableValue.h b/Source/core/animation/InterpolableValue.h
index 5dd653e1cdbf441b4f7cc50a5fe713ec1cb1468b..7cc2c150746322f4bd7413a76455d04c3e10eb2c 100644
--- a/Source/core/animation/InterpolableValue.h
+++ b/Source/core/animation/InterpolableValue.h
@@ -14,16 +14,14 @@
namespace blink {
-class CORE_EXPORT InterpolableValue : public NoBaseWillBeGarbageCollected<InterpolableValue> {
- DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(InterpolableValue);
- WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(InterpolableValue);
+class CORE_EXPORT InterpolableValue : public GarbageCollected<InterpolableValue> {
public:
virtual bool isNumber() const { return false; }
virtual bool isBool() const { return false; }
virtual bool isList() const { return false; }
virtual bool isAnimatableValue() const { return false; }
- virtual PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const = 0;
+ virtual InterpolableValue* clone() const = 0;
DEFINE_INLINE_VIRTUAL_TRACE() { }
@@ -47,14 +45,14 @@ private:
class CORE_EXPORT InterpolableNumber final : public InterpolableValue {
public:
- static PassOwnPtrWillBeRawPtr<InterpolableNumber> create(double value)
+ static InterpolableNumber* create(double value)
{
- return adoptPtrWillBeNoop(new InterpolableNumber(value));
+ return new InterpolableNumber(value);
}
bool isNumber() const final { return true; }
double value() const { return m_value; }
- PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const final { return create(m_value); }
+ InterpolableValue* clone() const final { return create(m_value); }
private:
void interpolate(const InterpolableValue& to, const double progress, InterpolableValue& result) const final;
@@ -70,14 +68,14 @@ private:
class CORE_EXPORT InterpolableBool final : public InterpolableValue {
public:
- static PassOwnPtrWillBeRawPtr<InterpolableBool> create(bool value)
+ static InterpolableBool* create(bool value)
{
- return adoptPtrWillBeNoop(new InterpolableBool(value));
+ return new InterpolableBool(value);
}
bool isBool() const final { return true; }
bool value() const { return m_value; }
- PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const final { return create(m_value); }
+ InterpolableValue* clone() const final { return create(m_value); }
private:
void interpolate(const InterpolableValue& to, const double progress, InterpolableValue& result) const final;
@@ -101,18 +99,18 @@ public:
// has its own copy constructor. So just delete operator= here.
InterpolableList& operator=(const InterpolableList&) = delete;
- static PassOwnPtrWillBeRawPtr<InterpolableList> create(const InterpolableList &other)
+ static InterpolableList* create(const InterpolableList &other)
{
- return adoptPtrWillBeNoop(new InterpolableList(other));
+ return new InterpolableList(other);
}
- static PassOwnPtrWillBeRawPtr<InterpolableList> create(size_t size)
+ static InterpolableList* create(size_t size)
{
- return adoptPtrWillBeNoop(new InterpolableList(size));
+ return new InterpolableList(size);
}
bool isList() const final { return true; }
- void set(size_t position, PassOwnPtrWillBeRawPtr<InterpolableValue> value)
+ void set(size_t position, InterpolableValue* value)
{
ASSERT(position < m_size);
m_values[position] = value;
@@ -120,7 +118,7 @@ public:
const InterpolableValue* get(size_t position) const
{
ASSERT(position < m_size);
- return m_values[position].get();
+ return m_values[position];
}
InterpolableValue* get(size_t position)
{
@@ -128,7 +126,7 @@ public:
return m_values[position].get();
}
size_t length() const { return m_size; }
- PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const final { return create(*this); }
+ InterpolableValue* clone() const final { return create(*this); }
DECLARE_VIRTUAL_TRACE();
@@ -150,32 +148,33 @@ private:
}
size_t m_size;
- WillBeHeapVector<OwnPtrWillBeMember<InterpolableValue>> m_values;
+ HeapVector<Member<InterpolableValue>> m_values;
};
// FIXME: Remove this when we can.
class InterpolableAnimatableValue : public InterpolableValue {
public:
- static PassOwnPtrWillBeRawPtr<InterpolableAnimatableValue> create(PassRefPtrWillBeRawPtr<AnimatableValue> value)
+ static InterpolableAnimatableValue* create(AnimatableValue* value)
{
- return adoptPtrWillBeNoop(new InterpolableAnimatableValue(value));
+ return new InterpolableAnimatableValue(value);
}
bool isAnimatableValue() const final { return true; }
- AnimatableValue* value() const { return m_value.get(); }
- PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const final { return create(m_value); }
+ AnimatableValue* value() const { return m_value; }
+ InterpolableValue* clone() const final { return create(m_value); }
DECLARE_VIRTUAL_TRACE();
private:
void interpolate(const InterpolableValue &to, const double progress, InterpolableValue& result) const final;
void scaleAndAdd(double scale, const InterpolableValue& other) final { ASSERT_NOT_REACHED(); }
- RefPtrWillBeMember<AnimatableValue> m_value;
- InterpolableAnimatableValue(PassRefPtrWillBeRawPtr<AnimatableValue> value)
+ InterpolableAnimatableValue(AnimatableValue* value)
: m_value(value)
{
}
+
+ Member<AnimatableValue> m_value;
};
DEFINE_TYPE_CASTS(InterpolableNumber, InterpolableValue, value, value->isNumber(), value.isNumber());
« no previous file with comments | « Source/core/animation/IntegerSVGInterpolation.h ('k') | Source/core/animation/InterpolableValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698