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

Unified Diff: third_party/WebKit/Source/core/animation/StringKeyframe.h

Issue 1701813002: Make Keyframe::PropertySpecificKeyframes RefCounted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: InvalidatableInterpolation RefPtrs Created 4 years, 10 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: third_party/WebKit/Source/core/animation/StringKeyframe.h
diff --git a/third_party/WebKit/Source/core/animation/StringKeyframe.h b/third_party/WebKit/Source/core/animation/StringKeyframe.h
index 23b65d4fb6f71d795de6bce8d4e0341802d95eeb..c7568dddcde40e36f4d0c1d560e163973bb60c01 100644
--- a/third_party/WebKit/Source/core/animation/StringKeyframe.h
+++ b/third_party/WebKit/Source/core/animation/StringKeyframe.h
@@ -50,7 +50,10 @@ public:
class CSSPropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe {
public:
- CSSPropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, CSSValue*, EffectModel::CompositeOperation);
+ static PassRefPtr<CSSPropertySpecificKeyframe> create(double offset, PassRefPtr<TimingFunction> easing, CSSValue* value, EffectModel::CompositeOperation composite)
+ {
+ return adoptRef(new CSSPropertySpecificKeyframe(offset, easing, value, composite));
+ }
CSSValue* value() const { return m_value.get(); }
@@ -59,13 +62,16 @@ public:
void setAnimatableValue(PassRefPtr<AnimatableValue> value) { m_animatableValueCache = value; }
bool isNeutral() const final { return !m_value; }
- PassOwnPtr<Keyframe::PropertySpecificKeyframe> neutralKeyframe(double offset, PassRefPtr<TimingFunction> easing) const final;
+ PassRefPtr<Keyframe::PropertySpecificKeyframe> neutralKeyframe(double offset, PassRefPtr<TimingFunction> easing) const final;
PassRefPtr<Interpolation> maybeCreateInterpolation(PropertyHandle, Keyframe::PropertySpecificKeyframe& end, Element*, const ComputedStyle* baseStyle) const final;
private:
- CSSPropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, CSSValue*);
+ CSSPropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, CSSValue* value, EffectModel::CompositeOperation composite)
+ : Keyframe::PropertySpecificKeyframe(offset, easing, composite)
+ , m_value(value)
+ { }
- virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> cloneWithOffset(double offset) const;
+ virtual PassRefPtr<Keyframe::PropertySpecificKeyframe> cloneWithOffset(double offset) const;
bool isCSSPropertySpecificKeyframe() const override { return true; }
PassRefPtr<Interpolation> createLegacyStyleInterpolation(CSSPropertyID, Keyframe::PropertySpecificKeyframe& end, Element*, const ComputedStyle* baseStyle) const;
@@ -79,20 +85,26 @@ public:
class SVGPropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe {
public:
- SVGPropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, const String&, EffectModel::CompositeOperation);
+ static PassRefPtr<SVGPropertySpecificKeyframe> create(double offset, PassRefPtr<TimingFunction> easing, const String& value, EffectModel::CompositeOperation composite)
+ {
+ return adoptRef(new SVGPropertySpecificKeyframe(offset, easing, value, composite));
+ }
const String& value() const { return m_value; }
- PassOwnPtr<PropertySpecificKeyframe> cloneWithOffset(double offset) const final;
+ PassRefPtr<PropertySpecificKeyframe> cloneWithOffset(double offset) const final;
const PassRefPtr<AnimatableValue> getAnimatableValue() const final { return nullptr; }
bool isNeutral() const final { return m_value.isNull(); }
- PassOwnPtr<PropertySpecificKeyframe> neutralKeyframe(double offset, PassRefPtr<TimingFunction> easing) const final;
+ PassRefPtr<PropertySpecificKeyframe> neutralKeyframe(double offset, PassRefPtr<TimingFunction> easing) const final;
PassRefPtr<Interpolation> maybeCreateInterpolation(PropertyHandle, Keyframe::PropertySpecificKeyframe& end, Element*, const ComputedStyle* baseStyle) const final;
private:
- SVGPropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, const String&);
+ SVGPropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, const String& value, EffectModel::CompositeOperation composite)
+ : Keyframe::PropertySpecificKeyframe(offset, easing, composite)
+ , m_value(value)
+ { }
bool isSVGPropertySpecificKeyframe() const override { return true; }
@@ -108,7 +120,7 @@ private:
StringKeyframe(const StringKeyframe& copyFrom);
PassRefPtr<Keyframe> clone() const override;
- PassOwnPtr<Keyframe::PropertySpecificKeyframe> createPropertySpecificKeyframe(PropertyHandle) const override;
+ PassRefPtr<Keyframe::PropertySpecificKeyframe> createPropertySpecificKeyframe(PropertyHandle) const override;
bool isStringKeyframe() const override { return true; }

Powered by Google App Engine
This is Rietveld 408576698