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

Side by Side Diff: Source/core/dom/FrameRequestCallbackCollection.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
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 FrameRequestCallbackCollection_h
6 #define FrameRequestCallbackCollection_h
7
8 #include "platform/heap/Handle.h"
9
10 namespace blink {
11
12 class ExecutionContext;
13 class FrameRequestCallback;
14
15 class FrameRequestCallbackCollection final {
16 public:
17 explicit FrameRequestCallbackCollection(ExecutionContext*);
18
19 typedef int CallbackId;
20 CallbackId registerCallback(FrameRequestCallback*);
21 void cancelCallback(CallbackId);
22 void executeCallbacks(double highResNowMs, double highResNowMsLegacy);
23
24 bool isEmpty() const { return !m_callbacks.size(); }
25
26 DECLARE_TRACE();
27
28 private:
29 typedef PersistentHeapVectorWillBeHeapVector<Member<FrameRequestCallback>> C allbackList;
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 // FrameRequestCallbackCollection_h
OLDNEW
« no previous file with comments | « Source/core/dom/FrameRequestCallback.idl ('k') | Source/core/dom/FrameRequestCallbackCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698