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

Side by Side Diff: Source/core/animation/ElementAnimation.h

Issue 1120003002: [Oilpan] Migrate most classes under core/animations to Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Resize expect size of Persistent Created 5 years, 6 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 44
45 namespace blink { 45 namespace blink {
46 46
47 class Dictionary; 47 class Dictionary;
48 48
49 class ElementAnimation { 49 class ElementAnimation {
50 public: 50 public:
51 static Animation* animate(Element& element, const EffectModelOrDictionarySeq uence& effectInput, double duration, ExceptionState& exceptionState) 51 static Animation* animate(Element& element, const EffectModelOrDictionarySeq uence& effectInput, double duration, ExceptionState& exceptionState)
52 { 52 {
53 RefPtrWillBeRawPtr<EffectModel> effect = EffectInput::convert(&element, effectInput, exceptionState); 53 EffectModel* effect = EffectInput::convert(&element, effectInput, except ionState);
54 if (exceptionState.hadException()) 54 if (exceptionState.hadException())
55 return 0; 55 return 0;
56 return animateInternal(element, effect, TimingInput::convert(duration)); 56 return animateInternal(element, effect, TimingInput::convert(duration));
57 } 57 }
58 58
59 static Animation* animate(Element& element, const EffectModelOrDictionarySeq uence& effectInput, const KeyframeEffectOptions& timingInput, ExceptionState& ex ceptionState) 59 static Animation* animate(Element& element, const EffectModelOrDictionarySeq uence& effectInput, const KeyframeEffectOptions& timingInput, ExceptionState& ex ceptionState)
60 { 60 {
61 RefPtrWillBeRawPtr<EffectModel> effect = EffectInput::convert(&element, effectInput, exceptionState); 61 EffectModel* effect = EffectInput::convert(&element, effectInput, except ionState);
62 if (exceptionState.hadException()) 62 if (exceptionState.hadException())
63 return 0; 63 return 0;
64 return animateInternal(element, effect, TimingInput::convert(timingInput )); 64 return animateInternal(element, effect, TimingInput::convert(timingInput ));
65 } 65 }
66 66
67 static Animation* animate(Element& element, const EffectModelOrDictionarySeq uence& effectInput, ExceptionState& exceptionState) 67 static Animation* animate(Element& element, const EffectModelOrDictionarySeq uence& effectInput, ExceptionState& exceptionState)
68 { 68 {
69 RefPtrWillBeRawPtr<EffectModel> effect = EffectInput::convert(&element, effectInput, exceptionState); 69 EffectModel* effect = EffectInput::convert(&element, effectInput, except ionState);
70 if (exceptionState.hadException()) 70 if (exceptionState.hadException())
71 return 0; 71 return 0;
72 return animateInternal(element, effect, Timing()); 72 return animateInternal(element, effect, Timing());
73 } 73 }
74 74
75 static WillBeHeapVector<RefPtrWillBeMember<Animation>> getAnimations(Element & element) 75 static HeapVector<Member<Animation>> getAnimations(Element& element)
76 { 76 {
77 WillBeHeapVector<RefPtrWillBeMember<Animation>> animationss; 77 HeapVector<Member<Animation>> animationss;
78 78
79 if (!element.hasAnimations()) 79 if (!element.hasAnimations())
80 return animationss; 80 return animationss;
81 81
82 for (const auto& animation : element.document().timeline().getAnimations ()) { 82 for (const auto& animation : element.document().timeline().getAnimations ()) {
83 ASSERT(animation->source()); 83 ASSERT(animation->source());
84 if (toKeyframeEffect(animation->source())->target() == element && (a nimation->source()->isCurrent() || animation->source()->isInEffect())) 84 if (toKeyframeEffect(animation->source())->target() == element && (a nimation->source()->isCurrent() || animation->source()->isInEffect()))
85 animationss.append(animation); 85 animationss.append(animation);
86 } 86 }
87 return animationss; 87 return animationss;
88 } 88 }
89 89
90 private: 90 private:
91 static Animation* animateInternal(Element& element, PassRefPtrWillBeRawPtr<E ffectModel> effect, const Timing& timing) 91 static Animation* animateInternal(Element& element, EffectModel* effect, con st Timing& timing)
92 { 92 {
93 RefPtrWillBeRawPtr<KeyframeEffect> keyframeEffect = KeyframeEffect::crea te(&element, effect, timing); 93 KeyframeEffect* keyframeEffect = KeyframeEffect::create(&element, effect , timing);
94 return element.document().timeline().play(keyframeEffect.get()); 94 return element.document().timeline().play(keyframeEffect);
95 } 95 }
96 }; 96 };
97 97
98 } // namespace blink 98 } // namespace blink
99 99
100 #endif // ElementAnimation_h 100 #endif // ElementAnimation_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698