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

Side by Side Diff: Source/core/animation/css/CSSAnimations.cpp

Issue 25040006: Add a comment to a subtle use of OwnPtr::release() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 (*iter)->cancel(); 216 (*iter)->cancel();
217 } 217 }
218 218
219 // FIXME: Apply updates to play-state. 219 // FIXME: Apply updates to play-state.
220 220
221 for (Vector<CSSAnimationUpdate::NewAnimation>::const_iterator iter = update- >newAnimations().begin(); iter != update->newAnimations().end(); ++iter) { 221 for (Vector<CSSAnimationUpdate::NewAnimation>::const_iterator iter = update- >newAnimations().begin(); iter != update->newAnimations().end(); ++iter) {
222 OwnPtr<CSSAnimations::EventDelegate> eventDelegate = adoptPtr(new EventD elegate(element, iter->name)); 222 OwnPtr<CSSAnimations::EventDelegate> eventDelegate = adoptPtr(new EventD elegate(element, iter->name));
223 HashSet<RefPtr<Player> > players; 223 HashSet<RefPtr<Player> > players;
224 for (HashSet<RefPtr<InertAnimation> >::const_iterator animationsIter = i ter->animations.begin(); animationsIter != iter->animations.end(); ++animationsI ter) { 224 for (HashSet<RefPtr<InertAnimation> >::const_iterator animationsIter = i ter->animations.begin(); animationsIter != iter->animations.end(); ++animationsI ter) {
225 const InertAnimation* inertAnimation = animationsIter->get(); 225 const InertAnimation* inertAnimation = animationsIter->get();
226 // The event delegate is set on the the first animation only. We
227 // rely on the behavior of OwnPtr::release() to achieve this.
226 RefPtr<Animation> animation = Animation::create(element, inertAnimat ion->effect(), inertAnimation->specified(), eventDelegate.release()); 228 RefPtr<Animation> animation = Animation::create(element, inertAnimat ion->effect(), inertAnimation->specified(), eventDelegate.release());
227 players.add(element->document().timeline()->play(animation.get())); 229 players.add(element->document().timeline()->play(animation.get()));
228 } 230 }
229 m_animations.set(iter->name, players); 231 m_animations.set(iter->name, players);
230 } 232 }
231 } 233 }
232 234
233 void CSSAnimations::cancel() 235 void CSSAnimations::cancel()
234 { 236 {
235 for (AnimationMap::iterator iter = m_animations.begin(); iter != m_animation s.end(); ++iter) { 237 for (AnimationMap::iterator iter = m_animations.begin(); iter != m_animation s.end(); ++iter) {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 case CSSPropertyWordSpacing: 388 case CSSPropertyWordSpacing:
387 case CSSPropertyZIndex: 389 case CSSPropertyZIndex:
388 case CSSPropertyZoom: 390 case CSSPropertyZoom:
389 return true; 391 return true;
390 default: 392 default:
391 return false; 393 return false;
392 } 394 }
393 } 395 }
394 396
395 } // namespace WebCore 397 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698