OLD | NEW |
(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 empty() 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 |
OLD | NEW |