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 |
11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
12 * | 12 * |
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND A
NY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND A
NY |
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR A
NY | 16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR A
NY |
17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON | 19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON |
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THI
S | 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THI
S |
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 * | 23 * |
24 */ | 24 */ |
25 | 25 |
26 #ifndef ScriptedAnimationController_h | 26 #ifndef ScriptedAnimationController_h |
27 #define ScriptedAnimationController_h | 27 #define ScriptedAnimationController_h |
28 | 28 |
| 29 #include "core/dom/RequestAnimationFrameCallbackCollection.h" |
29 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
30 #include "wtf/ListHashSet.h" | 31 #include "wtf/ListHashSet.h" |
31 #include "wtf/RefCounted.h" | 32 #include "wtf/RefCounted.h" |
32 #include "wtf/RefPtr.h" | 33 #include "wtf/RefPtr.h" |
33 #include "wtf/Vector.h" | 34 #include "wtf/Vector.h" |
34 #include "wtf/text/AtomicString.h" | 35 #include "wtf/text/AtomicString.h" |
35 #include "wtf/text/StringImpl.h" | 36 #include "wtf/text/StringImpl.h" |
36 | 37 |
37 namespace blink { | 38 namespace blink { |
38 | 39 |
(...skipping 30 matching lines...) Expand all Loading... |
69 void dispatchEventsAndCallbacksForPrinting(); | 70 void dispatchEventsAndCallbacksForPrinting(); |
70 private: | 71 private: |
71 explicit ScriptedAnimationController(Document*); | 72 explicit ScriptedAnimationController(Document*); |
72 | 73 |
73 void scheduleAnimationIfNeeded(); | 74 void scheduleAnimationIfNeeded(); |
74 | 75 |
75 void dispatchEvents(const AtomicString& eventInterfaceFilter = AtomicString(
)); | 76 void dispatchEvents(const AtomicString& eventInterfaceFilter = AtomicString(
)); |
76 void executeCallbacks(double monotonicTimeNow); | 77 void executeCallbacks(double monotonicTimeNow); |
77 void callMediaQueryListListeners(); | 78 void callMediaQueryListListeners(); |
78 | 79 |
79 typedef PersistentHeapVectorWillBeHeapVector<Member<RequestAnimationFrameCal
lback>> CallbackList; | |
80 CallbackList m_callbacks; | |
81 CallbackList m_callbacksToInvoke; // only non-empty while inside executeCall
backs | |
82 | |
83 RawPtrWillBeMember<Document> m_document; | 80 RawPtrWillBeMember<Document> m_document; |
84 CallbackId m_nextCallbackId; | 81 RequestAnimationFrameCallbackCollection m_callbackCollection; |
85 int m_suspendCount; | 82 int m_suspendCount; |
86 WillBeHeapVector<RefPtrWillBeMember<Event>> m_eventQueue; | 83 WillBeHeapVector<RefPtrWillBeMember<Event>> m_eventQueue; |
87 WillBeHeapListHashSet<std::pair<RawPtrWillBeMember<const EventTarget>, const
StringImpl*>> m_perFrameEvents; | 84 WillBeHeapListHashSet<std::pair<RawPtrWillBeMember<const EventTarget>, const
StringImpl*>> m_perFrameEvents; |
88 typedef WillBeHeapListHashSet<RefPtrWillBeMember<MediaQueryListListener>> Me
diaQueryListListeners; | 85 typedef WillBeHeapListHashSet<RefPtrWillBeMember<MediaQueryListListener>> Me
diaQueryListListeners; |
89 MediaQueryListListeners m_mediaQueryListListeners; | 86 MediaQueryListListeners m_mediaQueryListListeners; |
90 }; | 87 }; |
91 | 88 |
92 } // namespace blink | 89 } // namespace blink |
93 | 90 |
94 #endif // ScriptedAnimationController_h | 91 #endif // ScriptedAnimationController_h |
OLD | NEW |