| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // DocumentTimeline is constructed and owned by Document, and tied to its lifecy
cle. | 47 // DocumentTimeline is constructed and owned by Document, and tied to its lifecy
cle. |
| 48 class DocumentTimeline : public RefCounted<DocumentTimeline> { | 48 class DocumentTimeline : public RefCounted<DocumentTimeline> { |
| 49 | 49 |
| 50 public: | 50 public: |
| 51 static PassRefPtr<DocumentTimeline> create(Document*); | 51 static PassRefPtr<DocumentTimeline> create(Document*); |
| 52 void serviceAnimations(double); | 52 void serviceAnimations(double); |
| 53 PassRefPtr<Player> play(TimedItem*); | 53 PassRefPtr<Player> play(TimedItem*); |
| 54 // Called from setReadyState() in Document.cpp to set m_zeroTimeAsPerfTime t
o | 54 // Called from setReadyState() in Document.cpp to set m_zeroTimeAsPerfTime t
o |
| 55 // performance.timing.domInteractive. | 55 // performance.timing.domInteractive. |
| 56 void setZeroTimeAsPerfTime(double); | 56 void setZeroTimeAsPerfTime(double); |
| 57 double currentTime(); | 57 double currentTime() { return m_currentTime; } |
| 58 void pauseAnimationsForTesting(double); | 58 void pauseAnimationsForTesting(double); |
| 59 size_t numberOfActiveAnimationsForTesting() const; | 59 size_t numberOfActiveAnimationsForTesting() const; |
| 60 AnimationStack* animationStack(const Element* element) const | 60 AnimationStack* animationStack(const Element* element) const |
| 61 { | 61 { |
| 62 if (ActiveAnimations* animations = element->activeAnimations()) | 62 if (ActiveAnimations* animations = element->activeAnimations()) |
| 63 return animations->defaultStack(); | 63 return animations->defaultStack(); |
| 64 return 0; | 64 return 0; |
| 65 } | 65 } |
| 66 void addEventToDispatch(EventTarget* target, PassRefPtr<Event> event) | 66 void addEventToDispatch(EventTarget* target, PassRefPtr<Event> event) |
| 67 { | 67 { |
| 68 m_events.append(EventToDispatch(target, event)); | 68 m_events.append(EventToDispatch(target, event)); |
| 69 } | 69 } |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 DocumentTimeline(Document*); | 72 DocumentTimeline(Document*); |
| 73 void dispatchEvents(); | 73 void dispatchEvents(); |
| 74 double m_currentTime; |
| 74 double m_zeroTimeAsPerfTime; | 75 double m_zeroTimeAsPerfTime; |
| 75 Document* m_document; | 76 Document* m_document; |
| 76 Vector<RefPtr<Player> > m_players; | 77 Vector<RefPtr<Player> > m_players; |
| 77 | 78 |
| 78 struct EventToDispatch { | 79 struct EventToDispatch { |
| 79 EventToDispatch(EventTarget* target, PassRefPtr<Event> event) | 80 EventToDispatch(EventTarget* target, PassRefPtr<Event> event) |
| 80 : target(target) | 81 : target(target) |
| 81 , event(event) | 82 , event(event) |
| 82 { | 83 { |
| 83 } | 84 } |
| 84 RefPtr<EventTarget> target; | 85 RefPtr<EventTarget> target; |
| 85 RefPtr<Event> event; | 86 RefPtr<Event> event; |
| 86 }; | 87 }; |
| 87 Vector<EventToDispatch> m_events; | 88 Vector<EventToDispatch> m_events; |
| 88 }; | 89 }; |
| 89 | 90 |
| 90 } // namespace | 91 } // namespace |
| 91 | 92 |
| 92 #endif | 93 #endif |
| OLD | NEW |