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

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

Issue 2745823002: [animation-worklet] Implement registerAnimator in worklet scope (Closed)
Patch Set: remove empty array Created 3 years, 9 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 13921fea06b8548bdc432e4c6218ab59fbc0e640..aa238b1c78b77313904917d8086cedef18f3468d 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,13 @@ class AnimationWorkletGlobalScope : public ThreadedWorkletGlobalScope {
v8::Isolate*,
WorkerThread*);
~AnimationWorkletGlobalScope() override;
+ DECLARE_TRACE();
+
+ void dispose() final;
+
+ void registerAnimator(const String& name,
+ const ScriptValue& ctorValue,
+ ExceptionState&);
private:
AnimationWorkletGlobalScope(const KURL&,
@@ -26,6 +38,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