Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / core / dom / FrameRequestCallbackCollection.h
blobed2bc1ef6b2bfeaa11ca8d4cc7b5a874b6851dec
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.
5 #ifndef FrameRequestCallbackCollection_h
6 #define FrameRequestCallbackCollection_h
8 #include "core/CoreExport.h"
9 #include "platform/heap/Handle.h"
11 namespace blink {
13 class ExecutionContext;
14 class FrameRequestCallback;
16 class CORE_EXPORT FrameRequestCallbackCollection final {
17 DISALLOW_ALLOCATION();
18 public:
19 explicit FrameRequestCallbackCollection(ExecutionContext*);
21 using CallbackId = int;
22 CallbackId registerCallback(FrameRequestCallback*);
23 void cancelCallback(CallbackId);
24 void executeCallbacks(double highResNowMs, double highResNowMsLegacy);
26 bool isEmpty() const { return !m_callbacks.size(); }
28 DECLARE_TRACE();
30 private:
31 using CallbackList = PersistentHeapVectorWillBeHeapVector<Member<FrameRequestCallback>>;
32 CallbackList m_callbacks;
33 CallbackList m_callbacksToInvoke; // only non-empty while inside executeCallbacks
35 CallbackId m_nextCallbackId = 0;
37 RawPtrWillBeMember<ExecutionContext> m_context;
40 } // namespace blink
42 #endif // FrameRequestCallbackCollection_h