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 #include "core/workers/DedicatedWorkerGlobalScope.h" |
| 6 |
| 7 #ifndef CompositorWorkerGlobalScope_h |
| 8 #define CompositorWorkerGlobalScope_h |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 class CompositorWorkerThread; |
| 13 class RequestAnimationFrameCallback; |
| 14 |
| 15 class CompositorWorkerGlobalScope final : public DedicatedWorkerGlobalScope { |
| 16 DEFINE_WRAPPERTYPEINFO(); |
| 17 public: |
| 18 static PassRefPtrWillBeRawPtr<CompositorWorkerGlobalScope> create(Compositor
WorkerThread*, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData>, double timeOrigi
n); |
| 19 virtual ~CompositorWorkerGlobalScope(); |
| 20 |
| 21 // EventTarget |
| 22 const AtomicString& interfaceName() const override; |
| 23 |
| 24 int requestCompositorFrame(RequestAnimationFrameCallback*); |
| 25 void cancelCompositorFrame(int id); |
| 26 |
| 27 void executeCompositorFrameCallbacks(double monotonicTimeNow); |
| 28 |
| 29 DECLARE_VIRTUAL_TRACE(); |
| 30 |
| 31 protected: |
| 32 CompositorWorkerGlobalScope(const KURL&, const String& userAgent, Compositor
WorkerThread*, double timeOrigin, const SecurityOrigin*, PassOwnPtrWillBeRawPtr<
WorkerClients>); |
| 33 |
| 34 private: |
| 35 typedef PersistentHeapVectorWillBeHeapVector<Member<RequestAnimationFrameCal
lback>> CallbackList; |
| 36 CallbackList m_callbacks; |
| 37 CallbackList m_callbacksToInvoke; // only non-empty while inside executeCall
backs |
| 38 |
| 39 int m_nextCallbackId; |
| 40 }; |
| 41 |
| 42 } // namespace blink |
| 43 |
| 44 #endif // CompositorWorkerGlobalScope_h |
OLD | NEW |