OLD | NEW |
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 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 default: | 892 default: |
893 ASSERT_NOT_REACHED(); | 893 ASSERT_NOT_REACHED(); |
894 break; | 894 break; |
895 } | 895 } |
896 m_player->endUpdatingState(); | 896 m_player->endUpdatingState(); |
897 | 897 |
898 if (oldPlayState != newPlayState && newPlayState == Running) | 898 if (oldPlayState != newPlayState && newPlayState == Running) |
899 InspectorInstrumentation::didCreateAnimationPlayer(m_player->timeline()-
>document(), *m_player); | 899 InspectorInstrumentation::didCreateAnimationPlayer(m_player->timeline()-
>document(), *m_player); |
900 } | 900 } |
901 | 901 |
| 902 |
| 903 #if !ENABLE(OILPAN) |
| 904 bool AnimationPlayer::canFree() const |
| 905 { |
| 906 ASSERT(m_content); |
| 907 return hasOneRef() && m_content->isAnimation() && m_content->hasOneRef(); |
| 908 } |
| 909 #endif |
| 910 |
902 bool AnimationPlayer::addEventListener(const AtomicString& eventType, PassRefPtr
<EventListener> listener, bool useCapture) | 911 bool AnimationPlayer::addEventListener(const AtomicString& eventType, PassRefPtr
<EventListener> listener, bool useCapture) |
903 { | 912 { |
904 if (eventType == EventTypeNames::finish) | 913 if (eventType == EventTypeNames::finish) |
905 UseCounter::count(executionContext(), UseCounter::AnimationPlayerFinishE
vent); | 914 UseCounter::count(executionContext(), UseCounter::AnimationPlayerFinishE
vent); |
906 return EventTargetWithInlineData::addEventListener(eventType, listener, useC
apture); | 915 return EventTargetWithInlineData::addEventListener(eventType, listener, useC
apture); |
907 } | 916 } |
908 | 917 |
909 void AnimationPlayer::pauseForTesting(double pauseTime) | 918 void AnimationPlayer::pauseForTesting(double pauseTime) |
910 { | 919 { |
911 RELEASE_ASSERT(!paused()); | 920 RELEASE_ASSERT(!paused()); |
912 setCurrentTimeInternal(pauseTime, TimingUpdateOnDemand); | 921 setCurrentTimeInternal(pauseTime, TimingUpdateOnDemand); |
913 if (hasActiveAnimationsOnCompositor()) | 922 if (hasActiveAnimationsOnCompositor()) |
914 toAnimation(m_content.get())->pauseAnimationForTestingOnCompositor(curre
ntTimeInternal()); | 923 toAnimation(m_content.get())->pauseAnimationForTestingOnCompositor(curre
ntTimeInternal()); |
915 m_isPausedForTesting = true; | 924 m_isPausedForTesting = true; |
916 pause(); | 925 pause(); |
917 } | 926 } |
918 | 927 |
919 DEFINE_TRACE(AnimationPlayer) | 928 DEFINE_TRACE(AnimationPlayer) |
920 { | 929 { |
921 visitor->trace(m_content); | 930 visitor->trace(m_content); |
922 visitor->trace(m_timeline); | 931 visitor->trace(m_timeline); |
923 visitor->trace(m_pendingFinishedEvent); | 932 visitor->trace(m_pendingFinishedEvent); |
924 visitor->trace(m_finishedPromise); | 933 visitor->trace(m_finishedPromise); |
925 visitor->trace(m_readyPromise); | 934 visitor->trace(m_readyPromise); |
926 EventTargetWithInlineData::trace(visitor); | 935 EventTargetWithInlineData::trace(visitor); |
927 ActiveDOMObject::trace(visitor); | 936 ActiveDOMObject::trace(visitor); |
928 } | 937 } |
929 | 938 |
930 } // namespace | 939 } // namespace |
OLD | NEW |