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

Side by Side Diff: third_party/WebKit/Source/core/animation/KeyframeEffectModel.h

Issue 2286233002: Replaced PassRefPtr copies with moves in Source/core/animation. (Closed)
Patch Set: Created 4 years, 3 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
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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 friend class KeyframeEffectModelTest; 153 friend class KeyframeEffectModelTest;
154 }; 154 };
155 155
156 // Time independent representation of an Animation's keyframes. 156 // Time independent representation of an Animation's keyframes.
157 template <class Keyframe> 157 template <class Keyframe>
158 class KeyframeEffectModel final : public KeyframeEffectModelBase { 158 class KeyframeEffectModel final : public KeyframeEffectModelBase {
159 public: 159 public:
160 using KeyframeVector = Vector<RefPtr<Keyframe>>; 160 using KeyframeVector = Vector<RefPtr<Keyframe>>;
161 static KeyframeEffectModel<Keyframe>* create(const KeyframeVector& keyframes , PassRefPtr<TimingFunction> defaultKeyframeEasing = nullptr) 161 static KeyframeEffectModel<Keyframe>* create(const KeyframeVector& keyframes , PassRefPtr<TimingFunction> defaultKeyframeEasing = nullptr)
162 { 162 {
163 return new KeyframeEffectModel(keyframes, defaultKeyframeEasing); 163 return new KeyframeEffectModel(keyframes, std::move(defaultKeyframeEasin g));
164 } 164 }
165 165
166 private: 166 private:
167 KeyframeEffectModel(const KeyframeVector& keyframes, PassRefPtr<TimingFuncti on> defaultKeyframeEasing) 167 KeyframeEffectModel(const KeyframeVector& keyframes, PassRefPtr<TimingFuncti on> defaultKeyframeEasing)
168 : KeyframeEffectModelBase(defaultKeyframeEasing) 168 : KeyframeEffectModelBase(std::move(defaultKeyframeEasing))
169 { 169 {
170 m_keyframes.appendVector(keyframes); 170 m_keyframes.appendVector(keyframes);
171 } 171 }
172 172
173 virtual bool isAnimatableValueKeyframeEffectModel() const { return false; } 173 virtual bool isAnimatableValueKeyframeEffectModel() const { return false; }
174 virtual bool isStringKeyframeEffectModel() const { return false; } 174 virtual bool isStringKeyframeEffectModel() const { return false; }
175 }; 175 };
176 176
177 using KeyframeVector = KeyframeEffectModelBase::KeyframeVector; 177 using KeyframeVector = KeyframeEffectModelBase::KeyframeVector;
178 using PropertySpecificKeyframeVector = KeyframeEffectModelBase::PropertySpecific KeyframeVector; 178 using PropertySpecificKeyframeVector = KeyframeEffectModelBase::PropertySpecific KeyframeVector;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 template <> 212 template <>
213 inline bool KeyframeEffectModel<AnimatableValueKeyframe>::isAnimatableValueKeyfr ameEffectModel() const { return true; } 213 inline bool KeyframeEffectModel<AnimatableValueKeyframe>::isAnimatableValueKeyfr ameEffectModel() const { return true; }
214 214
215 template <> 215 template <>
216 inline bool KeyframeEffectModel<StringKeyframe>::isStringKeyframeEffectModel() c onst { return true; } 216 inline bool KeyframeEffectModel<StringKeyframe>::isStringKeyframeEffectModel() c onst { return true; }
217 217
218 } // namespace blink 218 } // namespace blink
219 219
220 #endif // KeyframeEffectModel_h 220 #endif // KeyframeEffectModel_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698