| 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 "bindings/core/v8/ScriptValue.h" |
| 9 #include "core/workers/ThreadedWorkletGlobalScope.h" | 9 #include "core/workers/ThreadedWorkletGlobalScope.h" |
| 10 #include "modules/compositorworker/Animator.h" | 10 #include "modules/compositorworker/Animator.h" |
| 11 #include "modules/compositorworker/AnimatorDefinition.h" | 11 #include "modules/compositorworker/AnimatorDefinition.h" |
| 12 #include "platform/bindings/ScriptWrappable.h" |
| 12 | 13 |
| 13 namespace blink { | 14 namespace blink { |
| 14 | 15 |
| 15 class ExceptionState; | 16 class ExceptionState; |
| 16 | 17 |
| 17 class AnimationWorkletGlobalScope : public ThreadedWorkletGlobalScope { | 18 class AnimationWorkletGlobalScope : public ThreadedWorkletGlobalScope { |
| 18 DEFINE_WRAPPERTYPEINFO(); | 19 DEFINE_WRAPPERTYPEINFO(); |
| 19 | 20 |
| 20 public: | 21 public: |
| 21 static AnimationWorkletGlobalScope* Create(const KURL&, | 22 static AnimationWorkletGlobalScope* Create(const KURL&, |
| 22 const String& user_agent, | 23 const String& user_agent, |
| 23 PassRefPtr<SecurityOrigin>, | 24 PassRefPtr<SecurityOrigin>, |
| 24 v8::Isolate*, | 25 v8::Isolate*, |
| 25 WorkerThread*); | 26 WorkerThread*); |
| 26 ~AnimationWorkletGlobalScope() override; | 27 ~AnimationWorkletGlobalScope() override; |
| 27 DECLARE_TRACE(); | 28 DECLARE_TRACE(); |
| 28 | 29 DECLARE_TRACE_WRAPPERS(); |
| 29 void Dispose() final; | |
| 30 | 30 |
| 31 void registerAnimator(const String& name, | 31 void registerAnimator(const String& name, |
| 32 const ScriptValue& ctorValue, | 32 const ScriptValue& ctorValue, |
| 33 ExceptionState&); | 33 ExceptionState&); |
| 34 | 34 |
| 35 Animator* CreateInstance(const String& name); | 35 Animator* CreateInstance(const String& name); |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 AnimationWorkletGlobalScope(const KURL&, | 38 AnimationWorkletGlobalScope(const KURL&, |
| 39 const String& user_agent, | 39 const String& user_agent, |
| 40 PassRefPtr<SecurityOrigin>, | 40 PassRefPtr<SecurityOrigin>, |
| 41 v8::Isolate*, | 41 v8::Isolate*, |
| 42 WorkerThread*); | 42 WorkerThread*); |
| 43 | 43 |
| 44 typedef HeapHashMap<String, Member<AnimatorDefinition>> DefinitionMap; | 44 typedef HeapHashMap<String, TraceWrapperMember<AnimatorDefinition>> |
| 45 DefinitionMap m_animatorDefinitions; | 45 DefinitionMap; |
| 46 DefinitionMap animator_definitions_; |
| 46 | 47 |
| 47 typedef HeapVector<Member<Animator>> AnimatorList; | 48 typedef HeapVector<TraceWrapperMember<Animator>> AnimatorList; |
| 48 AnimatorList m_animators; | 49 AnimatorList animators_; |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 } // namespace blink | 52 } // namespace blink |
| 52 | 53 |
| 53 #endif // AnimationWorkletGlobalScope_h | 54 #endif // AnimationWorkletGlobalScope_h |
| OLD | NEW |