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

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

Issue 2649103007: Make PropertyHandle instances const references where possible (Closed)
Patch Set: Created 3 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 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 bool isReplaceOnly(); 77 bool isReplaceOnly();
78 78
79 PropertyHandleSet properties() const; 79 PropertyHandleSet properties() const;
80 80
81 using KeyframeVector = Vector<RefPtr<Keyframe>>; 81 using KeyframeVector = Vector<RefPtr<Keyframe>>;
82 const KeyframeVector& getFrames() const { return m_keyframes; } 82 const KeyframeVector& getFrames() const { return m_keyframes; }
83 void setFrames(KeyframeVector& keyframes); 83 void setFrames(KeyframeVector& keyframes);
84 84
85 const PropertySpecificKeyframeVector& getPropertySpecificKeyframes( 85 const PropertySpecificKeyframeVector& getPropertySpecificKeyframes(
86 PropertyHandle property) const { 86 const PropertyHandle& property) const {
87 ensureKeyframeGroups(); 87 ensureKeyframeGroups();
88 return m_keyframeGroups->get(property)->keyframes(); 88 return m_keyframeGroups->get(property)->keyframes();
89 } 89 }
90 90
91 using KeyframeGroupMap = 91 using KeyframeGroupMap =
92 HashMap<PropertyHandle, std::unique_ptr<PropertySpecificKeyframeGroup>>; 92 HashMap<PropertyHandle, std::unique_ptr<PropertySpecificKeyframeGroup>>;
93 const KeyframeGroupMap& getPropertySpecificKeyframeGroups() const { 93 const KeyframeGroupMap& getPropertySpecificKeyframeGroups() const {
94 ensureKeyframeGroups(); 94 ensureKeyframeGroups();
95 return *m_keyframeGroups; 95 return *m_keyframeGroups;
96 } 96 }
(...skipping 24 matching lines...) Expand all
121 const ComputedStyle* parentStyle) const; 121 const ComputedStyle* parentStyle) const;
122 bool snapshotAllCompositorKeyframes(Element&, 122 bool snapshotAllCompositorKeyframes(Element&,
123 const ComputedStyle& baseStyle, 123 const ComputedStyle& baseStyle,
124 const ComputedStyle* parentStyle) const; 124 const ComputedStyle* parentStyle) const;
125 125
126 static KeyframeVector normalizedKeyframesForInspector( 126 static KeyframeVector normalizedKeyframesForInspector(
127 const KeyframeVector& keyframes) { 127 const KeyframeVector& keyframes) {
128 return normalizedKeyframes(keyframes); 128 return normalizedKeyframes(keyframes);
129 } 129 }
130 130
131 bool affects(PropertyHandle property) const override { 131 bool affects(const PropertyHandle& property) const override {
132 ensureKeyframeGroups(); 132 ensureKeyframeGroups();
133 return m_keyframeGroups->contains(property); 133 return m_keyframeGroups->contains(property);
134 } 134 }
135 135
136 bool isTransformRelatedEffect() const override; 136 bool isTransformRelatedEffect() const override;
137 137
138 protected: 138 protected:
139 KeyframeEffectModelBase(PassRefPtr<TimingFunction> defaultKeyframeEasing) 139 KeyframeEffectModelBase(PassRefPtr<TimingFunction> defaultKeyframeEasing)
140 : m_lastIteration(0), 140 : m_lastIteration(0),
141 m_lastFraction(std::numeric_limits<double>::quiet_NaN()), 141 m_lastFraction(std::numeric_limits<double>::quiet_NaN()),
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 249
250 template <> 250 template <>
251 inline bool KeyframeEffectModel<StringKeyframe>::isStringKeyframeEffectModel() 251 inline bool KeyframeEffectModel<StringKeyframe>::isStringKeyframeEffectModel()
252 const { 252 const {
253 return true; 253 return true;
254 } 254 }
255 255
256 } // namespace blink 256 } // namespace blink
257 257
258 #endif // KeyframeEffectModel_h 258 #endif // KeyframeEffectModel_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698