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

Side by Side Diff: Source/core/css/CSSKeyframesRule.cpp

Issue 1152993002: Add a counter for CSSKeyframesRule's anonymous indexed getter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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
« no previous file with comments | « Source/core/css/CSSKeyframesRule.h ('k') | Source/core/css/CSSKeyframesRule.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2012 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 return 0; 188 return 0;
189 189
190 ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size( )); 190 ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size( ));
191 RefPtrWillBeMember<CSSKeyframeRule>& rule = m_childRuleCSSOMWrappers[index]; 191 RefPtrWillBeMember<CSSKeyframeRule>& rule = m_childRuleCSSOMWrappers[index];
192 if (!rule) 192 if (!rule)
193 rule = adoptRefWillBeNoop(new CSSKeyframeRule(m_keyframesRule->keyframes ()[index].get(), const_cast<CSSKeyframesRule*>(this))); 193 rule = adoptRefWillBeNoop(new CSSKeyframeRule(m_keyframesRule->keyframes ()[index].get(), const_cast<CSSKeyframesRule*>(this)));
194 194
195 return rule.get(); 195 return rule.get();
196 } 196 }
197 197
198 CSSKeyframeRule* CSSKeyframesRule::anonymousIndexedGetter(unsigned index) const
199 {
200 if (UseCounter* useCounter = UseCounter::getFrom(parentStyleSheet()))
201 useCounter->count(UseCounter::CSSKeyframesRuleAnonymousIndexedGetter);
202 return item(index);
203 }
204
198 CSSRuleList* CSSKeyframesRule::cssRules() const 205 CSSRuleList* CSSKeyframesRule::cssRules() const
199 { 206 {
200 if (!m_ruleListCSSOMWrapper) 207 if (!m_ruleListCSSOMWrapper)
201 m_ruleListCSSOMWrapper = LiveCSSRuleList<CSSKeyframesRule>::create(const _cast<CSSKeyframesRule*>(this)); 208 m_ruleListCSSOMWrapper = LiveCSSRuleList<CSSKeyframesRule>::create(const _cast<CSSKeyframesRule*>(this));
202 return m_ruleListCSSOMWrapper.get(); 209 return m_ruleListCSSOMWrapper.get();
203 } 210 }
204 211
205 void CSSKeyframesRule::reattach(StyleRuleBase* rule) 212 void CSSKeyframesRule::reattach(StyleRuleBase* rule)
206 { 213 {
207 ASSERT(rule); 214 ASSERT(rule);
208 m_keyframesRule = toStyleRuleKeyframes(rule); 215 m_keyframesRule = toStyleRuleKeyframes(rule);
209 } 216 }
210 217
211 DEFINE_TRACE(CSSKeyframesRule) 218 DEFINE_TRACE(CSSKeyframesRule)
212 { 219 {
213 CSSRule::trace(visitor); 220 CSSRule::trace(visitor);
214 #if ENABLE(OILPAN) 221 #if ENABLE(OILPAN)
215 visitor->trace(m_childRuleCSSOMWrappers); 222 visitor->trace(m_childRuleCSSOMWrappers);
216 #endif 223 #endif
217 visitor->trace(m_keyframesRule); 224 visitor->trace(m_keyframesRule);
218 visitor->trace(m_ruleListCSSOMWrapper); 225 visitor->trace(m_ruleListCSSOMWrapper);
219 } 226 }
220 227
221 } // namespace blink 228 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/CSSKeyframesRule.h ('k') | Source/core/css/CSSKeyframesRule.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698