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

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

Issue 1043903003: rAF: Introduce FrameRequestCallbackCollection for managing rAF callbacks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/RequestAnimationFrameCallbackCollection.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef RequestAnimationFrameCallbackCollection_h
6 #define RequestAnimationFrameCallbackCollection_h
7
8 #include "platform/heap/Handle.h"
9
10 namespace blink {
11
12 class ExecutionContext;
13 class RequestAnimationFrameCallback;
14
15 class RequestAnimationFrameCallbackCollection {
esprehn 2015/03/30 18:36:38 final
sadrul 2015/03/30 18:40:47 Done.
16 public:
17 explicit RequestAnimationFrameCallbackCollection(ExecutionContext*);
18
19 typedef int CallbackId;
20 CallbackId registerCallback(RequestAnimationFrameCallback*);
21 void cancelCallback(CallbackId);
22 void executeCallbacks(double highResNowMs, double highResNowMsLegacy);
23
24 bool empty() const { return !m_callbacks.size() && !m_callbacksToInvoke.size (); }
25
26 DECLARE_TRACE();
27
28 private:
29 typedef PersistentHeapVectorWillBeHeapVector<Member<RequestAnimationFrameCal lback>> CallbackList;
30 CallbackList m_callbacks;
31 CallbackList m_callbacksToInvoke; // only non-empty while inside executeCall backs
32
33 CallbackId m_nextCallbackId = 0;
34
35 ExecutionContext* m_context = nullptr;
36 };
37
38 } // namespace blink
39
40 #endif // RequestAnimationFrameCallbackCollection_h
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/RequestAnimationFrameCallbackCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698