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

Unified Diff: third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.h

Issue 2515363002: Introduce AnimationWorkletProxyClient and necessary plumbing to get it in worklet messaging proxy. (Closed)
Patch Set: Remove unnecessary PLATFORM_EXPORT Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.h
diff --git a/third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.h b/third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.h
new file mode 100644
index 0000000000000000000000000000000000000000..22ff647cc97b17d75a3c7168e88ecb5bdac06179
--- /dev/null
+++ b/third_party/WebKit/Source/web/AnimationWorkletProxyClientImpl.h
@@ -0,0 +1,49 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef AnimationWorkletProxyClientImpl_h
+#define AnimationWorkletProxyClientImpl_h
+
+#include "core/dom/AnimationWorkletProxyClient.h"
+#include "platform/heap/Handle.h"
+#include "web/CompositorAnimator.h"
+#include "wtf/Noncopyable.h"
+
+namespace blink {
+
+class CompositorMutatorImpl;
+
+// Mediates between one Animator and the associated CompositorMutatorImpl. There
+// is one AnimationWorkletProxyClientImpl per Animator but there may be multiple
+// for a given mutator and animatorWorklet.
+//
+// This is constructed on the main thread but it is used in the worklet backing
+// thread i.e., compositor thread.
+class AnimationWorkletProxyClientImpl final
+ : public AnimationWorkletProxyClient,
+ public CompositorAnimator {
+ WTF_MAKE_NONCOPYABLE(AnimationWorkletProxyClientImpl);
+ USING_GARBAGE_COLLECTED_MIXIN(AnimationWorkletProxyClientImpl);
+
+ public:
+ explicit AnimationWorkletProxyClientImpl(CompositorMutatorImpl*);
+ DECLARE_VIRTUAL_TRACE();
+
+ // CompositorAnimator:
+ // This method is invoked in compositor thread
+ bool mutate(double monotonicTimeNow,
+ CompositorMutableStateProvider*) override;
+
+ // CompositorProxyClient:
+ void registerCompositorProxy(CompositorProxy*) override;
+ void unregisterCompositorProxy(CompositorProxy*) override;
+
+ private:
+ CrossThreadPersistent<CompositorMutatorImpl> m_mutator;
+ HeapHashSet<WeakMember<CompositorProxy>> m_proxies;
+};
+
+} // namespace blink
+
+#endif // AnimationWorkletProxyClientImpl_h

Powered by Google App Engine
This is Rietveld 408576698