| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef AnimationWorkletGlobalScope_h | 5 #ifndef AnimationWorkletGlobalScope_h |
| 6 #define AnimationWorkletGlobalScope_h | 6 #define AnimationWorkletGlobalScope_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptValue.h" |
| 8 #include "core/workers/ThreadedWorkletGlobalScope.h" | 9 #include "core/workers/ThreadedWorkletGlobalScope.h" |
| 10 #include "modules/compositorworker/Animator.h" |
| 11 #include "modules/compositorworker/AnimatorDefinition.h" |
| 9 | 12 |
| 10 namespace blink { | 13 namespace blink { |
| 11 | 14 |
| 15 class ExceptionState; |
| 16 |
| 12 class AnimationWorkletGlobalScope : public ThreadedWorkletGlobalScope { | 17 class AnimationWorkletGlobalScope : public ThreadedWorkletGlobalScope { |
| 13 DEFINE_WRAPPERTYPEINFO(); | 18 DEFINE_WRAPPERTYPEINFO(); |
| 14 | 19 |
| 15 public: | 20 public: |
| 16 static AnimationWorkletGlobalScope* Create(const KURL&, | 21 static AnimationWorkletGlobalScope* Create(const KURL&, |
| 17 const String& user_agent, | 22 const String& user_agent, |
| 18 PassRefPtr<SecurityOrigin>, | 23 PassRefPtr<SecurityOrigin>, |
| 19 v8::Isolate*, | 24 v8::Isolate*, |
| 20 WorkerThread*); | 25 WorkerThread*); |
| 21 ~AnimationWorkletGlobalScope() override; | 26 ~AnimationWorkletGlobalScope() override; |
| 27 DECLARE_TRACE(); |
| 28 |
| 29 void Dispose() final; |
| 30 |
| 31 void registerAnimator(const String& name, |
| 32 const ScriptValue& ctorValue, |
| 33 ExceptionState&); |
| 34 |
| 35 Animator* CreateInstance(const String& name); |
| 22 | 36 |
| 23 private: | 37 private: |
| 24 AnimationWorkletGlobalScope(const KURL&, | 38 AnimationWorkletGlobalScope(const KURL&, |
| 25 const String& user_agent, | 39 const String& user_agent, |
| 26 PassRefPtr<SecurityOrigin>, | 40 PassRefPtr<SecurityOrigin>, |
| 27 v8::Isolate*, | 41 v8::Isolate*, |
| 28 WorkerThread*); | 42 WorkerThread*); |
| 43 |
| 44 typedef HeapHashMap<String, Member<AnimatorDefinition>> DefinitionMap; |
| 45 DefinitionMap m_animatorDefinitions; |
| 46 |
| 47 typedef HeapVector<Member<Animator>> AnimatorList; |
| 48 AnimatorList m_animators; |
| 29 }; | 49 }; |
| 30 | 50 |
| 31 } // namespace blink | 51 } // namespace blink |
| 32 | 52 |
| 33 #endif // AnimationWorkletGlobalScope_h | 53 #endif // AnimationWorkletGlobalScope_h |
| OLD | NEW |