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

Side by Side Diff: third_party/WebKit/Source/core/animation/css/CSSAnimationData.cpp

Issue 1844223002: Literal AtomicString construction can rely on strlen optimization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 // 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 #include "core/animation/css/CSSAnimationData.h" 5 #include "core/animation/css/CSSAnimationData.h"
6 6
7 #include "core/animation/Timing.h" 7 #include "core/animation/Timing.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 11 matching lines...) Expand all
22 , m_nameList(other.m_nameList) 22 , m_nameList(other.m_nameList)
23 , m_iterationCountList(other.m_iterationCountList) 23 , m_iterationCountList(other.m_iterationCountList)
24 , m_directionList(other.m_directionList) 24 , m_directionList(other.m_directionList)
25 , m_fillModeList(other.m_fillModeList) 25 , m_fillModeList(other.m_fillModeList)
26 , m_playStateList(other.m_playStateList) 26 , m_playStateList(other.m_playStateList)
27 { 27 {
28 } 28 }
29 29
30 const AtomicString& CSSAnimationData::initialName() 30 const AtomicString& CSSAnimationData::initialName()
31 { 31 {
32 DEFINE_STATIC_LOCAL(const AtomicString, name, ("none", AtomicString::Constru ctFromLiteral)); 32 DEFINE_STATIC_LOCAL(const AtomicString, name, ("none"));
33 return name; 33 return name;
34 } 34 }
35 35
36 bool CSSAnimationData::animationsMatchForStyleRecalc(const CSSAnimationData& oth er) const 36 bool CSSAnimationData::animationsMatchForStyleRecalc(const CSSAnimationData& oth er) const
37 { 37 {
38 return m_nameList == other.m_nameList && m_playStateList == other.m_playStat eList 38 return m_nameList == other.m_nameList && m_playStateList == other.m_playStat eList
39 && m_iterationCountList == other.m_iterationCountList 39 && m_iterationCountList == other.m_iterationCountList
40 && m_directionList == other.m_directionList 40 && m_directionList == other.m_directionList
41 && m_fillModeList == other.m_fillModeList 41 && m_fillModeList == other.m_fillModeList
42 && delayList() == other.delayList() 42 && delayList() == other.delayList()
43 && durationList() == other.durationList(); 43 && durationList() == other.durationList();
44 } 44 }
45 45
46 Timing CSSAnimationData::convertToTiming(size_t index) const 46 Timing CSSAnimationData::convertToTiming(size_t index) const
47 { 47 {
48 ASSERT(index < m_nameList.size()); 48 ASSERT(index < m_nameList.size());
49 Timing timing = CSSTimingData::convertToTiming(index); 49 Timing timing = CSSTimingData::convertToTiming(index);
50 50
51 timing.iterationCount = getRepeated(m_iterationCountList, index); 51 timing.iterationCount = getRepeated(m_iterationCountList, index);
52 timing.direction = getRepeated(m_directionList, index); 52 timing.direction = getRepeated(m_directionList, index);
53 timing.fillMode = getRepeated(m_fillModeList, index); 53 timing.fillMode = getRepeated(m_fillModeList, index);
54 timing.assertValid(); 54 timing.assertValid();
55 return timing; 55 return timing;
56 } 56 }
57 57
58 } // namespace blink 58 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698