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

Side by Side 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 unified diff | Download patch
OLDNEW
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& userAgent, 22 const String& userAgent,
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&);
22 34
23 private: 35 private:
24 AnimationWorkletGlobalScope(const KURL&, 36 AnimationWorkletGlobalScope(const KURL&,
25 const String& userAgent, 37 const String& userAgent,
26 PassRefPtr<SecurityOrigin>, 38 PassRefPtr<SecurityOrigin>,
27 v8::Isolate*, 39 v8::Isolate*,
28 WorkerThread*); 40 WorkerThread*);
41
42 typedef HeapHashMap<String, Member<AnimatorDefinition>> DefinitionMap;
43 DefinitionMap m_animatorDefinitions;
44
45 typedef HeapVector<Member<Animator>> AnimatorList;
46 AnimatorList m_animators;
29 }; 47 };
30 48
31 } // namespace blink 49 } // namespace blink
32 50
33 #endif // AnimationWorkletGlobalScope_h 51 #endif // AnimationWorkletGlobalScope_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698