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 | |
911 bool AnimationPlayer::addEventListener(const AtomicString& eventType, PassRefPtr
<EventListener> listener, bool useCapture) | 902 bool AnimationPlayer::addEventListener(const AtomicString& eventType, PassRefPtr
<EventListener> listener, bool useCapture) |
912 { | 903 { |
913 if (eventType == EventTypeNames::finish) | 904 if (eventType == EventTypeNames::finish) |
914 UseCounter::count(executionContext(), UseCounter::AnimationPlayerFinishE
vent); | 905 UseCounter::count(executionContext(), UseCounter::AnimationPlayerFinishE
vent); |
915 return EventTargetWithInlineData::addEventListener(eventType, listener, useC
apture); | 906 return EventTargetWithInlineData::addEventListener(eventType, listener, useC
apture); |
916 } | 907 } |
917 | 908 |
918 void AnimationPlayer::pauseForTesting(double pauseTime) | 909 void AnimationPlayer::pauseForTesting(double pauseTime) |
919 { | 910 { |
920 RELEASE_ASSERT(!paused()); | 911 RELEASE_ASSERT(!paused()); |
921 setCurrentTimeInternal(pauseTime, TimingUpdateOnDemand); | 912 setCurrentTimeInternal(pauseTime, TimingUpdateOnDemand); |
922 if (hasActiveAnimationsOnCompositor()) | 913 if (hasActiveAnimationsOnCompositor()) |
923 toAnimation(m_content.get())->pauseAnimationForTestingOnCompositor(curre
ntTimeInternal()); | 914 toAnimation(m_content.get())->pauseAnimationForTestingOnCompositor(curre
ntTimeInternal()); |
924 m_isPausedForTesting = true; | 915 m_isPausedForTesting = true; |
925 pause(); | 916 pause(); |
926 } | 917 } |
927 | 918 |
928 DEFINE_TRACE(AnimationPlayer) | 919 DEFINE_TRACE(AnimationPlayer) |
929 { | 920 { |
930 visitor->trace(m_content); | 921 visitor->trace(m_content); |
931 visitor->trace(m_timeline); | 922 visitor->trace(m_timeline); |
932 visitor->trace(m_pendingFinishedEvent); | 923 visitor->trace(m_pendingFinishedEvent); |
933 visitor->trace(m_finishedPromise); | 924 visitor->trace(m_finishedPromise); |
934 visitor->trace(m_readyPromise); | 925 visitor->trace(m_readyPromise); |
935 EventTargetWithInlineData::trace(visitor); | 926 EventTargetWithInlineData::trace(visitor); |
936 ActiveDOMObject::trace(visitor); | 927 ActiveDOMObject::trace(visitor); |
937 } | 928 } |
938 | 929 |
939 } // namespace | 930 } // namespace |
OLD | NEW |