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

Unified Diff: third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.h

Issue 2745823002: [animation-worklet] Implement registerAnimator in worklet scope (Closed)
Patch Set: Address nhiroki feedback Created 3 years, 7 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/modules/compositorworker/AnimationWorkletGlobalScope.h
diff --git a/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.h b/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.h
index 3f7134d6ebcd09e62ebcadc03cb69c45b445b496..e9fabbd5886d4468209fc928f17e43109e612810 100644
--- a/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.h
+++ b/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.h
@@ -5,10 +5,15 @@
#ifndef AnimationWorkletGlobalScope_h
#define AnimationWorkletGlobalScope_h
+#include "bindings/core/v8/ScriptValue.h"
#include "core/workers/ThreadedWorkletGlobalScope.h"
+#include "modules/compositorworker/Animator.h"
+#include "modules/compositorworker/AnimatorDefinition.h"
namespace blink {
+class ExceptionState;
+
class AnimationWorkletGlobalScope : public ThreadedWorkletGlobalScope {
DEFINE_WRAPPERTYPEINFO();
@@ -19,6 +24,15 @@ class AnimationWorkletGlobalScope : public ThreadedWorkletGlobalScope {
v8::Isolate*,
WorkerThread*);
~AnimationWorkletGlobalScope() override;
+ DECLARE_TRACE();
+
+ void Dispose() final;
+
+ void registerAnimator(const String& name,
+ const ScriptValue& ctorValue,
+ ExceptionState&);
+
+ Animator* CreateInstance(const String& name);
private:
AnimationWorkletGlobalScope(const KURL&,
@@ -26,6 +40,12 @@ class AnimationWorkletGlobalScope : public ThreadedWorkletGlobalScope {
PassRefPtr<SecurityOrigin>,
v8::Isolate*,
WorkerThread*);
+
+ typedef HeapHashMap<String, Member<AnimatorDefinition>> DefinitionMap;
+ DefinitionMap m_animatorDefinitions;
+
+ typedef HeapVector<Member<Animator>> AnimatorList;
+ AnimatorList m_animators;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698