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

Side by Side Diff: Source/core/animation/AnimatableRepeatable.h

Issue 204743002: Oilpan: Move AnimatableValue's hierarchy to oilpan's heap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 25 matching lines...) Expand all
36 36
37 namespace WebCore { 37 namespace WebCore {
38 38
39 // This class represents collections of values that animate in a repeated fashio n as described by the CSS Transitions spec: 39 // This class represents collections of values that animate in a repeated fashio n as described by the CSS Transitions spec:
40 // http://www.w3.org/TR/css3-transitions/#animtype-repeatable-list 40 // http://www.w3.org/TR/css3-transitions/#animtype-repeatable-list
41 class AnimatableRepeatable : public AnimatableValue { 41 class AnimatableRepeatable : public AnimatableValue {
42 public: 42 public:
43 virtual ~AnimatableRepeatable() { } 43 virtual ~AnimatableRepeatable() { }
44 44
45 // This will consume the vector passed into it. 45 // This will consume the vector passed into it.
46 static PassRefPtr<AnimatableRepeatable> create(Vector<RefPtr<AnimatableValue > >& values) 46 static PassRefPtrWillBeRawPtr<AnimatableRepeatable> create(WillBeHeapVector< RefPtrWillBeMember<AnimatableValue> >& values)
47 { 47 {
48 return adoptRef(new AnimatableRepeatable(values)); 48 return adoptRefWillBeNoop(new AnimatableRepeatable(values));
49 } 49 }
50 50
51 const Vector<RefPtr<AnimatableValue> >& values() const { return m_values; } 51 const WillBeHeapVector<RefPtrWillBeMember<AnimatableValue> >& values() const { return m_values; }
52
53 virtual void trace(Visitor*) OVERRIDE;
52 54
53 protected: 55 protected:
54 AnimatableRepeatable() 56 AnimatableRepeatable()
55 { 57 {
56 } 58 }
57 AnimatableRepeatable(Vector<RefPtr<AnimatableValue> >& values) 59 AnimatableRepeatable(WillBeHeapVector<RefPtrWillBeMember<AnimatableValue> >& values)
58 { 60 {
59 ASSERT(!values.isEmpty()); 61 ASSERT(!values.isEmpty());
60 m_values.swap(values); 62 m_values.swap(values);
61 } 63 }
62 64
63 static bool interpolateLists(const Vector<RefPtr<AnimatableValue> >& fromVal ues, const Vector<RefPtr<AnimatableValue> >& toValues, double fraction, Vector<R efPtr<AnimatableValue> >& interpolatedValues); 65 static bool interpolateLists(const WillBeHeapVector<RefPtrWillBeMember<Anima tableValue> >& fromValues, const WillBeHeapVector<RefPtrWillBeMember<AnimatableV alue> >& toValues, double fraction, WillBeHeapVector<RefPtrWillBeMember<Animatab leValue> >& interpolatedValues);
64 66
65 virtual bool usesDefaultInterpolationWith(const AnimatableValue*) const OVER RIDE; 67 virtual bool usesDefaultInterpolationWith(const AnimatableValue*) const OVER RIDE;
66 68
67 Vector<RefPtr<AnimatableValue> > m_values; 69 WillBeHeapVector<RefPtrWillBeMember<AnimatableValue> > m_values;
68 70
69 private: 71 private:
70 virtual PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, do uble fraction) const OVERRIDE; 72 virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const Animatab leValue*, double fraction) const OVERRIDE;
71 virtual PassRefPtr<AnimatableValue> addWith(const AnimatableValue*) const OV ERRIDE FINAL; 73 virtual PassRefPtrWillBeRawPtr<AnimatableValue> addWith(const AnimatableValu e*) const OVERRIDE FINAL;
72 74
73 virtual AnimatableType type() const OVERRIDE { return TypeRepeatable; } 75 virtual AnimatableType type() const OVERRIDE { return TypeRepeatable; }
74 virtual bool equalTo(const AnimatableValue*) const OVERRIDE FINAL; 76 virtual bool equalTo(const AnimatableValue*) const OVERRIDE FINAL;
75 }; 77 };
76 78
77 DEFINE_TYPE_CASTS(AnimatableRepeatable, AnimatableValue, value, (value->isRepeat able() || value->isStrokeDasharrayList()), (value.isRepeatable() || value.isStro keDasharrayList())); 79 DEFINE_TYPE_CASTS(AnimatableRepeatable, AnimatableValue, value, (value->isRepeat able() || value->isStrokeDasharrayList()), (value.isRepeatable() || value.isStro keDasharrayList()));
78 80
79 } // namespace WebCore 81 } // namespace WebCore
80 82
81 #endif // AnimatableRepeatable_h 83 #endif // AnimatableRepeatable_h
OLDNEW
« no previous file with comments | « Source/core/animation/AnimatableNeutralTest.cpp ('k') | Source/core/animation/AnimatableRepeatable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698