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

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

Issue 630993005: Replace FINAL and OVERRIDE with their C++11 counterparts in Source/core/animation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added cpp to list Created 6 years, 2 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
« no previous file with comments | « Source/core/animation/InertAnimation.h ('k') | Source/core/animation/KeyframeEffectModel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef InterpolableValue_h 5 #ifndef InterpolableValue_h
6 #define InterpolableValue_h 6 #define InterpolableValue_h
7 7
8 #include "core/animation/animatable/AnimatableValue.h" 8 #include "core/animation/animatable/AnimatableValue.h"
9 #include "wtf/OwnPtr.h" 9 #include "wtf/OwnPtr.h"
10 #include "wtf/PassOwnPtr.h" 10 #include "wtf/PassOwnPtr.h"
(...skipping 26 matching lines...) Expand all
37 friend class InterpolableList; 37 friend class InterpolableList;
38 }; 38 };
39 39
40 class InterpolableNumber : public InterpolableValue { 40 class InterpolableNumber : public InterpolableValue {
41 public: 41 public:
42 static PassOwnPtrWillBeRawPtr<InterpolableNumber> create(double value) 42 static PassOwnPtrWillBeRawPtr<InterpolableNumber> create(double value)
43 { 43 {
44 return adoptPtrWillBeNoop(new InterpolableNumber(value)); 44 return adoptPtrWillBeNoop(new InterpolableNumber(value));
45 } 45 }
46 46
47 virtual bool isNumber() const OVERRIDE FINAL { return true; } 47 virtual bool isNumber() const override final { return true; }
48 double value() const { return m_value; } 48 double value() const { return m_value; }
49 virtual PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const OVERRIDE FIN AL { return create(m_value); } 49 virtual PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const override fin al { return create(m_value); }
50 50
51 virtual void trace(Visitor* visitor) OVERRIDE { InterpolableValue::trace(vis itor); } 51 virtual void trace(Visitor* visitor) override { InterpolableValue::trace(vis itor); }
52 52
53 private: 53 private:
54 virtual PassOwnPtrWillBeRawPtr<InterpolableValue> interpolate(const Interpol ableValue &to, const double progress) const OVERRIDE FINAL; 54 virtual PassOwnPtrWillBeRawPtr<InterpolableValue> interpolate(const Interpol ableValue &to, const double progress) const override final;
55 double m_value; 55 double m_value;
56 56
57 explicit InterpolableNumber(double value) 57 explicit InterpolableNumber(double value)
58 : m_value(value) 58 : m_value(value)
59 { 59 {
60 } 60 }
61 61
62 }; 62 };
63 63
64 class InterpolableBool : public InterpolableValue { 64 class InterpolableBool : public InterpolableValue {
65 public: 65 public:
66 static PassOwnPtrWillBeRawPtr<InterpolableBool> create(bool value) 66 static PassOwnPtrWillBeRawPtr<InterpolableBool> create(bool value)
67 { 67 {
68 return adoptPtrWillBeNoop(new InterpolableBool(value)); 68 return adoptPtrWillBeNoop(new InterpolableBool(value));
69 } 69 }
70 70
71 virtual bool isBool() const OVERRIDE FINAL { return true; } 71 virtual bool isBool() const override final { return true; }
72 bool value() const { return m_value; } 72 bool value() const { return m_value; }
73 virtual PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const OVERRIDE FIN AL { return create(m_value); } 73 virtual PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const override fin al { return create(m_value); }
74 74
75 virtual void trace(Visitor* visitor) OVERRIDE { InterpolableValue::trace(vis itor); } 75 virtual void trace(Visitor* visitor) override { InterpolableValue::trace(vis itor); }
76 76
77 private: 77 private:
78 virtual PassOwnPtrWillBeRawPtr<InterpolableValue> interpolate(const Interpol ableValue &to, const double progress) const OVERRIDE FINAL; 78 virtual PassOwnPtrWillBeRawPtr<InterpolableValue> interpolate(const Interpol ableValue &to, const double progress) const override final;
79 bool m_value; 79 bool m_value;
80 80
81 explicit InterpolableBool(bool value) 81 explicit InterpolableBool(bool value)
82 : m_value(value) 82 : m_value(value)
83 { 83 {
84 } 84 }
85 85
86 }; 86 };
87 87
88 class InterpolableList : public InterpolableValue { 88 class InterpolableList : public InterpolableValue {
89 public: 89 public:
90 static PassOwnPtrWillBeRawPtr<InterpolableList> create(const InterpolableLis t &other) 90 static PassOwnPtrWillBeRawPtr<InterpolableList> create(const InterpolableLis t &other)
91 { 91 {
92 return adoptPtrWillBeNoop(new InterpolableList(other)); 92 return adoptPtrWillBeNoop(new InterpolableList(other));
93 } 93 }
94 94
95 static PassOwnPtrWillBeRawPtr<InterpolableList> create(size_t size) 95 static PassOwnPtrWillBeRawPtr<InterpolableList> create(size_t size)
96 { 96 {
97 return adoptPtrWillBeNoop(new InterpolableList(size)); 97 return adoptPtrWillBeNoop(new InterpolableList(size));
98 } 98 }
99 99
100 virtual bool isList() const OVERRIDE FINAL { return true; } 100 virtual bool isList() const override final { return true; }
101 void set(size_t position, PassOwnPtrWillBeRawPtr<InterpolableValue> value) 101 void set(size_t position, PassOwnPtrWillBeRawPtr<InterpolableValue> value)
102 { 102 {
103 ASSERT(position < m_size); 103 ASSERT(position < m_size);
104 m_values[position] = value; 104 m_values[position] = value;
105 } 105 }
106 const InterpolableValue* get(size_t position) const 106 const InterpolableValue* get(size_t position) const
107 { 107 {
108 ASSERT(position < m_size); 108 ASSERT(position < m_size);
109 return m_values[position].get(); 109 return m_values[position].get();
110 } 110 }
111 size_t length() const { return m_size; } 111 size_t length() const { return m_size; }
112 virtual PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const OVERRIDE FIN AL { return create(*this); } 112 virtual PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const override fin al { return create(*this); }
113 113
114 virtual void trace(Visitor*) OVERRIDE; 114 virtual void trace(Visitor*) override;
115 115
116 private: 116 private:
117 virtual PassOwnPtrWillBeRawPtr<InterpolableValue> interpolate(const Interpol ableValue &other, const double progress) const OVERRIDE FINAL; 117 virtual PassOwnPtrWillBeRawPtr<InterpolableValue> interpolate(const Interpol ableValue &other, const double progress) const override final;
118 explicit InterpolableList(size_t size) 118 explicit InterpolableList(size_t size)
119 : m_size(size) 119 : m_size(size)
120 , m_values(m_size) 120 , m_values(m_size)
121 { 121 {
122 } 122 }
123 123
124 InterpolableList(const InterpolableList& other) 124 InterpolableList(const InterpolableList& other)
125 : m_size(other.m_size) 125 : m_size(other.m_size)
126 , m_values(m_size) 126 , m_values(m_size)
127 { 127 {
128 for (size_t i = 0; i < m_size; i++) 128 for (size_t i = 0; i < m_size; i++)
129 set(i, other.m_values[i]->clone()); 129 set(i, other.m_values[i]->clone());
130 } 130 }
131 131
132 size_t m_size; 132 size_t m_size;
133 WillBeHeapVector<OwnPtrWillBeMember<InterpolableValue> > m_values; 133 WillBeHeapVector<OwnPtrWillBeMember<InterpolableValue> > m_values;
134 }; 134 };
135 135
136 // FIXME: Remove this when we can. 136 // FIXME: Remove this when we can.
137 class InterpolableAnimatableValue : public InterpolableValue { 137 class InterpolableAnimatableValue : public InterpolableValue {
138 public: 138 public:
139 static PassOwnPtrWillBeRawPtr<InterpolableAnimatableValue> create(PassRefPtr WillBeRawPtr<AnimatableValue> value) 139 static PassOwnPtrWillBeRawPtr<InterpolableAnimatableValue> create(PassRefPtr WillBeRawPtr<AnimatableValue> value)
140 { 140 {
141 return adoptPtrWillBeNoop(new InterpolableAnimatableValue(value)); 141 return adoptPtrWillBeNoop(new InterpolableAnimatableValue(value));
142 } 142 }
143 143
144 virtual bool isAnimatableValue() const OVERRIDE FINAL { return true; } 144 virtual bool isAnimatableValue() const override final { return true; }
145 AnimatableValue* value() const { return m_value.get(); } 145 AnimatableValue* value() const { return m_value.get(); }
146 virtual PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const OVERRIDE FIN AL { return create(m_value); } 146 virtual PassOwnPtrWillBeRawPtr<InterpolableValue> clone() const override fin al { return create(m_value); }
147 147
148 virtual void trace(Visitor*) OVERRIDE; 148 virtual void trace(Visitor*) override;
149 149
150 private: 150 private:
151 virtual PassOwnPtrWillBeRawPtr<InterpolableValue> interpolate(const Interpol ableValue &other, const double progress) const OVERRIDE FINAL; 151 virtual PassOwnPtrWillBeRawPtr<InterpolableValue> interpolate(const Interpol ableValue &other, const double progress) const override final;
152 RefPtrWillBeMember<AnimatableValue> m_value; 152 RefPtrWillBeMember<AnimatableValue> m_value;
153 153
154 InterpolableAnimatableValue(PassRefPtrWillBeRawPtr<AnimatableValue> value) 154 InterpolableAnimatableValue(PassRefPtrWillBeRawPtr<AnimatableValue> value)
155 : m_value(value) 155 : m_value(value)
156 { 156 {
157 } 157 }
158 }; 158 };
159 159
160 DEFINE_TYPE_CASTS(InterpolableNumber, InterpolableValue, value, value->isNumber( ), value.isNumber()); 160 DEFINE_TYPE_CASTS(InterpolableNumber, InterpolableValue, value, value->isNumber( ), value.isNumber());
161 DEFINE_TYPE_CASTS(InterpolableBool, InterpolableValue, value, value->isBool(), v alue.isBool()); 161 DEFINE_TYPE_CASTS(InterpolableBool, InterpolableValue, value, value->isBool(), v alue.isBool());
162 DEFINE_TYPE_CASTS(InterpolableList, InterpolableValue, value, value->isList(), v alue.isList()); 162 DEFINE_TYPE_CASTS(InterpolableList, InterpolableValue, value, value->isList(), v alue.isList());
163 DEFINE_TYPE_CASTS(InterpolableAnimatableValue, InterpolableValue, value, value-> isAnimatableValue(), value.isAnimatableValue()); 163 DEFINE_TYPE_CASTS(InterpolableAnimatableValue, InterpolableValue, value, value-> isAnimatableValue(), value.isAnimatableValue());
164 164
165 } 165 }
166 166
167 #endif 167 #endif
OLDNEW
« no previous file with comments | « Source/core/animation/InertAnimation.h ('k') | Source/core/animation/KeyframeEffectModel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698