| 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 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "sky/engine/config.h" | 31 #include "sky/engine/config.h" |
| 32 #include "sky/engine/core/animation/AnimationPlayer.h" | 32 #include "sky/engine/core/animation/AnimationPlayer.h" |
| 33 | 33 |
| 34 #include "sky/engine/core/animation/Animation.h" | 34 #include "sky/engine/core/animation/Animation.h" |
| 35 #include "sky/engine/core/animation/AnimationTimeline.h" | 35 #include "sky/engine/core/animation/AnimationTimeline.h" |
| 36 #include "sky/engine/core/dom/Document.h" | 36 #include "sky/engine/core/dom/Document.h" |
| 37 #include "sky/engine/core/events/AnimationPlayerEvent.h" | 37 #include "sky/engine/core/events/AnimationPlayerEvent.h" |
| 38 #include "sky/engine/core/frame/UseCounter.h" | |
| 39 | 38 |
| 40 namespace blink { | 39 namespace blink { |
| 41 | 40 |
| 42 namespace { | 41 namespace { |
| 43 | 42 |
| 44 static unsigned nextSequenceNumber() | 43 static unsigned nextSequenceNumber() |
| 45 { | 44 { |
| 46 static unsigned next = 0; | 45 static unsigned next = 0; |
| 47 return ++next; | 46 return ++next; |
| 48 } | 47 } |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 } | 513 } |
| 515 | 514 |
| 516 bool AnimationPlayer::canFree() const | 515 bool AnimationPlayer::canFree() const |
| 517 { | 516 { |
| 518 ASSERT(m_content); | 517 ASSERT(m_content); |
| 519 return hasOneRef() && m_content->isAnimation() && m_content->hasOneRef(); | 518 return hasOneRef() && m_content->isAnimation() && m_content->hasOneRef(); |
| 520 } | 519 } |
| 521 | 520 |
| 522 bool AnimationPlayer::addEventListener(const AtomicString& eventType, PassRefPtr
<EventListener> listener, bool useCapture) | 521 bool AnimationPlayer::addEventListener(const AtomicString& eventType, PassRefPtr
<EventListener> listener, bool useCapture) |
| 523 { | 522 { |
| 524 if (eventType == EventTypeNames::finish) | |
| 525 UseCounter::count(executionContext(), UseCounter::AnimationPlayerFinishE
vent); | |
| 526 return EventTargetWithInlineData::addEventListener(eventType, listener, useC
apture); | 523 return EventTargetWithInlineData::addEventListener(eventType, listener, useC
apture); |
| 527 } | 524 } |
| 528 | 525 |
| 529 void AnimationPlayer::pauseForTesting(double pauseTime) | 526 void AnimationPlayer::pauseForTesting(double pauseTime) |
| 530 { | 527 { |
| 531 RELEASE_ASSERT(!paused()); | 528 RELEASE_ASSERT(!paused()); |
| 532 setCurrentTimeInternal(pauseTime, TimingUpdateOnDemand); | 529 setCurrentTimeInternal(pauseTime, TimingUpdateOnDemand); |
| 533 m_isPausedForTesting = true; | 530 m_isPausedForTesting = true; |
| 534 pause(); | 531 pause(); |
| 535 } | 532 } |
| 536 | 533 |
| 537 } // namespace | 534 } // namespace |
| OLD | NEW |