Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1403)

Side by Side Diff: Source/core/dom/ScriptedAnimationController.h

Issue 337883003: Call media query change listeners asynchronously. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tests fixed Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 int registerCallback(PassOwnPtr<RequestAnimationFrameCallback>); 55 int registerCallback(PassOwnPtr<RequestAnimationFrameCallback>);
56 void cancelCallback(CallbackId); 56 void cancelCallback(CallbackId);
57 void serviceScriptedAnimations(double monotonicTimeNow); 57 void serviceScriptedAnimations(double monotonicTimeNow);
58 58
59 void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); 59 void enqueueEvent(PassRefPtrWillBeRawPtr<Event>);
60 void enqueuePerFrameEvent(PassRefPtrWillBeRawPtr<Event>); 60 void enqueuePerFrameEvent(PassRefPtrWillBeRawPtr<Event>);
61 61
62 void suspend(); 62 void suspend();
63 void resume(); 63 void resume();
64 64
65 // Public for use by MediaQueryMatcher
66 void scheduleAnimationIfNeeded();
67
65 private: 68 private:
66 explicit ScriptedAnimationController(Document*); 69 explicit ScriptedAnimationController(Document*);
67 70
68 void scheduleAnimationIfNeeded();
69
70 void dispatchEvents(); 71 void dispatchEvents();
71 void executeCallbacks(double monotonicTimeNow); 72 void executeCallbacks(double monotonicTimeNow);
72 73
73 typedef Vector<OwnPtr<RequestAnimationFrameCallback> > CallbackList; 74 typedef Vector<OwnPtr<RequestAnimationFrameCallback> > CallbackList;
74 CallbackList m_callbacks; 75 CallbackList m_callbacks;
75 CallbackList m_callbacksToInvoke; // only non-empty while inside executeCall backs 76 CallbackList m_callbacksToInvoke; // only non-empty while inside executeCall backs
76 77
77 RawPtrWillBeMember<Document> m_document; 78 RawPtrWillBeMember<Document> m_document;
78 CallbackId m_nextCallbackId; 79 CallbackId m_nextCallbackId;
79 int m_suspendCount; 80 int m_suspendCount;
80 WillBeHeapVector<RefPtrWillBeMember<Event> > m_eventQueue; 81 WillBeHeapVector<RefPtrWillBeMember<Event> > m_eventQueue;
81 WillBeHeapListHashSet<std::pair<RawPtrWillBeMember<const EventTarget>, const StringImpl*> > m_perFrameEvents; 82 WillBeHeapListHashSet<std::pair<RawPtrWillBeMember<const EventTarget>, const StringImpl*> > m_perFrameEvents;
82 }; 83 };
83 84
84 } 85 }
85 86
86 #endif // ScriptedAnimationController_h 87 #endif // ScriptedAnimationController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698