| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 static PassRefPtrWillBeRawPtr<ScriptedAnimationController> create(Document*
document) | 46 static PassRefPtrWillBeRawPtr<ScriptedAnimationController> create(Document*
document) |
| 47 { | 47 { |
| 48 return adoptRefWillBeNoop(new ScriptedAnimationController(document)); | 48 return adoptRefWillBeNoop(new ScriptedAnimationController(document)); |
| 49 } | 49 } |
| 50 ~ScriptedAnimationController(); | 50 ~ScriptedAnimationController(); |
| 51 void trace(Visitor*); | 51 void trace(Visitor*); |
| 52 void clearDocumentPointer() { m_document = nullptr; } | 52 void clearDocumentPointer() { m_document = nullptr; } |
| 53 | 53 |
| 54 typedef int CallbackId; | 54 typedef int CallbackId; |
| 55 | 55 |
| 56 int registerCallback(PassOwnPtrWillBeRawPtr<RequestAnimationFrameCallback>); | 56 int registerCallback(RequestAnimationFrameCallback*); |
| 57 void cancelCallback(CallbackId); | 57 void cancelCallback(CallbackId); |
| 58 void serviceScriptedAnimations(double monotonicTimeNow); | 58 void serviceScriptedAnimations(double monotonicTimeNow); |
| 59 | 59 |
| 60 void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); | 60 void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); |
| 61 void enqueuePerFrameEvent(PassRefPtrWillBeRawPtr<Event>); | 61 void enqueuePerFrameEvent(PassRefPtrWillBeRawPtr<Event>); |
| 62 void enqueueMediaQueryChangeListeners(WillBeHeapVector<RefPtrWillBeMember<Me
diaQueryListListener> >&); | 62 void enqueueMediaQueryChangeListeners(WillBeHeapVector<RefPtrWillBeMember<Me
diaQueryListListener> >&); |
| 63 | 63 |
| 64 void suspend(); | 64 void suspend(); |
| 65 void resume(); | 65 void resume(); |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 explicit ScriptedAnimationController(Document*); | 68 explicit ScriptedAnimationController(Document*); |
| 69 | 69 |
| 70 void scheduleAnimationIfNeeded(); | 70 void scheduleAnimationIfNeeded(); |
| 71 | 71 |
| 72 void dispatchEvents(); | 72 void dispatchEvents(); |
| 73 void executeCallbacks(double monotonicTimeNow); | 73 void executeCallbacks(double monotonicTimeNow); |
| 74 void callMediaQueryListListeners(); | 74 void callMediaQueryListListeners(); |
| 75 | 75 |
| 76 typedef WillBeHeapVector<OwnPtrWillBeMember<RequestAnimationFrameCallback> >
CallbackList; | 76 typedef PersistentHeapVectorWillBeHeapVector<Member<RequestAnimationFrameCal
lback> > CallbackList; |
| 77 CallbackList m_callbacks; | 77 CallbackList m_callbacks; |
| 78 CallbackList m_callbacksToInvoke; // only non-empty while inside executeCall
backs | 78 CallbackList m_callbacksToInvoke; // only non-empty while inside executeCall
backs |
| 79 | 79 |
| 80 RawPtrWillBeMember<Document> m_document; | 80 RawPtrWillBeMember<Document> m_document; |
| 81 CallbackId m_nextCallbackId; | 81 CallbackId m_nextCallbackId; |
| 82 int m_suspendCount; | 82 int m_suspendCount; |
| 83 WillBeHeapVector<RefPtrWillBeMember<Event> > m_eventQueue; | 83 WillBeHeapVector<RefPtrWillBeMember<Event> > m_eventQueue; |
| 84 WillBeHeapListHashSet<std::pair<RawPtrWillBeMember<const EventTarget>, const
StringImpl*> > m_perFrameEvents; | 84 WillBeHeapListHashSet<std::pair<RawPtrWillBeMember<const EventTarget>, const
StringImpl*> > m_perFrameEvents; |
| 85 typedef WillBeHeapListHashSet<RefPtrWillBeMember<MediaQueryListListener> > M
ediaQueryListListeners; | 85 typedef WillBeHeapListHashSet<RefPtrWillBeMember<MediaQueryListListener> > M
ediaQueryListListeners; |
| 86 MediaQueryListListeners m_mediaQueryListListeners; | 86 MediaQueryListListeners m_mediaQueryListListeners; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } | 89 } |
| 90 | 90 |
| 91 #endif // ScriptedAnimationController_h | 91 #endif // ScriptedAnimationController_h |
| OLD | NEW |