| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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 AnimationWorkletProxyClientImpl_h |
| 6 #define AnimationWorkletProxyClientImpl_h |
| 7 |
| 8 #include "core/dom/AnimationWorkletProxyClient.h" |
| 9 #include "platform/graphics/CompositorAnimator.h" |
| 10 #include "platform/heap/Handle.h" |
| 11 #include "wtf/Noncopyable.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 class CompositorMutatorImpl; |
| 16 |
| 17 // Mediates between one Animator and the associated CompositorMutatorImpl. There |
| 18 // is one AnimationWorkletProxyClientImpl per Animator but there may be multiple |
| 19 // for a given mutator and animatorWorklet. |
| 20 // |
| 21 // Should be accessed only on the compositor thread. |
| 22 class AnimationWorkletProxyClientImpl final |
| 23 : public GarbageCollectedFinalized<AnimationWorkletProxyClientImpl>, |
| 24 public AnimationWorkletProxyClient, |
| 25 public CompositorAnimator { |
| 26 WTF_MAKE_NONCOPYABLE(AnimationWorkletProxyClientImpl); |
| 27 USING_GARBAGE_COLLECTED_MIXIN(AnimationWorkletProxyClientImpl); |
| 28 |
| 29 public: |
| 30 AnimationWorkletProxyClientImpl(CompositorMutatorImpl*); |
| 31 DECLARE_VIRTUAL_TRACE(); |
| 32 |
| 33 // CompositorAnimator: |
| 34 bool mutate(double monotonicTimeNow, |
| 35 CompositorMutableStateProvider*) override; |
| 36 |
| 37 // CompositorProxyClient: |
| 38 void registerCompositorProxy(CompositorProxy*) override; |
| 39 void unregisterCompositorProxy(CompositorProxy*) override; |
| 40 |
| 41 private: |
| 42 CrossThreadPersistent<CompositorMutatorImpl> m_mutator; |
| 43 HeapHashSet<WeakMember<CompositorProxy>> m_proxies; |
| 44 }; |
| 45 |
| 46 } // namespace blink |
| 47 |
| 48 #endif // AnimationWorkletProxyClientImpl_h |
| OLD | NEW |